mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 23:40:57 +01:00
modules/client/sync: Check if the client is still alive during longpoll.
This commit is contained in:
parent
38f7d61020
commit
f745787ce4
1 changed files with 14 additions and 0 deletions
|
@ -558,6 +558,9 @@ try
|
||||||
if(!dock.wait_until(args.timesout))
|
if(!dock.wait_until(args.timesout))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
assert(data.client && data.client->sock);
|
||||||
|
check(*data.client->sock);
|
||||||
|
|
||||||
if(queue.empty())
|
if(queue.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -582,6 +585,17 @@ try
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
catch(const std::system_error &e)
|
||||||
|
{
|
||||||
|
log::derror
|
||||||
|
{
|
||||||
|
log, "longpoll %s failed :%s",
|
||||||
|
loghead(data),
|
||||||
|
e.what()
|
||||||
|
};
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
catch(const std::exception &e)
|
catch(const std::exception &e)
|
||||||
{
|
{
|
||||||
log::error
|
log::error
|
||||||
|
|
Loading…
Reference in a new issue