diff --git a/lib/server-handshake.c b/lib/server-handshake.c index ef7c5cec..a0bddff7 100644 --- a/lib/server-handshake.c +++ b/lib/server-handshake.c @@ -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; diff --git a/lib/server.c b/lib/server.c index 3524d45f..902bf94d 100644 --- a/lib/server.c +++ b/lib/server.c @@ -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 */