summaryrefslogtreecommitdiff
path: root/src/pipe.cpp
diff options
context:
space:
mode:
authorMikko Koppanen <mkoppanen@php.net>2010-12-15 20:10:27 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-12-15 20:10:27 +0100
commit27e83cc5258e191a7d5977e202046447df7896b9 (patch)
tree57572817c9a7e135624f29cae7cbadcce490be88 /src/pipe.cpp
parenta46980babe076d34347629a54e9635466e6e2a9f (diff)
Fixes assertion on pipe.cpp:237 when swap fills up.
Fixes swap::full () functionality Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r--src/pipe.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index a60e519..bbdd44e 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -200,15 +200,15 @@ void zmq::writer_t::set_event_sink (i_writer_events *sink_)
sink = sink_;
}
-bool zmq::writer_t::check_write ()
+bool zmq::writer_t::check_write (zmq_msg_t *msg_)
{
// We've already checked and there's no space free for the new message.
// There's no point in checking once again.
if (unlikely (!active))
return false;
-
+
if (unlikely (swapping)) {
- if (unlikely (swap->full ())) {
+ if (unlikely (!swap->fits (msg_))) {
active = false;
return false;
}
@@ -229,7 +229,7 @@ bool zmq::writer_t::check_write ()
bool zmq::writer_t::write (zmq_msg_t *msg_)
{
- if (unlikely (!check_write ()))
+ if (unlikely (!check_write (msg_)))
return false;
if (unlikely (swapping)) {