summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xsub.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/xsub.cpp b/src/xsub.cpp
index e9ae87b..add5ba9 100644
--- a/src/xsub.cpp
+++ b/src/xsub.cpp
@@ -218,7 +218,13 @@ void xs::xsub_t::send_subscription (unsigned char *data_, size_t size_,
// Send it to the pipe.
bool sent = pipe->write (&msg);
- xs_assert (sent);
+
+ // If we reached the SNDHWM, and thus cannot send the subscription, drop
+ // the subscription message instead. This matches the behaviour of
+ // xs_setsockopt(XS_SUBSCRIBE, ...), which also drops subscriptions
+ // when the SNDHWM is reached.
+ if (!sent)
+ msg.close ();
}
xs::xsub_session_t::xsub_session_t (io_thread_t *io_thread_, bool connect_,