mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-04 04:31:44 +00:00
Merge branch 'master' of github.com:unbit/uwsgi
This commit is contained in:
+3
-1
@@ -201,11 +201,13 @@ static void uwsgi_alarm_thread_loop(struct uwsgi_thread *ut) {
|
||||
long ptr = 0;
|
||||
memcpy(&ptr, buf, sizeof(long));
|
||||
struct uwsgi_alarm_instance *uai = (struct uwsgi_alarm_instance *) ptr;
|
||||
if (!uai) return;
|
||||
if (!uai)
|
||||
break;
|
||||
uwsgi_alarm_run(uai, msg, msg_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
|
||||
// initialize alarms, instances and log regexps
|
||||
|
||||
+10
-8
@@ -316,12 +316,11 @@ static void uwsgi_exception_run_handlers(struct uwsgi_buffer *ub) {
|
||||
|
||||
void uwsgi_manage_exception(struct wsgi_request *wsgi_req,int catch) {
|
||||
|
||||
int do_exit = 0;
|
||||
int do_exit = uwsgi.reload_on_exception;
|
||||
|
||||
if (uwsgi.reload_on_exception) {
|
||||
do_exit = 1;
|
||||
goto check_catch;
|
||||
}
|
||||
if (!wsgi_req) goto log2;
|
||||
|
||||
if (do_exit) goto check_catch;
|
||||
|
||||
if (wsgi_req && uwsgi.exception_handlers_instance) {
|
||||
struct uwsgi_buffer *ehi = uwsgi_exception_handler_object(wsgi_req);
|
||||
@@ -331,8 +330,6 @@ void uwsgi_manage_exception(struct wsgi_request *wsgi_req,int catch) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!wsgi_req) goto log2;
|
||||
|
||||
uwsgi.workers[uwsgi.mywid].cores[wsgi_req->async_id].exceptions++;
|
||||
uwsgi_apps[wsgi_req->app_id].exceptions++;
|
||||
|
||||
@@ -452,13 +449,15 @@ static void uwsgi_exception_handler_thread_loop(struct uwsgi_thread *ut) {
|
||||
long ptr = 0;
|
||||
memcpy(&ptr, buf, sizeof(long));
|
||||
struct uwsgi_exception_handler_instance *uehi = (struct uwsgi_exception_handler_instance *) ptr;
|
||||
if (!uehi) return;
|
||||
if (!uehi)
|
||||
break;
|
||||
if (uehi->handler->func(uehi, msg, msg_size)) {
|
||||
uwsgi_log("[uwsgi-exception] error running the handler \"%s\" args: \"%s\"\n", uehi->handler->name, uehi->arg ? uehi->arg : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void uwsgi_exception_setup_handlers() {
|
||||
@@ -473,8 +472,11 @@ void uwsgi_exception_setup_handlers() {
|
||||
struct uwsgi_exception_handler *ueh = uwsgi_exception_handler_by_name(handler);
|
||||
if (!ueh) {
|
||||
uwsgi_log("unable to find exception handler: %s\n", handler);
|
||||
free(handler);
|
||||
exit(1);
|
||||
}
|
||||
free(handler);
|
||||
|
||||
struct uwsgi_exception_handler_instance *uehi = uwsgi_calloc(sizeof(struct uwsgi_exception_handler_instance));
|
||||
uehi->handler = ueh;
|
||||
if (colon) {
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ char *ini_get_key(char *key) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
char *ini_get_line(char *ini, off_t size) {
|
||||
char *ini_get_line(char *ini, size_t size) {
|
||||
|
||||
off_t i;
|
||||
char *ptr = ini;
|
||||
|
||||
@@ -148,6 +148,7 @@ static time_t parse_http_date(char *date, uint16_t len) {
|
||||
|
||||
case 'N':
|
||||
hdtm.tm_mon = 10;
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
hdtm.tm_mon = 11;
|
||||
|
||||
+1
-1
@@ -767,7 +767,7 @@ void uwsgi_subscribe2(char *arg, uint8_t cmd) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!s2_server && !s2_key) goto end;
|
||||
if (!s2_server || !s2_key) goto end;
|
||||
|
||||
if (s2_check) {
|
||||
if (uwsgi_file_exists(s2_check)) goto end;
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ int yaml_get_depth(char *line) {
|
||||
return depth;
|
||||
}
|
||||
|
||||
char *yaml_get_line(char *yaml, off_t size) {
|
||||
char *yaml_get_line(char *yaml, size_t size) {
|
||||
|
||||
off_t i;
|
||||
char *ptr = yaml;
|
||||
|
||||
@@ -152,12 +152,9 @@ int http_response_parse(struct http_session *hr, struct uwsgi_buffer *ub, size_t
|
||||
|
||||
}
|
||||
}
|
||||
hr->session.can_keepalive = hr->session.can_keepalive;
|
||||
}
|
||||
else if (hr->session.can_keepalive) {
|
||||
#else
|
||||
if (hr->session.can_keepalive) {
|
||||
} else
|
||||
#endif
|
||||
if (hr->session.can_keepalive) {
|
||||
if (uhttp.auto_chunked) {
|
||||
char cr = buf[len-2];
|
||||
char nl = buf[len-1];
|
||||
|
||||
@@ -16,7 +16,7 @@ static int uwsgi_routing_func_http(struct wsgi_request *wsgi_req, struct uwsgi_r
|
||||
if (ur->data3_len) {
|
||||
char **subject = (char **) (((char *)(wsgi_req))+ur->subject);
|
||||
uint16_t *subject_len = (uint16_t *) (((char *)(wsgi_req))+ur->subject_len);
|
||||
struct uwsgi_buffer *ub_url = uwsgi_routing_translate(wsgi_req, ur, *subject, *subject_len, ur->data3, ur->data3_len);
|
||||
ub_url = uwsgi_routing_translate(wsgi_req, ur, *subject, *subject_len, ur->data3, ur->data3_len);
|
||||
if (!ub_url) return UWSGI_ROUTE_BREAK;
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,6 @@ end:
|
||||
|
||||
struct uwsgi_buffer *uwsgi_proto_base_cgi_prepare_headers(struct wsgi_request *wsgi_req, char *s, uint16_t sl) {
|
||||
struct uwsgi_buffer *ub = uwsgi_buffer_new(8 + sl + 2);
|
||||
ub = uwsgi_buffer_new(8 + sl + 2);
|
||||
if (uwsgi_buffer_append(ub, "Status: ", 8)) goto end;
|
||||
if (uwsgi_buffer_append(ub, s, sl)) goto end;
|
||||
if (uwsgi_buffer_append(ub, "\r\n", 2)) goto end;
|
||||
|
||||
Reference in New Issue
Block a user