Commit 52ed4cdc authored by Martin Hurton's avatar Martin Hurton

Remove dead code

parent 7cfd03ba
...@@ -280,13 +280,7 @@ void zmq::session_base_t::process_plug () ...@@ -280,13 +280,7 @@ void zmq::session_base_t::process_plug ()
void zmq::session_base_t::process_attach (i_engine *engine_) void zmq::session_base_t::process_attach (i_engine *engine_)
{ {
// If some other object (e.g. init) notifies us that the connection failed zmq_assert (engine_ != NULL);
// without creating an engine we need to start the reconnection process.
if (!engine_) {
zmq_assert (!engine);
detached ();
return;
}
// Create the pipe if it does not exist yet. // Create the pipe if it does not exist yet.
if (!pipe && !is_terminating ()) { if (!pipe && !is_terminating ()) {
......
...@@ -52,7 +52,6 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_) : ...@@ -52,7 +52,6 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_) :
outsize (0), outsize (0),
encoder (out_batch_size), encoder (out_batch_size),
session (NULL), session (NULL),
leftover_session (NULL),
options (options_), options (options_),
plugged (false) plugged (false)
{ {
...@@ -109,7 +108,6 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_, ...@@ -109,7 +108,6 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
{ {
zmq_assert (!plugged); zmq_assert (!plugged);
plugged = true; plugged = true;
leftover_session = NULL;
// Connect to session object. // Connect to session object.
zmq_assert (!session); zmq_assert (!session);
...@@ -144,7 +142,6 @@ void zmq::stream_engine_t::unplug () ...@@ -144,7 +142,6 @@ void zmq::stream_engine_t::unplug ()
// Disconnect from session object. // Disconnect from session object.
encoder.set_session (NULL); encoder.set_session (NULL);
decoder.set_session (NULL); decoder.set_session (NULL);
leftover_session = session;
session = NULL; session = NULL;
endpoint.clear(); endpoint.clear();
} }
...@@ -185,12 +182,8 @@ void zmq::stream_engine_t::in_event () ...@@ -185,12 +182,8 @@ void zmq::stream_engine_t::in_event ()
else { else {
// Stop polling for input if we got stuck. // Stop polling for input if we got stuck.
if (processed < insize) { if (processed < insize)
reset_pollin (handle);
// This may happen if queue limits are in effect.
if (plugged)
reset_pollin (handle);
}
// Adjust the buffer. // Adjust the buffer.
inpos += processed; inpos += processed;
...@@ -198,20 +191,14 @@ void zmq::stream_engine_t::in_event () ...@@ -198,20 +191,14 @@ void zmq::stream_engine_t::in_event ()
} }
// Flush all messages the decoder may have produced. // Flush all messages the decoder may have produced.
// If IO handler has unplugged engine, flush transient IO handler. session->flush ();
if (unlikely (!plugged)) {
zmq_assert (leftover_session);
leftover_session->flush ();
} else {
session->flush ();
}
// Input error has occurred. If the last decoded // Input error has occurred. If the last decoded
// message has already been accepted, we terminate // message has already been accepted, we terminate
// the engine immediately. Otherwise, we stop // the engine immediately. Otherwise, we stop
// waiting for input events and postpone the termination // waiting for input events and postpone the termination
// until after the session has accepted the message. // until after the session has accepted the message.
if (session != NULL && disconnection) { if (disconnection) {
input_error = true; input_error = true;
if (decoder.stalled ()) if (decoder.stalled ())
reset_pollin (handle); reset_pollin (handle);
...@@ -228,13 +215,6 @@ void zmq::stream_engine_t::out_event () ...@@ -228,13 +215,6 @@ void zmq::stream_engine_t::out_event ()
outpos = NULL; outpos = NULL;
encoder.get_data (&outpos, &outsize); encoder.get_data (&outpos, &outsize);
// If IO handler has unplugged engine, flush transient IO handler.
if (unlikely (!plugged)) {
zmq_assert (leftover_session);
leftover_session->flush ();
return;
}
// If there is no data to send, stop polling for output. // If there is no data to send, stop polling for output.
if (outsize == 0) { if (outsize == 0) {
reset_pollout (handle); reset_pollout (handle);
......
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