mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-26 18:42:43 +01:00
Added test_metadata
- also prioritize ZAP metadata over ZMTP metadata in case application uses same names.
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <string.h>
|
||||
#include <new>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
||||
#include "stream_engine.hpp"
|
||||
#include "io_thread.hpp"
|
||||
@@ -741,14 +742,6 @@ void zmq::stream_engine_t::mechanism_ready ()
|
||||
properties_t properties;
|
||||
properties_t::const_iterator it;
|
||||
|
||||
// Add ZAP properties.
|
||||
const properties_t& zap_properties = mechanism->get_zap_properties ();
|
||||
it = zap_properties.begin ();
|
||||
while (it != zap_properties.end ()) {
|
||||
properties.insert (properties_t::value_type (it->first, it->second));
|
||||
it++;
|
||||
}
|
||||
|
||||
// Add ZMTP properties.
|
||||
const properties_t& zmtp_properties = mechanism->get_zmtp_properties ();
|
||||
it = zmtp_properties.begin ();
|
||||
@@ -757,6 +750,14 @@ void zmq::stream_engine_t::mechanism_ready ()
|
||||
it++;
|
||||
}
|
||||
|
||||
// Add ZAP properties.
|
||||
const properties_t& zap_properties = mechanism->get_zap_properties ();
|
||||
it = zap_properties.begin ();
|
||||
while (it != zap_properties.end ()) {
|
||||
properties.insert (properties_t::value_type (it->first, it->second));
|
||||
it++;
|
||||
}
|
||||
|
||||
zmq_assert (metadata == NULL);
|
||||
if (!properties.empty ())
|
||||
metadata = new (std::nothrow) metadata_t (properties);
|
||||
|
||||
Reference in New Issue
Block a user