1 From 4822aa97da80a86033ec6e4a8b2f4ad0911235cf Mon Sep 17 00:00:00 2001
2 From: Peter Korsgaard <peter@korsgaard.com>
3 Date: Sat, 3 Mar 2018 11:04:47 +0100
4 Subject: [PATCH] websockets.c: unbreak build without TLS
6 Commit 7943072b1f3b (Fix use_identity_as_username not working on websockets
7 clients) added code which unconditionally accesses mosq-ssl, breaking the
8 build when TLS support is disabled.
10 Fix it by guarding this logic inside #ifdef WITH_TLS.
12 [Upstream: https://dev.eclipse.org/mhonarc/lists/mosquitto-dev/msg01813.html]
13 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
15 src/websockets.c | 4 ++++
16 1 file changed, 4 insertions(+)
18 diff --git a/src/websockets.c b/src/websockets.c
19 index d4d7961..a796f0a 100644
20 --- a/src/websockets.c
21 +++ b/src/websockets.c
22 @@ -201,12 +201,14 @@ static int callback_mqtt(struct libwebsocket_context *context,
23 mosq->ws_context = context;
28 mosq->ssl = (SSL *)in;
29 if(!mosq->listener->ssl_ctx){
30 mosq->listener->ssl_ctx = SSL_get_SSL_CTX(mosq->ssl);
37 @@ -240,7 +242,9 @@ static int callback_mqtt(struct libwebsocket_context *context,
38 mosq->pollfd_index = -1;
44 do_disconnect(db, mosq);