mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-18 19:45:48 +00:00
added automatic management of chunked input in http router
This commit is contained in:
+1
-1
@@ -1527,7 +1527,7 @@ static void uwsgi_emperor_spawn_vassal(struct uwsgi_instance *n_ui) {
|
||||
|
||||
if (uwsgi.emperor_tyrant_initgroups) {
|
||||
char *uidname = NULL;
|
||||
gid_t gid = NULL;
|
||||
gid_t gid = n_ui->gid;
|
||||
struct passwd *pw = getpwuid(n_ui->uid);
|
||||
|
||||
if (pw) {
|
||||
|
||||
@@ -50,6 +50,7 @@ struct uwsgi_http {
|
||||
int proto_http;
|
||||
|
||||
int manage_rtsp;
|
||||
int chunked_input;
|
||||
};
|
||||
|
||||
struct http_session {
|
||||
|
||||
@@ -41,6 +41,7 @@ struct uwsgi_option http_options[] = {
|
||||
|
||||
{"http-raw-body", no_argument, 0, "blindly send HTTP body to backends (required for WebSockets and Icecast support in backends)", uwsgi_opt_true, &uhttp.raw_body, 0},
|
||||
{"http-websockets", no_argument, 0, "automatically detect websockets connections and put the session in raw mode", uwsgi_opt_true, &uhttp.websockets, 0},
|
||||
{"http-chunked-input", no_argument, 0, "automatically detect chunked input requests and put the session in raw mode", uwsgi_opt_true, &uhttp.chunked_input, 0},
|
||||
|
||||
{"http-use-code-string", required_argument, 0, "use code string as hostname->server mapper for the http router", uwsgi_opt_corerouter_cs, &uhttp, 0},
|
||||
{"http-use-socket", optional_argument, 0, "forward request to the specified uwsgi socket", uwsgi_opt_corerouter_use_socket, &uhttp, 0},
|
||||
@@ -164,6 +165,11 @@ static int http_header_dumb_check(struct http_session *hr, struct corerouter_pee
|
||||
// in the future we could support chunked requests...
|
||||
else if (!uwsgi_strnicmp("TRANSFER_ENCODING", 17, hh, keylen)) {
|
||||
hr->session.can_keepalive = 0;
|
||||
if (uhttp.chunked_input) {
|
||||
if (!uwsgi_strnicmp(val, vallen, "chunked", 7)) {
|
||||
hr->raw_body = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (!uwsgi_strnicmp("CONNECTION", 10, hh, keylen)) {
|
||||
@@ -261,6 +267,11 @@ static int http_add_uwsgi_header(struct corerouter_peer *peer, char *hh, size_t
|
||||
// in the future we could support chunked requests...
|
||||
else if (!uwsgi_strncmp("TRANSFER_ENCODING", 17, hh, keylen)) {
|
||||
hr->session.can_keepalive = 0;
|
||||
if (uhttp.chunked_input) {
|
||||
if (!uwsgi_strnicmp(val, vallen, "chunked", 7)) {
|
||||
hr->raw_body = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (!uwsgi_strncmp("CONNECTION", 10, hh, keylen)) {
|
||||
|
||||
Reference in New Issue
Block a user