mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-18 03:29:49 +02:00
Problem: xpub_t.xattach_pipe no handle msg.copy or pipe_t.write fails.
This commit is contained in:
@@ -65,14 +65,15 @@ void zmq::xpub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
|||||||
if (subscribe_to_all_)
|
if (subscribe_to_all_)
|
||||||
subscriptions.add (NULL, 0, pipe_);
|
subscriptions.add (NULL, 0, pipe_);
|
||||||
|
|
||||||
// if welcome message exist
|
// if welcome message exists, send a copy of it
|
||||||
if (welcome_msg.size () > 0)
|
if (welcome_msg.size () > 0)
|
||||||
{
|
{
|
||||||
msg_t copy;
|
msg_t copy;
|
||||||
copy.init ();
|
copy.init ();
|
||||||
copy.copy(welcome_msg);
|
int rc = copy.copy (welcome_msg);
|
||||||
|
errno_assert (rc == 0);
|
||||||
pipe_->write(©);
|
bool ok = pipe_->write (©);
|
||||||
|
zmq_assert (ok);
|
||||||
pipe_->flush ();
|
pipe_->flush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user