From 8d50a2d28c4664c24a4095e8964883407aac8bf9 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Tue, 11 Dec 2007 14:21:43 +0000 Subject: fixed sync crash, when no active connections --- syncSocket.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'syncSocket.cpp') diff --git a/syncSocket.cpp b/syncSocket.cpp index 99f2afb..677deb5 100644 --- a/syncSocket.cpp +++ b/syncSocket.cpp @@ -41,11 +41,14 @@ void SyncSocket::OnAccept() Send( Utility::GetLocalAddress() + "\n"); Send("Number of sockets in list : " + Utility::l2string(Handler().GetCount()) + "\n"); Send("\n"); - std::ostringstream sout; - boost::archive::text_oarchive oa(sout); - const ConnectionParam conn = cl_.getConnection(); - oa << conn; - Send(sout.str()+"\n"); + if( ! cl_.empty()) + { + std::ostringstream sout; + boost::archive::text_oarchive oa(sout); + const ConnectionParam conn = cl_.getConnection(); + oa << conn; + Send(sout.str()+"\n"); + } } //void StatusSocket::InitSSLServer() -- cgit v1.2.3