mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-19 08:03:14 +08:00
Add "struct mg_http_message::head" attr
This commit is contained in:
parent
4844ed60bd
commit
42bc7b1f47
@ -570,8 +570,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
|
||||
|
@ -694,7 +694,8 @@ struct mg_http_message {
|
||||
struct mg_str method, uri, query, proto; // Request/response line
|
||||
struct mg_http_header headers[MG_MAX_HTTP_HEADERS]; // Headers
|
||||
struct mg_str body; // Body
|
||||
struct mg_str message; // Request line + headers + body
|
||||
struct mg_str head; // Request + headers
|
||||
struct mg_str message; // Request + headers + body
|
||||
};
|
||||
|
||||
// Parameter for mg_http_serve_dir()
|
||||
|
@ -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
|
||||
|
@ -16,7 +16,8 @@ struct mg_http_message {
|
||||
struct mg_str method, uri, query, proto; // Request/response line
|
||||
struct mg_http_header headers[MG_MAX_HTTP_HEADERS]; // Headers
|
||||
struct mg_str body; // Body
|
||||
struct mg_str message; // Request line + headers + body
|
||||
struct mg_str head; // Request + headers
|
||||
struct mg_str message; // Request + headers + body
|
||||
};
|
||||
|
||||
// Parameter for mg_http_serve_dir()
|
||||
|
Loading…
Reference in New Issue
Block a user