ported router_http improvements to router_uwsgi

This commit is contained in:
Unbit
2013-04-11 17:59:49 +02:00
parent fc359f1956
commit e0964d07ea
3 changed files with 9 additions and 3 deletions
-2
View File
@@ -610,8 +610,6 @@ void uwsgi_logit_simple(struct wsgi_request *wsgi_req) {
via = msg3;
break;
case UWSGI_VIA_OFFLOAD:
// set the status to 202 as it is unavailable
wsgi_req->status = 202;
via = msg4;
break;
default:
+1
View File
@@ -55,6 +55,7 @@ static int uwsgi_routing_func_http(struct wsgi_request *wsgi_req, struct uwsgi_r
}
if (!uwsgi_offload_request_net_do(wsgi_req, addr, ub)) {
wsgi_req->via = UWSGI_VIA_OFFLOAD;
wsgi_req->status = 202;
return UWSGI_ROUTE_BREAK;
}
}
+8 -1
View File
@@ -58,9 +58,16 @@ static int uwsgi_routing_func_uwsgi_remote(struct wsgi_request *wsgi_req, struct
}
// ok now if have offload threads, directly use them
if (wsgi_req->socket->can_offload) {
if (!wsgi_req->post_file && wsgi_req->socket->can_offload) {
// append buffered body
if (uwsgi.post_buffering > 0 && wsgi_req->post_cl > 0) {
if (uwsgi_buffer_append(ub, wsgi_req->post_buffering_buf, wsgi_req->post_cl)) {
goto end;
}
}
if (!uwsgi_offload_request_net_do(wsgi_req, addr, ub)) {
wsgi_req->via = UWSGI_VIA_OFFLOAD;
wsgi_req->status = 202;
return UWSGI_ROUTE_BREAK;
}
}