mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
raw: client: make sure we get CONNECT and opaque_user_data before RX
This commit is contained in:
parent
277d0e5e4c
commit
68de449093
2 changed files with 7 additions and 3 deletions
|
@ -227,7 +227,8 @@ lws_client_connect_via_info(const struct lws_client_connect_info *i)
|
|||
/* all the pointers default to NULL, but no need to zero the args */
|
||||
memset(wsi->stash, 0, sizeof(*wsi->stash));
|
||||
|
||||
wsi->stash->opaque_user_data = i->opaque_user_data;
|
||||
wsi->opaque_user_data = wsi->stash->opaque_user_data =
|
||||
i->opaque_user_data;
|
||||
pc = (char *)&wsi->stash[1];
|
||||
|
||||
for (n = 0; n < CIS_COUNT; n++)
|
||||
|
|
|
@ -67,6 +67,8 @@ rops_handle_POLLIN_raw_skt(struct lws_context_per_thread *pt, struct lws *wsi,
|
|||
if ((pollfd->revents & pollfd->events & LWS_POLLIN) &&
|
||||
/* any tunnel has to have been established... */
|
||||
lwsi_state(wsi) != LRS_SSL_ACK_PENDING &&
|
||||
/* we are actually connected */
|
||||
lwsi_state(wsi) != LRS_WAITING_CONNECT &&
|
||||
!(wsi->favoured_pollin &&
|
||||
(pollfd->revents & pollfd->events & LWS_POLLOUT))) {
|
||||
|
||||
|
@ -137,8 +139,9 @@ try_pollout:
|
|||
return LWS_HPI_RET_HANDLED;
|
||||
|
||||
#if defined(LWS_WITH_CLIENT)
|
||||
if (lwsi_state(wsi) == LRS_WAITING_CONNECT)
|
||||
lws_client_connect_4_established(wsi, NULL, 0);
|
||||
if (lwsi_state(wsi) == LRS_WAITING_CONNECT &&
|
||||
!lws_client_connect_3_connect(wsi, NULL, NULL, 0, NULL))
|
||||
return LWS_HPI_RET_WSI_ALREADY_DIED;
|
||||
#endif
|
||||
|
||||
/* one shot */
|
||||
|
|
Loading…
Add table
Reference in a new issue