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

[PATCH] added timeout reset in serve_http_file_fragment to prevent timeout on big files

This commit is contained in:
=?UTF-8?q?Dalibor=20Ba=C4=8Da?= 2015-10-10 18:17:42 +02:00 committed by Andy Green
parent 3ae1badae7
commit 5400f47efe

View file

@ -538,6 +538,7 @@ LWS_VISIBLE int libwebsockets_serve_http_file_fragment(
if (n < 0)
return -1; /* caller will close */
if (n) {
libwebsocket_set_timeout(wsi, PENDING_TIMEOUT_HTTP_CONTENT, AWAITING_TIMEOUT);
wsi->u.http.filepos += n;
m = libwebsocket_write(wsi, context->service_buffer, n,
wsi->u.http.filepos == wsi->u.http.filelen ? LWS_WRITE_HTTP_FINAL : LWS_WRITE_HTTP);