mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-23 16:43:49 +08:00
Fix: use websockets without OpenSSL / TLS.
Signed-off-by: Tifaifai Maupiti <tifaifai.maupiti@gmail.com>
This commit is contained in:
committed by
Roger Light
parent
8676cc0359
commit
f2376551bc
@@ -183,12 +183,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;
|
||||
@@ -222,7 +224,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;
|
||||
|
||||
Reference in New Issue
Block a user