1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

dummy: add transaction completed processing for POST

This commit is contained in:
Andy Green 2018-05-24 12:19:53 +08:00
parent 0a1d54a3c4
commit 0f9c75f6b5
2 changed files with 5 additions and 0 deletions

View file

@ -362,6 +362,7 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
return -1;
break;
#if !defined(LWS_NO_SERVER)
case LWS_CALLBACK_HTTP_BODY_COMPLETION:
case LWS_CALLBACK_HTTP_FILE_COMPLETION:
if (lws_http_transaction_completed(wsi))
return -1;

View file

@ -119,6 +119,10 @@ lws_read_h1(struct lws *wsi, unsigned char *buf, lws_filepos_t len)
http_postbody:
lwsl_debug("%s: http post body: remain %d\n", __func__,
(int)wsi->http.rx_content_remain);
if (!wsi->http.rx_content_remain)
goto postbody_completion;
while (len && wsi->http.rx_content_remain) {
/* Copy as much as possible, up to the limit of:
* what we have in the read buffer (len)