mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-02 13:20:51 +00:00
fixing offset of Content-Length value.
in very large HTTP response, this offset might cause a problem with HTTP header format.
This commit is contained in:
1 parent
1dcb7dd13d
commit
895ca80b2b
1 file changed
+1
-1
+1
-1
@@ -616,7 +616,7 @@ static void listdir(struct mg_connection *c, struct mg_http_message *hm,
|
|||||||
MG_VERSION);
|
MG_VERSION);
|
||||||
n = mg_snprintf(tmp, sizeof(tmp), "%lu", (unsigned long) (c->send.len - off));
|
n = mg_snprintf(tmp, sizeof(tmp), "%lu", (unsigned long) (c->send.len - off));
|
||||||
if (n > sizeof(tmp)) n = 0;
|
if (n > sizeof(tmp)) n = 0;
|
||||||
memcpy(c->send.buf + off - 10, tmp, n); // Set content length
|
memcpy(c->send.buf + off - 12, tmp, n); // Set content length
|
||||||
}
|
}
|
||||||
|
|
||||||
static void remove_double_dots(char *s) {
|
static void remove_double_dots(char *s) {
|
||||||
|
|||||||
Reference in new issue
Block a user