ah pool lifetime use dynamic rxpos
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
9231afca4b
commit
c1e6e38709
2 changed files with 16 additions and 6 deletions
|
@ -190,7 +190,7 @@ 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 that's all */
|
if (!ah) { /* remove from wait list if that's all */
|
||||||
if (wsi->socket_is_permanently_unusable)
|
// 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",
|
||||||
|
@ -206,9 +206,18 @@ int lws_header_table_detach(struct lws *wsi)
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
time(&now);
|
time(&now);
|
||||||
if (now - wsi->u.hdr.ah->assigned > 3)
|
if (now - wsi->u.hdr.ah->assigned > 3) {
|
||||||
lwsl_notice("header assign - free time %d\n",
|
/*
|
||||||
(int)(now - wsi->u.hdr.ah->assigned));
|
* we're detaching the ah, but it was held an
|
||||||
|
* unreasonably long time
|
||||||
|
*/
|
||||||
|
lwsl_notice("%s: wsi %p: ah held %ds, "
|
||||||
|
"ah.rxpos %d, ah.rxlen %d, mode/state %d %d,"
|
||||||
|
"wsi->more_rx_waiting %d\n", __func__, wsi,
|
||||||
|
(int)(now - wsi->u.hdr.ah->assigned),
|
||||||
|
ah->rxpos, ah->rxlen, wsi->mode, wsi->state,
|
||||||
|
wsi->u.hdr.more_rx_waiting);
|
||||||
|
}
|
||||||
|
|
||||||
/* if we think we're detaching one, there should be one in use */
|
/* if we think we're detaching one, there should be one in use */
|
||||||
assert(pt->ah_count_in_use > 0);
|
assert(pt->ah_count_in_use > 0);
|
||||||
|
|
|
@ -739,9 +739,10 @@ lws_http_transaction_completed(struct lws *wsi)
|
||||||
* reset the existing header table and keep it.
|
* reset the existing header table and keep it.
|
||||||
*/
|
*/
|
||||||
if (wsi->u.hdr.ah) {
|
if (wsi->u.hdr.ah) {
|
||||||
if (wsi->u.hdr.ah->rxpos == wsi->u.hdr.ah->rxlen)
|
if (!wsi->u.hdr.more_rx_waiting) {
|
||||||
|
wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen;
|
||||||
lws_header_table_detach(wsi);
|
lws_header_table_detach(wsi);
|
||||||
else
|
} else
|
||||||
lws_header_table_reset(wsi);
|
lws_header_table_reset(wsi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue