From f745787ce437065289c312c377b68c0e0ed7e8cd Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 12 Mar 2019 14:32:58 -0700 Subject: [PATCH] modules/client/sync: Check if the client is still alive during longpoll. --- modules/client/sync.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/client/sync.cc b/modules/client/sync.cc index ee340f64b..0261805c1 100644 --- a/modules/client/sync.cc +++ b/modules/client/sync.cc @@ -558,6 +558,9 @@ try if(!dock.wait_until(args.timesout)) break; + assert(data.client && data.client->sock); + check(*data.client->sock); + if(queue.empty()) continue; @@ -582,6 +585,17 @@ try 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) { log::error