[zeromq-dev] EFSM not always raised in 2.1.8

Pieter Hintjens ph at imatix.com
Sat Jul 30 17:31:23 CEST 2011


MinRK,

OK, I've found the problem, I think.

Issue is logged here: https://zeromq.jira.com/browse/LIBZMQ-236

When I backported the changes for issue 231 some error handling on
zmq_send() and zmq_recv() disappeared.

The test case works properly now.

Martin, can you review the attached patch?

MinRK, the patched 2.1 master should now work, would you test that?
I'll make a 2.1.9 release if this proves to be a critical issue.

Cheers
Pieter



diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 10a4122..2167b0b 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -492,6 +492,8 @@ int zmq::socket_base_t::send (::zmq_msg_t *msg_, int flags_)
     rc = xsend (msg_, flags_);
     if (rc == 0)
         return 0;
+    if (unlikely (errno != EAGAIN))
+        return -1;

     //  In case of non-blocking send we'll simply propagate
     //  the error - including EAGAIN - upwards.
@@ -541,6 +543,8 @@ int zmq::socket_base_t::recv (::zmq_msg_t *msg_, int flags_)

     //  Get the message.
     int rc = xrecv (msg_, flags_);
+    if (unlikely (rc != 0 && errno != EAGAIN))
+        return -1;
     int err = errno;

     //  Once every inbound_poll_rate messages check for signals and process



More information about the zeromq-dev mailing list