summaryrefslogtreecommitdiff
path: root/src/sub.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-09-16 10:56:55 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-09-16 10:56:55 +0200
commit6e03cb2f3eb083e1de8e7161d3ab21b52c87eece (patch)
tree9cf442583cae614f2bcfca22fd0b9a55c7f0ccda /src/sub.cpp
parentbce2e60bbb3b7f799a532d9b8f2e171c570b9fea (diff)
parent9fbdcc7940823634d82f51d2b124ccfbca6e9b17 (diff)
Merge branch 'master' of git@github.com:sustrik/zeromq2
Diffstat (limited to 'src/sub.cpp')
-rw-r--r--src/sub.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sub.cpp b/src/sub.cpp
index 51e0c23..101c62f 100644
--- a/src/sub.cpp
+++ b/src/sub.cpp
@@ -101,6 +101,12 @@ int zmq::sub_t::recv (struct zmq_msg_t *msg_, int flags_)
if (rc != 0 && errno == EAGAIN)
return -1;
+ // If there is no subscription return -1/EAGAIN.
+ if (!all_count && prefixes.empty () && topics.empty ()) {
+ errno = EAGAIN;
+ return -1;
+ }
+
// If there is at least one "*" subscription, the message matches.
if (all_count)
return 0;