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

solve broken partial file sends

We can't force the wsi state to HTTP_BODY without considering the callback
may already have set the state to sending a file.

This fixes the bug that we can get stalled in the test app at
"choked before able to send whole file"

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-12-09 11:27:07 +08:00
parent ca15338545
commit aa08492021

View file

@ -277,11 +277,13 @@ leave:
AWAITING_TIMEOUT);
/*
* (if callback didn't start sending a file)
* deal with anything else as body, whether
* there was a content-length or not
*/
wsi->state = WSI_STATE_HTTP_BODY;
if (wsi->state != WSI_STATE_HTTP_ISSUING_FILE)
wsi->state = WSI_STATE_HTTP_BODY;
goto http_postbody;
}