1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ss: UNREACHABLE: set ordinal in state cb b0 if due to DNS server reachability issue

For LWSSSCS_UNREACHABLE state, the additional ord arg has b0 set if the
reason for the unreachability is because the DNS server itself was not
reachable (implying either DNS server is wrongly set, or is not reachable
due to not having connectivity through to it)
This commit is contained in:
Andy Green 2020-12-22 14:24:14 +00:00
parent 556154c3c9
commit d98c9310e1
2 changed files with 5 additions and 2 deletions

View file

@ -187,7 +187,8 @@ typedef uint32_t lws_ss_tx_ordinal_t;
typedef enum {
LWSSSCS_CREATING,
LWSSSCS_DISCONNECTED,
LWSSSCS_UNREACHABLE,
LWSSSCS_UNREACHABLE, /* oridinal arg = 1 = caused by dns
* server reachability failure */
LWSSSCS_AUTH_FAILED,
LWSSSCS_CONNECTED,
LWSSSCS_CONNECTING,

View file

@ -99,7 +99,9 @@ lws_ss_event_helper(lws_ss_handle_t *h, lws_ss_constate_t cs)
#endif
if (h->info.state) {
r = h->info.state(ss_to_userobj(h), NULL, cs, 0);
r = h->info.state(ss_to_userobj(h), NULL, cs,
cs == LWSSSCS_UNREACHABLE &&
h->wsi && h->wsi->dns_reachability);
#if defined(LWS_WITH_SERVER)
if ((h->info.flags & LWSSSINFLAGS_ACCEPTED) &&
cs == LWSSSCS_DISCONNECTED)