0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 07:31:03 +08:00

Problem: metadata is stored for PUB sockets and never processed

Solution: do not store user messages when the socket type is PUB, they
will never be processed
This commit is contained in:
Luca Boccassi 2020-05-25 15:48:05 +01:00
parent 821ab88f96
commit cf9ccbbd37

View File

@ -131,8 +131,10 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
_process_subscribe =
!_only_first_subscribe || is_subscribe_or_cancel;
if (!is_subscribe_or_cancel) {
// Process user message coming upstream from xsub socket
if (!is_subscribe_or_cancel && options.type != ZMQ_PUB) {
// Process user message coming upstream from xsub socket,
// but not if the type is PUB, which never processes user
// messages
_pending_data.push_back (blob_t (msg_data, msg.size ()));
if (metadata)
metadata->add_ref ();