mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
coverity 158145 lws_header_table_detatch must handle no ah attached
callers should protect it so this doesn't make a problem. But Coverity is correct the code is confused about it. Make it okay if we close a connection before the ah got attached. Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
1e32c2b67a
commit
27966c29e1
1 changed files with 2 additions and 4 deletions
|
@ -179,10 +179,8 @@ int lws_header_table_detach(struct lws *wsi)
|
|||
(void *)wsi, (void *)wsi->u.hdr.ah, wsi->tsi,
|
||||
pt->ah_count_in_use);
|
||||
|
||||
assert(ah);
|
||||
|
||||
/* may not be detached while he still has unprocessed rx */
|
||||
if (ah->rxpos != ah->rxlen) {
|
||||
if (ah && ah->rxpos != ah->rxlen) {
|
||||
lwsl_err("%s: %p: rxpos:%d, rxlen:%d\n", __func__, wsi,
|
||||
ah->rxpos, ah->rxlen);
|
||||
assert(ah->rxpos == ah->rxlen);
|
||||
|
@ -191,7 +189,7 @@ int lws_header_table_detach(struct lws *wsi)
|
|||
lws_pt_lock(pt);
|
||||
|
||||
pwsi = &pt->ah_wait_list;
|
||||
if (!wsi->u.hdr.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)
|
||||
while (*pwsi) {
|
||||
if (*pwsi == wsi) {
|
||||
|
|
Loading…
Add table
Reference in a new issue