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

defer ESTABLISHED until after mode is WS_SERVING

This commit is contained in:
Andy Green 2016-07-06 17:42:19 +08:00
parent 0aa382f6fb
commit fee9f006f6
2 changed files with 13 additions and 13 deletions

View file

@ -260,19 +260,6 @@ handshake_0405(struct lws_context *context, struct lws *wsi)
wsi->state = LWSS_ESTABLISHED;
wsi->lws_rx_parse_state = LWS_RXPS_NEW;
/* notify user code that we're ready to roll */
if (wsi->protocol->callback)
if (wsi->protocol->callback(wsi, LWS_CALLBACK_ESTABLISHED,
wsi->user_space,
#ifdef LWS_OPENSSL_SUPPORT
wsi->ssl,
#else
NULL,
#endif
0))
goto bail;
return 0;

View file

@ -1279,6 +1279,19 @@ upgrade_ws:
lwsl_parser("accepted v%02d connection\n",
wsi->ietf_spec_revision);
/* notify user code that we're ready to roll */
if (wsi->protocol->callback)
if (wsi->protocol->callback(wsi, LWS_CALLBACK_ESTABLISHED,
wsi->user_space,
#ifdef LWS_OPENSSL_SUPPORT
wsi->ssl,
#else
NULL,
#endif
0))
return 1;
return 0;
} /* while all chars are handled */