mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-15 10:29:47 +00:00
Add "struct mg_http_message::head" attr
This commit is contained in:
1 parent
4844ed60bd
commit
42bc7b1f47
4 files changed
+10
-6
No files matched your search
+3
-2
@@ -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
|
||||
|
||||
+2
-1
@@ -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()
|
||||
|
||||
+3
-2
@@ -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
|
||||
|
||||
+2
-1
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user