diff --git a/lib/secure-streams/protocols/ss-mqtt.c b/lib/secure-streams/protocols/ss-mqtt.c index 7833751e1..a5319028a 100644 --- a/lib/secure-streams/protocols/ss-mqtt.c +++ b/lib/secure-streams/protocols/ss-mqtt.c @@ -69,7 +69,11 @@ secstream_mqtt(struct lws *wsi, enum lws_callback_reasons reason, void *user, lws_sul_cancel(&h->sul_timeout); lws_conmon_ss_json(h); - r= lws_ss_event_helper(h, LWSSSCS_DISCONNECTED); + + if (h->ss_dangling_connected) + r = lws_ss_event_helper(h, LWSSSCS_DISCONNECTED); + else + r = lws_ss_event_helper(h, LWSSSCS_UNREACHABLE); if (h->wsi) lws_set_opaque_user_data(h->wsi, NULL); h->wsi = NULL;