diff options
author | Othmar Gsenger <otti@anytun.org> | 2007-12-11 14:21:43 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2007-12-11 14:21:43 +0000 |
commit | 8d50a2d28c4664c24a4095e8964883407aac8bf9 (patch) | |
tree | 1b2f5a325dba48a0c21b92a0ef6f362b1d3d328c /syncSocket.cpp | |
parent | connectionParam copy constructor (diff) |
fixed sync crash, when no active connections
Diffstat (limited to 'syncSocket.cpp')
-rw-r--r-- | syncSocket.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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() |