mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ss: mqtt: Avoid CONNECTING to DISCONNECTED transition
Check previous states with 'ss_dangling_connected'. If it did not visit CONNECTED, transit to UNREACHABLE instead of DISCONNECTED.
This commit is contained in:
parent
8c26063828
commit
0276f3e635
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue