mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
close wsi must do detatch ah flow even if no ah
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
897197146a
commit
4ba798dd7d
3 changed files with 18 additions and 15 deletions
|
@ -27,6 +27,9 @@ when it finishes replying to a transaction in http. Previously the library
|
||||||
did it for you, but that disallowed large, long transfers with multiple
|
did it for you, but that disallowed large, long transfers with multiple
|
||||||
trips around the event loop (and cgi...).
|
trips around the event loop (and cgi...).
|
||||||
|
|
||||||
|
6) MAJOR connections on ah waiting list that closed did not get removed from
|
||||||
|
the waiting list...
|
||||||
|
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -58,11 +58,12 @@ lws_free_wsi(struct lws *wsi)
|
||||||
lws_free_set_NULL(wsi->rxflow_buffer);
|
lws_free_set_NULL(wsi->rxflow_buffer);
|
||||||
lws_free_set_NULL(wsi->trunc_alloc);
|
lws_free_set_NULL(wsi->trunc_alloc);
|
||||||
|
|
||||||
if (wsi->u.hdr.ah) {
|
if (wsi->u.hdr.ah)
|
||||||
/* we're closing, losing some rx is OK */
|
/* we're closing, losing some rx is OK */
|
||||||
wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen;
|
wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen;
|
||||||
lws_header_table_detach(wsi);
|
|
||||||
}
|
/* we may not have an ah, but may be on the waiting list... */
|
||||||
|
lws_header_table_detach(wsi);
|
||||||
|
|
||||||
wsi->context->count_wsi_allocated--;
|
wsi->context->count_wsi_allocated--;
|
||||||
lwsl_debug("%s: %p, remaining wsi %d\n", __func__, wsi,
|
lwsl_debug("%s: %p, remaining wsi %d\n", __func__, wsi,
|
||||||
|
|
|
@ -203,19 +203,18 @@ int lws_header_table_detach(struct lws *wsi)
|
||||||
|
|
||||||
pwsi = &pt->ah_wait_list;
|
pwsi = &pt->ah_wait_list;
|
||||||
if (!ah) { /* remove from wait list if none attached */
|
if (!ah) { /* remove from wait list if none attached */
|
||||||
// if (wsi->socket_is_permanently_unusable)
|
while (*pwsi) {
|
||||||
while (*pwsi) {
|
if (*pwsi == wsi) {
|
||||||
if (*pwsi == wsi) {
|
lwsl_info("%s: wsi %p, remv wait\n",
|
||||||
lwsl_info("%s: wsi %p, remv wait\n",
|
__func__, wsi);
|
||||||
__func__, wsi);
|
*pwsi = wsi->u.hdr.ah_wait_list;
|
||||||
*pwsi = wsi->u.hdr.ah_wait_list;
|
wsi->u.hdr.ah_wait_list = NULL;
|
||||||
wsi->u.hdr.ah_wait_list = NULL;
|
pt->ah_wait_list_length--;
|
||||||
pt->ah_wait_list_length--;
|
goto bail;
|
||||||
goto bail;
|
|
||||||
}
|
|
||||||
pwsi = &(*pwsi)->u.hdr.ah_wait_list;
|
|
||||||
}
|
}
|
||||||
|
pwsi = &(*pwsi)->u.hdr.ah_wait_list;
|
||||||
|
}
|
||||||
|
/* no ah, not on list... no more business here */
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
/* we did have an ah attached */
|
/* we did have an ah attached */
|
||||||
|
|
Loading…
Add table
Reference in a new issue