Add "struct mg_http_message::head" attr

This commit is contained in:
cpq committed 2021-02-09 13:27:17 +00:00
1 parent 4844ed60bd
commit 42bc7b1f47
4 files changed
+10 -6

No files matched your search

+3 -2
View File
@@ -150,8 +150,9 @@ int mg_http_parse(const char *s, size_t len, struct mg_http_message *hm) {
memset(hm, 0, sizeof(*hm));
if (req_len <= 0) return req_len;
hm->message.ptr = s;
hm->body.ptr = s + req_len;
hm->message.ptr = hm->head.ptr = s;
hm->body.ptr = end;
hm->head.len = req_len;
hm->message.len = hm->body.len = (size_t) ~0; // Set body length to infinite
// Parse request line