1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

win: deal with FD_CONNECT better

POSIX connect() specifies it will signal POLLOUT available when
the connect result is available.  But windows has some non-posix
nonsense.

Improve the plat support to simulate the missing POLLOUT.
This commit is contained in:
Andy Green 2020-05-11 14:05:36 +01:00
parent 36ec353dac
commit 71f6f9a1f9
2 changed files with 4 additions and 1 deletions

View file

@ -54,6 +54,7 @@ _lws_plat_service_forced_tsi(struct lws_context *context, int tsi)
return r;
}
extern void lws_client_conn_wait_timeout(lws_sorted_usec_list_t *sul);
int
_lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)

View file

@ -346,7 +346,7 @@ failed:
return NULL;
}
static void
void
lws_client_conn_wait_timeout(lws_sorted_usec_list_t *sul)
{
struct lws *wsi = lws_container_of(sul, struct lws, sul_connect_timeout);
@ -745,8 +745,10 @@ ads_known:
* must do specifically a POLLOUT poll to hear
* about the connect completion
*/
#if !defined(WIN32)
if (lws_change_pollfd(wsi, 0, LWS_POLLOUT))
goto try_next_result_fds;
#endif
return wsi;
}