From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] mosquitto: unbreak build with websockets and !libopenssl
Date: Sat, 3 Mar 2018 11:15:45 +0100 [thread overview]
Message-ID: <20180303101545.11446-1-peter@korsgaard.com> (raw)
Fixes:
http://autobuild.buildroot.net/results/d69/d693f3e3f1c73ccf54ac7076623e436355a9d901/b
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
...01-websockets.c-unbreak-build-without-TLS.patch | 49 ++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 package/mosquitto/0001-websockets.c-unbreak-build-without-TLS.patch
diff --git a/package/mosquitto/0001-websockets.c-unbreak-build-without-TLS.patch b/package/mosquitto/0001-websockets.c-unbreak-build-without-TLS.patch
new file mode 100644
index 0000000000..e977fae56c
--- /dev/null
+++ b/package/mosquitto/0001-websockets.c-unbreak-build-without-TLS.patch
@@ -0,0 +1,49 @@
+From 4822aa97da80a86033ec6e4a8b2f4ad0911235cf Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <peter@korsgaard.com>
+Date: Sat, 3 Mar 2018 11:04:47 +0100
+Subject: [PATCH] websockets.c: unbreak build without TLS
+
+Commit 7943072b1f3b (Fix use_identity_as_username not working on websockets
+clients) added code which unconditionally accesses mosq-ssl, breaking the
+build when TLS support is disabled.
+
+Fix it by guarding this logic inside #ifdef WITH_TLS.
+
+[Upstream: https://dev.eclipse.org/mhonarc/lists/mosquitto-dev/msg01813.html]
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ src/websockets.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/websockets.c b/src/websockets.c
+index d4d7961..a796f0a 100644
+--- a/src/websockets.c
++++ b/src/websockets.c
+@@ -201,12 +201,14 @@ static int callback_mqtt(struct libwebsocket_context *context,
+ mosq->ws_context = context;
+ #endif
+ mosq->wsi = wsi;
++#ifdef WITH_TLS
+ if(in){
+ mosq->ssl = (SSL *)in;
+ if(!mosq->listener->ssl_ctx){
+ mosq->listener->ssl_ctx = SSL_get_SSL_CTX(mosq->ssl);
+ }
+ }
++#endif
+ u->mosq = mosq;
+ }else{
+ return -1;
+@@ -240,7 +242,9 @@ static int callback_mqtt(struct libwebsocket_context *context,
+ mosq->pollfd_index = -1;
+ }
+ mosq->wsi = NULL;
++#ifdef WITH_TLS
+ mosq->ssl = NULL;
++#endif
+ do_disconnect(db, mosq);
+ }
+ break;
+--
+2.11.0
+
--
2.11.0
next reply other threads:[~2018-03-03 10:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-03 10:15 Peter Korsgaard [this message]
2018-03-03 16:17 ` [Buildroot] [PATCH] mosquitto: unbreak build with websockets and !libopenssl Peter Korsgaard
2018-03-05 7:58 ` Alexander Dahl
2018-03-05 8:09 ` Peter Korsgaard
2018-03-05 8:42 ` Alexander Dahl
2018-04-10 20:51 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180303101545.11446-1-peter@korsgaard.com \
--to=peter@korsgaard.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.