From: Carl Hetherington Date: Tue, 5 Nov 2013 23:48:54 +0000 (+0000) Subject: Try to fix crash on looking up endpoint of a disconnected socket. X-Git-Tag: v2.0.48~1202^2~2 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=8b6b8d85ae9a008ada08ce5c51c16ad2238239c9;p=dcpomatic.git Try to fix crash on looking up endpoint of a disconnected socket. --- 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 ();