From 27e83cc5258e191a7d5977e202046447df7896b9 Mon Sep 17 00:00:00 2001 From: Mikko Koppanen Date: Wed, 15 Dec 2010 20:10:27 +0100 Subject: Fixes assertion on pipe.cpp:237 when swap fills up. Fixes swap::full () functionality Signed-off-by: Mikko Koppanen --- src/lb.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/lb.cpp') diff --git a/src/lb.cpp b/src/lb.cpp index a784013..5e29ef4 100644 --- a/src/lb.cpp +++ b/src/lb.cpp @@ -128,8 +128,15 @@ bool zmq::lb_t::has_out () return true; while (active > 0) { - if (pipes [current]->check_write ()) + + // Check whether zero-sized message can be written to the pipe. + zmq_msg_t msg; + zmq_msg_init (&msg); + if (pipes [current]->check_write (&msg)) { + zmq_msg_close (&msg); return true; + } + zmq_msg_close (&msg); // Deactivate the pipe. active--; -- cgit v1.2.3