1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

wsproxy: decrement client rx buflist size at server side tx

https://github.com/warmcat/libwebsockets/issues/1738
This commit is contained in:
Zhiwen Zheng 2019-10-28 05:11:24 +00:00 committed by Andy Green
parent 6cb9f4eb60
commit 1d618e8793

View file

@ -169,7 +169,7 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,
break;
case LWS_CALLBACK_CLIENT_WRITEABLE:
dll = lws_dll2_get_tail(&wsi->ws->proxy_owner);
dll = lws_dll2_get_head(&wsi->ws->proxy_owner);
if (!dll)
break;
@ -180,12 +180,10 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,
pkt->first, pkt->final)) < 0)
return -1;
wsi->parent->ws->proxy_buffered -= pkt->len;
lws_dll2_remove(dll);
lws_free(pkt);
if (lws_dll2_get_tail(&wsi->ws->proxy_owner))
if (lws_dll2_get_head(&wsi->ws->proxy_owner))
lws_callback_on_writable(wsi);
break;
@ -226,6 +224,8 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,
pkt->first, pkt->final)) < 0)
return -1;
wsi->ws->proxy_buffered -= pkt->len;
lws_dll2_remove(dll);
lws_free(pkt);