From 8266450ba2ef6cb5953e758e77521d5d497f9c2a Mon Sep 17 00:00:00 2001 From: Alexander Bruines Date: Tue, 8 Dec 2015 23:31:37 +0100 Subject: [PATCH] Access to wsi->ssl at LWS_CALLBACK_ESTABLISHED --- lib/libwebsockets.h | 5 ++++- lib/server-handshake.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 8996668..ca1a5be 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -781,7 +781,10 @@ struct lws_extension; * LWS_CALLBACK_ESTABLISHED reason. * * LWS_CALLBACK_ESTABLISHED: after the server completes a handshake with - * an incoming client + * an incoming client. If you built the library + * with ssl support, @in is a pointer to the + * ssl struct associated with the connection or + * NULL. * * LWS_CALLBACK_CLIENT_CONNECTION_ERROR: the request client connection has * been unable to complete a handshake with the remote server. If diff --git a/lib/server-handshake.c b/lib/server-handshake.c index 56c55c7..9862eff 100644 --- a/lib/server-handshake.c +++ b/lib/server-handshake.c @@ -264,7 +264,13 @@ handshake_0405(struct lws_context *context, struct lws *wsi) if (wsi->protocol->callback) wsi->protocol->callback(wsi->protocol->owning_server, wsi, LWS_CALLBACK_ESTABLISHED, - wsi->user_space, NULL, 0); + wsi->user_space, +#ifdef LWS_OPENSSL_SUPPORT + wsi->ssl, +#else + NULL, +#endif + 0); return 0; -- 2.7.4