test server extend timeout while sending leaf
authorAndy Green <andy.green@linaro.org>
Thu, 10 Apr 2014 03:11:06 +0000 (11:11 +0800)
committerAndy Green <andy.green@linaro.org>
Thu, 10 Apr 2014 03:11:06 +0000 (11:11 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
test-server/test-server.c

index cd8f4e2..d2e56b4 100644 (file)
@@ -383,6 +383,10 @@ static int callback_http(struct libwebsocket_context *context,
                                /* partial write, adjust */
                                lseek(pss->fd, m - n, SEEK_CUR);
 
+                       if (m) /* while still active, extend timeout */
+                               libwebsocket_set_timeout(wsi,
+                                       PENDING_TIMEOUT_HTTP_CONTENT, 5);
+
                } while (!lws_send_pipe_choked(wsi));
                libwebsocket_callback_on_writable(context, wsi);
                break;