Explorar el Código

Reset mg_connection::content_len for chunked transfer encoding.

It looks that the content_len field of mg_connection isn't reset
by reset_per_request_attributes() nor in get_requests() when it
comes to chunked transfer encoding of HTTP.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Radoslaw Zarzynski hace 7 años
padre
commit
1aa13f2545
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      src/civetweb.c

+ 1 - 0
src/civetweb.c

@@ -15200,6 +15200,7 @@ get_request(struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
 	                            "Transfer-Encoding")) != NULL
 	           && !mg_strcasecmp(cl, "chunked")) {
 		conn->is_chunked = 1;
+		conn->content_len = 0;
 	} else if (!mg_strcasecmp(conn->request_info.request_method, "POST")
 	           || !mg_strcasecmp(conn->request_info.request_method, "PUT")) {
 		/* POST or PUT request without content length set */