From 812c2016b1475abd60d9a66ee9df4684b380937c Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Tue, 28 Apr 2015 07:40:31 +0200 Subject: [PATCH 1/3] push: Don't delay pipe termination --- src/push.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/push.cpp b/src/push.cpp index 673d2be6..acb852c3 100644 --- a/src/push.cpp +++ b/src/push.cpp @@ -36,6 +36,9 @@ void zmq::push_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { // subscribe_to_all_ is unused (void)subscribe_to_all_; + // Don't delay pipe termination as there is no one + // to receive the delimiter. + pipe_->set_nodelay (); zmq_assert (pipe_); lb.attach (pipe_); From a1d1222dcc74d66541e3fcf7b352f98532a83a4f Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Tue, 28 Apr 2015 07:44:22 +0200 Subject: [PATCH 2/3] pub: Don't delay pipe termination --- src/pub.cpp | 13 +++++++++++++ src/pub.hpp | 1 + 2 files changed, 14 insertions(+) diff --git a/src/pub.cpp b/src/pub.cpp index e84f3c30..e3d60696 100644 --- a/src/pub.cpp +++ b/src/pub.cpp @@ -18,6 +18,8 @@ */ #include "pub.hpp" +#include "pipe.hpp" +#include "err.hpp" #include "msg.hpp" zmq::pub_t::pub_t (class ctx_t *parent_, uint32_t tid_, int sid_) : @@ -30,6 +32,17 @@ zmq::pub_t::~pub_t () { } +void zmq::pub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) +{ + zmq_assert (pipe_); + + // Don't delay pipe termination as there is no one + // to receive the delimiter. + pipe_->set_nodelay (); + + xpub_t::xattach_pipe (pipe_, subscribe_to_all_); +} + int zmq::pub_t::xrecv (class msg_t *) { // Messages cannot be received from PUB socket. diff --git a/src/pub.hpp b/src/pub.hpp index 4fe3a79d..d3dc6c90 100644 --- a/src/pub.hpp +++ b/src/pub.hpp @@ -38,6 +38,7 @@ namespace zmq ~pub_t (); // Implementations of virtual functions from socket_base_t. + void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false); int xrecv (zmq::msg_t *msg_); bool xhas_in (); From 1c139eb42f9eec95702dff1f90575c38bec9beda Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Fri, 1 May 2015 08:44:20 +0200 Subject: [PATCH 3/3] Updated NEWS for #1389 --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 85ac684f..406e1fe6 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ * Fixed #1377, #1144 - failed with WSANOTINITIALISED in some cases. +* Fixed #1389 - PUB, PUSH sockets had slow memory leak. + 0MQ version 4.0.5 stable, released on 2014/10/14 ================================================