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

file serve: defer transaction completed to HTTP_FILE_COMPLETION

This commit is contained in:
Andy Green 2017-06-28 14:27:09 +08:00
parent 8f4f692945
commit a637d8f41f

View file

@ -2379,12 +2379,15 @@ try_pollout:
break;
}
/* >0 == completion, <0 == error */
/* >0 == completion, <0 == error
*
* We'll get a LWS_CALLBACK_HTTP_FILE_COMPLETION callback when
* it's done. That's the case even if we just completed the
* send, so wait for that.
*/
n = lws_serve_http_file_fragment(wsi);
if (n < 0 || (n > 0 && lws_http_transaction_completed(wsi))) {
lwsl_info("completed\n");
if (n < 0)
goto fail;
}
break;