From 731ea79028cb8e0d485b38823510bc471843ab03 Mon Sep 17 00:00:00 2001 From: Luciano Iam Date: Fri, 10 Apr 2020 08:23:33 +0200 Subject: WebSockets: fix timeout when sending HTTP body --- libs/surfaces/websockets/server.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/surfaces/websockets/server.cc b/libs/surfaces/websockets/server.cc index 2abd810c34..7455770a7d 100644 --- a/libs/surfaces/websockets/server.cc +++ b/libs/surfaces/websockets/server.cc @@ -398,7 +398,9 @@ WebsocketsServer::send_index_body (Client wsi) return 1; } - if (lws_http_transaction_completed (wsi)) { + /* lws_http_transaction_completed() returns 1 if the HTTP connection must close now + Returns 0 and resets connection to wait for new HTTP header / transaction if possible */ + if (lws_http_transaction_completed (wsi) != 1) { return 1; } -- cgit v1.2.3