mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
client handle connection fail at second phase properly
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
43bfd951fa
commit
ad45efa434
1 changed files with 13 additions and 2 deletions
|
@ -187,7 +187,11 @@ reset:
|
||||||
|
|
||||||
#ifndef LWS_NO_CLIENT
|
#ifndef LWS_NO_CLIENT
|
||||||
if (wsi->state == LWSS_CLIENT_UNCONNECTED)
|
if (wsi->state == LWSS_CLIENT_UNCONNECTED)
|
||||||
lws_client_connect_via_info2(wsi);
|
if (!lws_client_connect_via_info2(wsi))
|
||||||
|
/* our client connect has failed, the wsi
|
||||||
|
* has been closed
|
||||||
|
*/
|
||||||
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -300,7 +304,14 @@ int lws_header_table_detach(struct lws *wsi, int autoservice)
|
||||||
|
|
||||||
#ifndef LWS_NO_CLIENT
|
#ifndef LWS_NO_CLIENT
|
||||||
if (wsi->state == LWSS_CLIENT_UNCONNECTED)
|
if (wsi->state == LWSS_CLIENT_UNCONNECTED)
|
||||||
lws_client_connect_via_info2(wsi);
|
if (!lws_client_connect_via_info2(wsi)) {
|
||||||
|
/* our client connect has failed, the wsi
|
||||||
|
* has been closed
|
||||||
|
*/
|
||||||
|
lws_pt_unlock(pt);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert(!!pt->ah_wait_list_length == !!(int)(long)pt->ah_wait_list);
|
assert(!!pt->ah_wait_list_length == !!(int)(long)pt->ah_wait_list);
|
||||||
|
|
Loading…
Add table
Reference in a new issue