From d8d9d17b21a3ce6cd11456b64c0c843d73d2e75b Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Thu, 19 Feb 2015 21:38:10 +0100 Subject: [PATCH 1/2] Adjust number of sent messages on hiccups Not adjusting the sent message count may lead to situation when SUB socket does not forward its subscriptions. --- src/pipe.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pipe.cpp b/src/pipe.cpp index 9526dd7b..a7560351 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -242,6 +242,8 @@ void zmq::pipe_t::process_hiccup (void *pipe_) outpipe->flush (); msg_t msg; while (outpipe->read (&msg)) { + if (!(msg.flags () & msg_t::more)) + msgs_written--; int rc = msg.close (); errno_assert (rc == 0); } From 1dc65d360afa948f8474fb3c99cf448fc4bbdbd0 Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Fri, 20 Feb 2015 09:13:20 +0100 Subject: [PATCH 2/2] Updated news for #1362 --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index b18ea7af..8430a155 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ * Fixed #1273 - V3 protocol handler vulnerable to downgrade attacks. +* Fixed #1362 - SUB socket sometimes fails to resubscribe properly. + 0MQ version 4.0.5 stable, released on 2014/10/14 ================================================