diff --git a/examples/file-upload/main.c b/examples/file-upload/main.c index 74c3fac9..b8fb26db 100644 --- a/examples/file-upload/main.c +++ b/examples/file-upload/main.c @@ -16,7 +16,7 @@ static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { if (ev == MG_EV_HTTP_CHUNK && mg_http_match_uri(hm, "/upload")) { MG_INFO(("Got chunk len %lu", (unsigned long) hm->chunk.len)); MG_INFO(("Query string: [%.*s]", (int) hm->query.len, hm->query.ptr)); - MG_INFO(("Chunk data:\n%.*s", (int) hm->chunk.len, hm->chunk.ptr)); + // MG_INFO(("Chunk data:\n%.*s", (int) hm->chunk.len, hm->chunk.ptr)); mg_http_delete_chunk(c, hm); if (hm->chunk.len == 0) { MG_INFO(("Last chunk received, sending response")); @@ -25,7 +25,7 @@ static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { } else if (ev == MG_EV_HTTP_MSG && mg_http_match_uri(hm, "/upload")) { MG_INFO(("Got all %lu bytes!", (unsigned long) hm->body.len)); MG_INFO(("Query string: [%.*s]", (int) hm->query.len, hm->query.ptr)); - MG_INFO(("Body:\n%.*s", (int) hm->body.len, hm->body.ptr)); + // MG_INFO(("Body:\n%.*s", (int) hm->body.len, hm->body.ptr)); mg_http_reply(c, 200, "", "ok (%lu)\n", (unsigned long) hm->body.len); } else if (ev == MG_EV_HTTP_MSG) { struct mg_http_serve_opts opts = {.root_dir = "web_root"}; diff --git a/mongoose.c b/mongoose.c index b6b6bd04..8710b455 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1868,7 +1868,7 @@ void mg_http_delete_chunk(struct mg_connection *c, struct mg_http_message *hm) { struct mg_str ch = hm->chunk; const char *end = (char *) &c->recv.buf[c->recv.len], *ce; bool chunked = mg_is_chunked(hm); - if (!mg_is_chunked(hm)) return; + // if (!mg_is_chunked(hm)) return; if (chunked) { ch.len += 4, ch.ptr -= 2; // \r\n before and after the chunk while (ch.ptr > hm->body.ptr && *ch.ptr != '\n') ch.ptr--, ch.len++; diff --git a/src/http.c b/src/http.c index 9c2e19a3..bac5c647 100644 --- a/src/http.c +++ b/src/http.c @@ -872,7 +872,6 @@ void mg_http_delete_chunk(struct mg_connection *c, struct mg_http_message *hm) { struct mg_str ch = hm->chunk; const char *end = (char *) &c->recv.buf[c->recv.len], *ce; bool chunked = mg_is_chunked(hm); - if (!mg_is_chunked(hm)) return; if (chunked) { ch.len += 4, ch.ptr -= 2; // \r\n before and after the chunk while (ch.ptr > hm->body.ptr && *ch.ptr != '\n') ch.ptr--, ch.len++;