Correct msg len for chunked encoding

Close cesanta/dev#6485

PUBLISHED_FROM=172ab4f18f1fb3e6110ad03eea18a7f87f2e531a
This commit is contained in:
Alexander Alashkin 2017-02-07 20:03:51 +08:00 committed by Cesanta Bot
parent a58d21aa28
commit d6ba37dc3c

View File

@ -5338,7 +5338,9 @@ MG_INTERNAL size_t mg_handle_chunked(struct mg_connection *nc,
}
if (zero_chunk_received) {
hm->message.len = (size_t) pd->chunk.body_len + blen - i;
/* Total message size is len(body) + len(headers) */
hm->message.len =
(size_t) pd->chunk.body_len + blen - i + (hm->body.p - hm->message.p);
}
}