correct error handling path in client handshake
After Vikas Gahlan http://ml.libwebsockets.org/pipermail/libwebsockets/2015-October/001955.html Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
74a54e8b94
commit
b5cf69fdb5
1 changed files with 6 additions and 1 deletions
|
@ -155,6 +155,11 @@ struct libwebsocket *libwebsocket_client_connect_2(
|
|||
if (insert_wsi_socket_into_fds(context, wsi))
|
||||
goto oom4;
|
||||
|
||||
/*
|
||||
* past here, we can't simply free the structs as error
|
||||
* handling as oom4 does. We have to run the whole close flow.
|
||||
*/
|
||||
|
||||
libwebsocket_set_timeout(wsi,
|
||||
PENDING_TIMEOUT_AWAITING_CONNECT_RESPONSE,
|
||||
AWAITING_TIMEOUT);
|
||||
|
@ -219,7 +224,7 @@ struct libwebsocket *libwebsocket_client_connect_2(
|
|||
* about the connect completion
|
||||
*/
|
||||
if (lws_change_pollfd(wsi, 0, LWS_POLLOUT))
|
||||
goto oom4;
|
||||
goto failed;
|
||||
lws_libev_io(context, wsi, LWS_EV_START | LWS_EV_WRITE);
|
||||
|
||||
return wsi;
|
||||
|
|
Loading…
Add table
Reference in a new issue