Commit 54799c8c authored by Charles Stanley's avatar Charles Stanley Committed by vagrant

fixes #1565: Allow session to flush commands on an engine error

parent e56b4867
...@@ -428,6 +428,9 @@ void zmq::session_base_t::engine_error ( ...@@ -428,6 +428,9 @@ void zmq::session_base_t::engine_error (
if (zap_pipe) if (zap_pipe)
zap_pipe->check_read (); zap_pipe->check_read ();
zmq_assert(socket);
socket->flush_commands();
} }
void zmq::session_base_t::process_term (int linger_) void zmq::session_base_t::process_term (int linger_)
......
...@@ -1417,6 +1417,13 @@ void zmq::socket_base_t::check_destroy () ...@@ -1417,6 +1417,13 @@ void zmq::socket_base_t::check_destroy ()
} }
} }
void zmq::socket_base_t::flush_commands ()
{
ENTER_MUTEX();
process_commands (0, false);
EXIT_MUTEX();
}
void zmq::socket_base_t::read_activated (pipe_t *pipe_) void zmq::socket_base_t::read_activated (pipe_t *pipe_)
{ {
xread_activated (pipe_); xread_activated (pipe_);
......
...@@ -109,6 +109,8 @@ namespace zmq ...@@ -109,6 +109,8 @@ namespace zmq
void out_event (); void out_event ();
void timer_event (int id_); void timer_event (int id_);
void flush_commands();
// i_pipe_events interface implementation. // i_pipe_events interface implementation.
void read_activated (pipe_t *pipe_); void read_activated (pipe_t *pipe_);
void write_activated (pipe_t *pipe_); void write_activated (pipe_t *pipe_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment