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

sspc: ss timeout check is onward still alive before setting

This commit is contained in:
Andy Green 2020-08-12 19:25:34 +01:00
parent ee404d7449
commit d51e44388c

View file

@ -721,18 +721,28 @@ payload_ff:
if (--par->rem)
goto hangup;
if ((unsigned int)par->temp32 == 0xffffffff) {
lwsl_notice("%s: cancel ss timeout\n", __func__);
lws_ss_cancel_timeout(*pss);
} else {
/*
* *pss may have gone away asynchronously inbetweentimes
*/
if (!par->temp32)
par->temp32 = (*pss)->policy->timeout_ms;
if (*pss) {
lwsl_notice("%s: set ss timeout for +%ums\n",
if ((unsigned int)par->temp32 == 0xffffffff) {
lwsl_notice("%s: cancel ss timeout\n",
__func__);
lws_ss_cancel_timeout(*pss);
} else {
if (!par->temp32)
par->temp32 =
(*pss)->policy->timeout_ms;
lwsl_notice("%s: set ss timeout for +%ums\n",
__func__, par->temp32);
lws_ss_start_timeout((*pss), par->temp32);
lws_ss_start_timeout((*pss),
par->temp32);
}
}
par->ps = RPAR_TYPE;