diff --git a/include/zmq.h b/include/zmq.h index 5884231d..2cde8230 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -622,8 +622,7 @@ ZMQ_EXPORT int zmq_msg_set_group(zmq_msg_t *msg, const char *group); ZMQ_EXPORT const char *zmq_msg_group(zmq_msg_t *msg); /* DRAFT Msg property names. */ -// TODO the name of the define AND its value are now inconsistent with the new term "routing id" -#define ZMQ_MSG_PROPERTY_IDENTITY "Identity" +#define ZMQ_MSG_PROPERTY_ROUTING_ID "Routing-Id" #define ZMQ_MSG_PROPERTY_SOCKET_TYPE "Socket-Type" #define ZMQ_MSG_PROPERTY_USER_ID "User-Id" #define ZMQ_MSG_PROPERTY_PEER_ADDRESS "Peer-Address" diff --git a/src/mechanism.cpp b/src/mechanism.cpp index f8f1cbb2..101161b3 100644 --- a/src/mechanism.cpp +++ b/src/mechanism.cpp @@ -132,11 +132,11 @@ size_t zmq::mechanism_t::add_basic_properties (unsigned char *buf, ZMQ_MSG_PROPERTY_SOCKET_TYPE, socket_type, strlen (socket_type)); - // Add identity property + // Add routing id property if (options.type == ZMQ_REQ || options.type == ZMQ_DEALER || options.type == ZMQ_ROUTER) ptr += add_property (ptr, buf_capacity - (ptr - buf), - ZMQ_MSG_PROPERTY_IDENTITY, options.routing_id, + ZMQ_MSG_PROPERTY_ROUTING_ID, options.routing_id, options.routing_id_size); return ptr - buf; @@ -148,7 +148,7 @@ size_t zmq::mechanism_t::basic_properties_len() const return property_len (ZMQ_MSG_PROPERTY_SOCKET_TYPE, strlen (socket_type)) + ((options.type == ZMQ_REQ || options.type == ZMQ_DEALER || options.type == ZMQ_ROUTER) - ? property_len (ZMQ_MSG_PROPERTY_IDENTITY, + ? property_len (ZMQ_MSG_PROPERTY_ROUTING_ID, options.routing_id_size) : 0); } @@ -199,7 +199,7 @@ int zmq::mechanism_t::parse_metadata (const unsigned char *ptr_, ptr_ += value_length; bytes_left -= value_length; - if (name == ZMQ_MSG_PROPERTY_IDENTITY && options.recv_routing_id) + if (name == ZMQ_MSG_PROPERTY_ROUTING_ID && options.recv_routing_id) set_peer_routing_id (value, value_length); else if (name == ZMQ_MSG_PROPERTY_SOCKET_TYPE) { diff --git a/src/metadata.cpp b/src/metadata.cpp index 0b29cba3..e2a8a11d 100644 --- a/src/metadata.cpp +++ b/src/metadata.cpp @@ -39,8 +39,14 @@ zmq::metadata_t::metadata_t (const dict_t &dict) : const char *zmq::metadata_t::get (const std::string &property) const { dict_t::const_iterator it = dict.find (property); - if (it == dict.end ()) + if (it == dict.end()) + { + /** \todo remove this when support for the deprecated name "Identity" is dropped */ + if (property == "Identity") + return get (ZMQ_MSG_PROPERTY_ROUTING_ID); + return NULL; + } else return it->second.c_str (); }