keepalive close file when send completes dont wait for wsi close processing
authorAndy Green <andy.green@linaro.org>
Mon, 26 Oct 2015 23:07:14 +0000 (07:07 +0800)
committerAndy Green <andy.green@linaro.org>
Mon, 26 Oct 2015 23:07:14 +0000 (07:07 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/output.c

index 728dada..785368c 100644 (file)
@@ -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(