Skip to content
Snippets Groups Projects
Commit b5cf69fd authored by Andy Green's avatar Andy Green
Browse files

correct error handling path in client handshake

parent 74a54e8b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment