mirror of
https://github.com/zeromq/libzmq.git
synced 2025-02-01 14:55:59 +01:00
Drop subscription messages when reaching the SNDHWM rather than asserting.
This matches the behaviour of zmq_setsockopt(ZMQ_SUBSCRIBE, ...), which also silently drops subscription messages if the SNDHWM is reached. Signed-off-by: Staffan Gimåker <staffan@spotify.com>
This commit is contained in:
parent
b2e2fa622d
commit
e18f9da012
@ -215,7 +215,12 @@ void zmq::xsub_t::send_subscription (unsigned char *data_, size_t size_,
|
||||
|
||||
// Send it to the pipe.
|
||||
bool sent = pipe->write (&msg);
|
||||
zmq_assert (sent);
|
||||
// If we reached the SNDHWM, and thus cannot send the subscription, drop
|
||||
// the subscription message instead. This matches the behaviour of
|
||||
// zmq_setsockopt(ZMQ_SUBSCRIBE, ...), which also drops subscriptions
|
||||
// when the SNDHWM is reached.
|
||||
if (!sent)
|
||||
msg.close ();
|
||||
}
|
||||
|
||||
zmq::xsub_session_t::xsub_session_t (io_thread_t *io_thread_, bool connect_,
|
||||
|
Loading…
x
Reference in New Issue
Block a user