Problem: xpub_t.xattach_pipe no handle msg.copy or pipe_t.write fails.

This commit is contained in:
evoskuil 2017-03-30 14:45:40 -07:00
parent 6436bc51e6
commit 1dd9cac24d

View File

@ -65,14 +65,15 @@ void zmq::xpub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
if (subscribe_to_all_)
subscriptions.add (NULL, 0, pipe_);
// if welcome message exist
// if welcome message exists, send a copy of it
if (welcome_msg.size () > 0)
{
msg_t copy;
copy.init ();
copy.copy(welcome_msg);
pipe_->write(&copy);
int rc = copy.copy (welcome_msg);
errno_assert (rc == 0);
bool ok = pipe_->write (&copy);
zmq_assert (ok);
pipe_->flush ();
}