Commit 5153b636 authored by Martin Sustrik's avatar Martin Sustrik

obsolete 'active' flag removed from session_t

parent 4c6d07d3
...@@ -31,7 +31,6 @@ zmq::session_t::session_t (class io_thread_t *io_thread_, ...@@ -31,7 +31,6 @@ zmq::session_t::session_t (class io_thread_t *io_thread_,
options (options_), options (options_),
in_pipe (NULL), in_pipe (NULL),
incomplete_in (false), incomplete_in (false),
active (true),
out_pipe (NULL), out_pipe (NULL),
engine (NULL), engine (NULL),
socket (socket_), socket (socket_),
...@@ -60,13 +59,11 @@ void zmq::session_t::terminate () ...@@ -60,13 +59,11 @@ void zmq::session_t::terminate ()
bool zmq::session_t::read (::zmq_msg_t *msg_) bool zmq::session_t::read (::zmq_msg_t *msg_)
{ {
if (!in_pipe || !active) if (!in_pipe)
return false; return false;
if (!in_pipe->read (msg_)) { if (!in_pipe->read (msg_))
active = false;
return false; return false;
}
incomplete_in = msg_->flags & ZMQ_MSG_MORE; incomplete_in = msg_->flags & ZMQ_MSG_MORE;
return true; return true;
...@@ -117,7 +114,6 @@ void zmq::session_t::attach_pipes (class reader_t *inpipe_, ...@@ -117,7 +114,6 @@ void zmq::session_t::attach_pipes (class reader_t *inpipe_,
if (inpipe_) { if (inpipe_) {
zmq_assert (!in_pipe); zmq_assert (!in_pipe);
in_pipe = inpipe_; in_pipe = inpipe_;
active = true;
in_pipe->set_event_sink (this); in_pipe->set_event_sink (this);
} }
...@@ -133,7 +129,6 @@ void zmq::session_t::attach_pipes (class reader_t *inpipe_, ...@@ -133,7 +129,6 @@ void zmq::session_t::attach_pipes (class reader_t *inpipe_,
void zmq::session_t::terminated (reader_t *pipe_) void zmq::session_t::terminated (reader_t *pipe_)
{ {
active = false;
in_pipe = NULL; in_pipe = NULL;
finalise (); finalise ();
} }
...@@ -147,7 +142,7 @@ void zmq::session_t::terminated (writer_t *pipe_) ...@@ -147,7 +142,7 @@ void zmq::session_t::terminated (writer_t *pipe_)
void zmq::session_t::activated (reader_t *pipe_) void zmq::session_t::activated (reader_t *pipe_)
{ {
zmq_assert (in_pipe == pipe_); zmq_assert (in_pipe == pipe_);
active = true;
if (engine) if (engine)
engine->activate_out (); engine->activate_out ();
} }
......
...@@ -104,9 +104,6 @@ namespace zmq ...@@ -104,9 +104,6 @@ namespace zmq
// is still in the in pipe. // is still in the in pipe.
bool incomplete_in; bool incomplete_in;
// If true, in_pipe is active. Otherwise there are no messages to get.
bool active;
// Outbound pipe, i.e. one the socket is sending messages to. // Outbound pipe, i.e. one the socket is sending messages to.
class writer_t *out_pipe; class writer_t *out_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