Reset metadata for outbound messages

This commit is contained in:
Martin Hurton
2014-08-13 08:51:13 +02:00
parent 25de6a03ac
commit a54d8d7b0c
3 changed files with 12 additions and 0 deletions

View File

@@ -288,6 +288,15 @@ void zmq::msg_t::set_metadata (zmq::metadata_t *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
{
return (u.base.flags & identity) == identity;