Commit 103cbee6 authored by Martin Sustrik's avatar Martin Sustrik

couple of bugs fixed

parent 4914e5c9
lib_LTLIBRARIES = libzmq.la lib_LTLIBRARIES = libzmq.la
pkginclude_HEADERS = \
../include/zmq.h \
../include/zmq.hpp
libzmq_la_SOURCES = \ libzmq_la_SOURCES = \
app_thread.hpp \ app_thread.hpp \
atomic_bitmap.hpp \ atomic_bitmap.hpp \
...@@ -29,7 +33,7 @@ libzmq_la_SOURCES = \ ...@@ -29,7 +33,7 @@ libzmq_la_SOURCES = \
mutex.hpp \ mutex.hpp \
object.hpp \ object.hpp \
options.hpp \ options.hpp \
owner.hpp \ owned.hpp \
pipe.hpp \ pipe.hpp \
platform.hpp \ platform.hpp \
poll.hpp \ poll.hpp \
......
...@@ -81,7 +81,7 @@ int zmq::tcp_socket_t::write (const void *data, int size) ...@@ -81,7 +81,7 @@ int zmq::tcp_socket_t::write (const void *data, int size)
return 0; return 0;
// Signalise peer failure. // Signalise peer failure.
if (nbytes == -1 && errno == ECONNRESET) if (nbytes == -1 && (errno == ECONNRESET || errno == EPIPE))
return -1; return -1;
errno_assert (nbytes != -1); errno_assert (nbytes != -1);
......
...@@ -77,7 +77,6 @@ bool zmq::zmq_connecter_init_t::write (::zmq_msg_t *msg_) ...@@ -77,7 +77,6 @@ bool zmq::zmq_connecter_init_t::write (::zmq_msg_t *msg_)
void zmq::zmq_connecter_init_t::flush () void zmq::zmq_connecter_init_t::flush ()
{ {
// We are not expecting any messages. No point in flushing. // We are not expecting any messages. No point in flushing.
zmq_assert (false);
} }
void zmq::zmq_connecter_init_t::detach () void zmq::zmq_connecter_init_t::detach ()
......
...@@ -97,11 +97,8 @@ void zmq::zmq_engine_t::in_event () ...@@ -97,11 +97,8 @@ void zmq::zmq_engine_t::in_event ()
if (inpos < insize) if (inpos < insize)
reset_pollin (handle); reset_pollin (handle);
// If at least one byte was processed, flush all messages the decoder // Flush all messages the decoder may have produced.
// may have produced. inout->flush ();
if (nbytes > 0)
inout->flush ();
} }
void zmq::zmq_engine_t::out_event () void zmq::zmq_engine_t::out_event ()
......
...@@ -62,7 +62,8 @@ bool zmq::zmq_listener_init_t::write (::zmq_msg_t *msg_) ...@@ -62,7 +62,8 @@ bool zmq::zmq_listener_init_t::write (::zmq_msg_t *msg_)
void zmq::zmq_listener_init_t::flush () void zmq::zmq_listener_init_t::flush ()
{ {
zmq_assert (has_peer_identity); if (!has_peer_identity)
return;
// Initialisation is done. Disconnect the engine from the init object. // Initialisation is done. Disconnect the engine from the init object.
engine->unplug (); engine->unplug ();
......
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