summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-05 23:48:54 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-05 23:48:54 +0000
commit8b6b8d85ae9a008ada08ce5c51c16ad2238239c9 (patch)
treed20d48fec7b7346bc4806a0b700375d5b31012c4 /src/lib
parentc254b08184789bc0efb71cd01430ea1800574123 (diff)
Try to fix crash on looking up endpoint of a disconnected socket.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/server.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc
index 5db654064..69ca5b39a 100644
--- a/src/lib/server.cc
+++ b/src/lib/server.cc
@@ -149,17 +149,18 @@ Server::worker_thread ()
lock.unlock ();
int frame = -1;
+ string ip;
struct timeval start;
gettimeofday (&start, 0);
try {
frame = process (socket);
+ ip = socket->socket().remote_endpoint().address().to_string();
} catch (std::exception& e) {
_log->log (String::compose ("Error: %1", e.what()));
}
- string const ip = socket->socket().remote_endpoint().address().to_string();
socket.reset ();
lock.lock ();