closing drops any pending ah rx immediately
authorAndy Green <andy@warmcat.com>
Tue, 4 Oct 2016 10:05:10 +0000 (18:05 +0800)
committerAndy Green <andy@warmcat.com>
Tue, 4 Oct 2016 10:05:10 +0000 (18:05 +0800)
lib/libwebsockets.c
lib/lws-plat-unix.c
lib/server.c

index 96dcf07..ac5da5d 100755 (executable)
@@ -62,10 +62,6 @@ lws_free_wsi(struct lws *wsi)
        lws_free_set_NULL(wsi->rxflow_buffer);
        lws_free_set_NULL(wsi->trunc_alloc);
 
-       if (wsi->u.hdr.ah)
-               /* we're closing, losing some rx is OK */
-               wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen;
-
        /* we may not have an ah, but may be on the waiting list... */
        lwsl_info("ah det due to close\n");
        lws_header_table_detach(wsi, 0);
@@ -154,6 +150,10 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason)
        }
 #endif
 
+       if (wsi->u.hdr.ah)
+               /* we're closing, losing some rx is OK */
+               wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen;
+
        context = wsi->context;
        pt = &context->pt[(int)wsi->tsi];
 
index 23ff642..1a2fe5f 100644 (file)
@@ -140,7 +140,7 @@ lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
                /* still somebody left who wants forced service? */
                if (!lws_service_adjust_timeout(context, 1, pt->tid)) {
                        /* yes... come back again later */
-                       lwsl_debug("%s: done again\n", __func__);
+                       //lwsl_debug("%s: done again\n", __func__);
                }
                return 0;
        }
index cc67e73..72dcbed 100644 (file)
@@ -1798,8 +1798,6 @@ lws_server_socket_service(struct lws_context *context, struct lws *wsi,
                                             wsi->mode != LWSCM_HTTP_SERVING_ACCEPTED &&
                                             wsi->mode != LWSCM_HTTP2_SERVING))
                                                lws_header_table_detach(wsi, 1);
-                                       else
-                                               wsi->more_rx_waiting = 1;
                                }
                                break;
                        }