mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 15:26:04 +00:00
Merge pull request #1161 from hurtonm/master
Reset metadata for outbound messages
This commit is contained in:
commit
fadb2a38d9
@ -288,6 +288,15 @@ void zmq::msg_t::set_metadata (zmq::metadata_t *metadata_)
|
|||||||
u.base.metadata = metadata_;
|
u.base.metadata = metadata_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void zmq::msg_t::reset_metadata ()
|
||||||
|
{
|
||||||
|
if (u.base.metadata) {
|
||||||
|
if (u.base.metadata->drop_ref ())
|
||||||
|
delete u.base.metadata;
|
||||||
|
u.base.metadata = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool zmq::msg_t::is_identity () const
|
bool zmq::msg_t::is_identity () const
|
||||||
{
|
{
|
||||||
return (u.base.flags & identity) == identity;
|
return (u.base.flags & identity) == identity;
|
||||||
|
@ -73,6 +73,7 @@ namespace zmq
|
|||||||
void set_fd (int64_t fd_);
|
void set_fd (int64_t fd_);
|
||||||
metadata_t *metadata () const;
|
metadata_t *metadata () const;
|
||||||
void set_metadata (metadata_t *metadata_);
|
void set_metadata (metadata_t *metadata_);
|
||||||
|
void reset_metadata ();
|
||||||
bool is_identity () const;
|
bool is_identity () const;
|
||||||
bool is_credential () const;
|
bool is_credential () const;
|
||||||
bool is_delimiter () const;
|
bool is_delimiter () const;
|
||||||
|
@ -799,6 +799,8 @@ int zmq::socket_base_t::send (msg_t *msg_, int flags_)
|
|||||||
if (flags_ & ZMQ_SNDMORE)
|
if (flags_ & ZMQ_SNDMORE)
|
||||||
msg_->set_flags (msg_t::more);
|
msg_->set_flags (msg_t::more);
|
||||||
|
|
||||||
|
msg_->reset_metadata ();
|
||||||
|
|
||||||
// Try to send the message.
|
// Try to send the message.
|
||||||
rc = xsend (msg_);
|
rc = xsend (msg_);
|
||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user