summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNir Soffer <nirsof@gmail.com>2010-10-02 10:01:18 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-10-02 10:01:18 +0200
commit1d431190f50c86f624605ab11c1580b2d2f7ee06 (patch)
tree483d2c0ed2129eb92cf7a315fdc4d53405b96e94
parent2142b8918a0cea79c79c8ed8ce5652148abe4a39 (diff)
make sure that reader does not terminate in the middle of a multipart message
-rw-r--r--AUTHORS1
-rw-r--r--src/xrep.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index 8ad7f5e..70d816a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -30,6 +30,7 @@ Matus Hamorsky <mhamorsky@gmail.com>
Max Wolf <YIDIEPXGXGPN@spammotel.com>
McClain Looney <m@loonsoft.com>
Mikael Helbo Kjaer <mhk@designtech.dk>
+Nir Soffer <nirsof@gmail.com>
Pavel Gushcha <pavimus@gmail.com>
Pavol Malosek <malosek@fastmq.com>
Pieter Hintjens <ph@imatix.com>
diff --git a/src/xrep.cpp b/src/xrep.cpp
index 96f991a..d45b8aa 100644
--- a/src/xrep.cpp
+++ b/src/xrep.cpp
@@ -101,6 +101,13 @@ void zmq::xrep_t::terminated (reader_t *pipe_)
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
it++) {
if (it->reader == pipe_) {
+ if (inpipes [current_in].reader == pipe_) {
+
+ // A reader is not allowed to terminate in the middle of a
+ // multipart message.
+ zmq_assert (!prefetched);
+ zmq_assert (!more_in);
+ }
inpipes.erase (it);
if (terminating)
unregister_term_ack ();