Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Fix a low probability bug in ::send()
Browse files Browse the repository at this point in the history
A ::send() marked unblocking, where the zmq[_send,_sendmsg,_ms_send]
  of the first (or only) part returned EINTR was expected to
  return FALSE (== would-block) to the caller, but instead would
  have sent the entire message. The comments indicate that this
  could lead to the send blocking.

This would not be visible in our code, apart from a failure to update
  statistics about blocked sends. These statistics are used to infer
  which parts of the processing pipeline is slow, and are not critical.

The bug was found by code inspection and no testcase has been written.
  • Loading branch information
daveab committed Sep 14, 2015
1 parent 18fa47f commit 8435d6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zmqpp/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ bool socket::send(message& message, bool const dont_block /* = false */)

if(EINTR == zmq_errno())
{
if (0 == message.parts())
if (0 == i) // If first part of the message.
{
return false;
}
Expand Down

0 comments on commit 8435d6c

Please sign in to comment.