test server post also take care about POST len termination
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
7624a8b128
commit
e36ce9b20e
1 changed files with 2 additions and 0 deletions
|
@ -407,6 +407,8 @@ int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
|
|||
lwsl_notice("LWS_CALLBACK_HTTP_BODY: len %d\n", (int)len);
|
||||
strncpy(pss->post_string, in, sizeof (pss->post_string) -1);
|
||||
pss->post_string[sizeof(pss->post_string) - 1] = '\0';
|
||||
if (len < sizeof(pss->post_string) - 1)
|
||||
pss->post_string[len] = '\0';
|
||||
break;
|
||||
|
||||
case LWS_CALLBACK_HTTP_BODY_COMPLETION:
|
||||
|
|
Loading…
Add table
Reference in a new issue