From c6f95d3f27b1668654d7e96b818f42f87b88a08d Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 27 Oct 2015 07:07:14 +0800 Subject: [PATCH] keepalive close file when send completes dont wait for wsi close processing Signed-off-by: Andy Green --- lib/output.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/output.c b/lib/output.c index 728dada8..785368c4 100644 --- a/lib/output.c +++ b/lib/output.c @@ -555,6 +555,10 @@ all_sent: wsi->u.http.filepos == wsi->u.http.filelen) { wsi->state = WSI_STATE_HTTP; + /* we might be in keepalive, so close it off here */ + compatible_file_close(wsi->u.http.fd); + wsi->u.http.fd = LWS_INVALID_FILE; + if (wsi->protocol->callback) /* ignore callback returned value */ user_callback_handle_rxflow(