mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
smp: extend client to work with tsi
and take care of zombie sul previously left on connect failure path
This commit is contained in:
parent
eac4489237
commit
bd8f69e438
2 changed files with 5 additions and 4 deletions
|
@ -217,7 +217,7 @@ lws_client_connect_3_connect(struct lws *wsi, const char *ads,
|
|||
*/
|
||||
|
||||
lwsi_set_state(wsi, LRS_UNCONNECTED);
|
||||
lws_sul_schedule(wsi->a.context, 0, &wsi->sul_connect_timeout,
|
||||
lws_sul_schedule(wsi->a.context, wsi->tsi, &wsi->sul_connect_timeout,
|
||||
lws_client_dns_retry_timeout,
|
||||
LWS_USEC_PER_SEC);
|
||||
return wsi;
|
||||
|
@ -601,7 +601,7 @@ ads_known:
|
|||
* uses wsi->sul_connect_timeout just for this purpose
|
||||
*/
|
||||
|
||||
lws_sul_schedule(wsi->a.context, 0, &wsi->sul_connect_timeout,
|
||||
lws_sul_schedule(wsi->a.context, wsi->tsi, &wsi->sul_connect_timeout,
|
||||
lws_client_conn_wait_timeout,
|
||||
wsi->a.context->timeout_secs *
|
||||
LWS_USEC_PER_SEC);
|
||||
|
@ -728,6 +728,7 @@ try_next_dns_result:
|
|||
lws_inform_client_conn_fail(wsi, (void *)cce, strlen(cce));
|
||||
|
||||
failed1:
|
||||
lws_sul_cancel(&wsi->sul_connect_timeout);
|
||||
lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, "client_connect3");
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -279,7 +279,7 @@ send_hs:
|
|||
pfd.revents = LWS_POLLOUT;
|
||||
|
||||
lwsl_wsi_info(wsi, "going to service fd");
|
||||
n = lws_service_fd(wsi->a.context, &pfd);
|
||||
n = lws_service_fd_tsi(wsi->a.context, &pfd, wsi->tsi);
|
||||
if (n < 0) {
|
||||
cce = "first service failed";
|
||||
goto failed;
|
||||
|
@ -318,7 +318,7 @@ provoke_service:
|
|||
pfd.events = LWS_POLLIN;
|
||||
pfd.revents = LWS_POLLIN;
|
||||
|
||||
n = lws_service_fd(wsi->a.context, &pfd);
|
||||
n = lws_service_fd_tsi(wsi->a.context, &pfd, wsi->tsi);
|
||||
if (n < 0) {
|
||||
cce = "first service failed";
|
||||
goto failed;
|
||||
|
|
Loading…
Add table
Reference in a new issue