Commit 1240d7ac authored by David Jelenc's avatar David Jelenc

Fixes failing tests regarding XPUB sockets.

Fixes tests that were introduced in a previous pull request. See
https://github.com/zeromq/libzmq/pull/1539#issuecomment-132968987
parent 391bc12d
......@@ -244,7 +244,12 @@ int zmq::xpub_t::xrecv (msg_t *msg_)
memcpy (msg_->data (),
pending_data.front ().data (),
pending_data.front ().size ());
msg_->set_metadata (pending_metadata.front ());
// set metadata only if there is some
if (metadata_t* metadata = pending_metadata.front ()) {
msg_->set_metadata (metadata);
}
msg_->set_flags (pending_flags.front ());
pending_data.pop_front ();
pending_metadata.pop_front ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment