diff options
author | malosek <malosek@fastmq.com> | 2009-09-16 14:26:04 +0200 |
---|---|---|
committer | malosek <malosek@fastmq.com> | 2009-09-16 14:26:04 +0200 |
commit | 3534732c0614a764731fbea2431247068fa63330 (patch) | |
tree | 411b0a7b0fea4f9da2bb4318b42ab60f50715474 | |
parent | 17800ac85e667d18124d0e90f9387d6c90887570 (diff) | |
parent | a71d00288008b7ed1dc91b6ad3d5fdf25a5e683e (diff) |
Merge branch 'master' of git@github.com:sustrik/zeromq2
-rw-r--r-- | src/dispatcher.cpp | 4 | ||||
-rw-r--r-- | src/session.cpp | 6 | ||||
-rw-r--r-- | src/zmq_connecter_init.cpp | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/dispatcher.cpp b/src/dispatcher.cpp index 530238d..6ac9fa2 100644 --- a/src/dispatcher.cpp +++ b/src/dispatcher.cpp @@ -100,8 +100,8 @@ zmq::dispatcher_t::~dispatcher_t () delete io_threads [i]; // Deallocate all the orphaned pipes. - for (pipes_t::iterator it = pipes.begin (); it != pipes.end (); it++) - delete *it; + while (!pipes.empty ()) + delete *pipes.begin (); delete [] command_pipes; diff --git a/src/session.cpp b/src/session.cpp index 9593827..d455462 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -55,6 +55,9 @@ bool zmq::session_t::read (::zmq_msg_t *msg_) bool zmq::session_t::write (::zmq_msg_t *msg_) { + if (!out_pipe) + return true; + if (out_pipe->write (msg_)) { zmq_msg_init (msg_); return true; @@ -65,7 +68,8 @@ bool zmq::session_t::write (::zmq_msg_t *msg_) void zmq::session_t::flush () { - out_pipe->flush (); + if (out_pipe) + out_pipe->flush (); } void zmq::session_t::detach () diff --git a/src/zmq_connecter_init.cpp b/src/zmq_connecter_init.cpp index ffd4a64..f0cbf90 100644 --- a/src/zmq_connecter_init.cpp +++ b/src/zmq_connecter_init.cpp @@ -60,9 +60,13 @@ bool zmq::zmq_connecter_init_t::read (::zmq_msg_t *msg_) if (!session_name.empty ()) session = owner->find_session (session_name.c_str ()); if (!session) { - // TODO + + // TODO: + // The socket is already closing. The session is already shut down, + // so no point in continuing with connecting. Shut the connection down. zmq_assert (false); } + send_attach (session, engine); engine = NULL; |