mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ss: handle nonzero content-length set by metadata correctly
This commit is contained in:
parent
426623433a
commit
e815ad2920
1 changed files with 12 additions and 0 deletions
|
@ -194,6 +194,18 @@ lws_apply_metadata(lws_ss_handle_t *h, struct lws *wsi, uint8_t *buf,
|
|||
h->metadata[m].value__may_own_heap,
|
||||
(int)h->metadata[m].length, pp, end))
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* Check for the case he's setting a non-zero
|
||||
* content-length "via the backdoor" metadata-
|
||||
* driven headers, and set the body_pending()
|
||||
* state if so...
|
||||
*/
|
||||
|
||||
if (!strncmp(polmd->value__may_own_heap,
|
||||
"content-length", 14) &&
|
||||
atoi(h->metadata[m].value__may_own_heap))
|
||||
lws_client_http_body_pending(wsi, 1);
|
||||
}
|
||||
|
||||
m++;
|
||||
|
|
Loading…
Add table
Reference in a new issue