diff --git a/src/curve_client.cpp b/src/curve_client.cpp index c811d3c3..cf293189 100644 --- a/src/curve_client.cpp +++ b/src/curve_client.cpp @@ -399,8 +399,8 @@ int zmq::curve_client_t::process_ready (msg_t *msg_) return -1; } - rc = parse_properties (ready_plaintext + crypto_box_ZEROBYTES, - clen - crypto_box_ZEROBYTES); + rc = parse_metadata (ready_plaintext + crypto_box_ZEROBYTES, + clen - crypto_box_ZEROBYTES); return rc; } diff --git a/src/curve_server.cpp b/src/curve_server.cpp index 16c7d1e4..1fdcca42 100644 --- a/src/curve_server.cpp +++ b/src/curve_server.cpp @@ -441,8 +441,8 @@ int zmq::curve_server_t::process_initiate (msg_t *msg_) } } - return parse_properties (initiate_plaintext + crypto_box_ZEROBYTES + 96, - clen - crypto_box_ZEROBYTES - 96); + return parse_metadata (initiate_plaintext + crypto_box_ZEROBYTES + 96, + clen - crypto_box_ZEROBYTES - 96); } int zmq::curve_server_t::ready_msg (msg_t *msg_) diff --git a/src/mechanism.cpp b/src/mechanism.cpp index bee0a00c..0d4627c2 100644 --- a/src/mechanism.cpp +++ b/src/mechanism.cpp @@ -72,8 +72,8 @@ size_t zmq::mechanism_t::add_property (unsigned char *ptr, const char *name, return 1 + name_len + 4 + value_len; } -int zmq::mechanism_t::parse_properties (const unsigned char *ptr_, - size_t length_) +int zmq::mechanism_t::parse_metadata (const unsigned char *ptr_, + size_t length_) { size_t bytes_left = length_; diff --git a/src/mechanism.hpp b/src/mechanism.hpp index a5d94986..77c7749e 100644 --- a/src/mechanism.hpp +++ b/src/mechanism.hpp @@ -69,14 +69,16 @@ namespace zmq size_t add_property (unsigned char *ptr, const char *name, const void *value, size_t value_len) const; - // Parse a list of properties. Returns 0 on success - // and -1 on error, in which case errno is set. - int parse_properties (const unsigned char *ptr_, size_t length); + // Parses a metadata. + // Metadata consists of a list of properties consisting of + // name and value as size-specified strings. + // Returns 0 on success and -1 on error, in which case errno is set. + int parse_metadata (const unsigned char *ptr_, size_t length); // This is called by parse_property method whenever it // parses a new property. The function should return 0 // on success and -1 on error, in which case it should - // set errno. Signaling error prevetns parser from + // set errno. Signaling error prevents parser from // parsing remaining data. // Derived classes are supposed to override this // method to handle custom processing. diff --git a/src/null_mechanism.cpp b/src/null_mechanism.cpp index ea1c5eca..c95828f8 100644 --- a/src/null_mechanism.cpp +++ b/src/null_mechanism.cpp @@ -99,7 +99,7 @@ int zmq::null_mechanism_t::process_handshake_message (msg_t *msg_) ptr += 8; bytes_left -= 8; - int rc = parse_properties (ptr, bytes_left); + int rc = parse_metadata (ptr, bytes_left); if (rc == 0) { int rc = msg_->close (); errno_assert (rc == 0); diff --git a/src/plain_mechanism.cpp b/src/plain_mechanism.cpp index 0cba5e4c..063325db 100644 --- a/src/plain_mechanism.cpp +++ b/src/plain_mechanism.cpp @@ -285,7 +285,7 @@ int zmq::plain_mechanism_t::process_initiate_command (msg_t *msg_) errno = EPROTO; return -1; } - return parse_properties (ptr + 8, bytes_left - 8); + return parse_metadata (ptr + 8, bytes_left - 8); } int zmq::plain_mechanism_t::ready_command (msg_t *msg_) const @@ -329,7 +329,7 @@ int zmq::plain_mechanism_t::process_ready_command (msg_t *msg_) errno = EPROTO; return -1; } - return parse_properties (ptr + 8, bytes_left - 8); + return parse_metadata (ptr + 8, bytes_left - 8); } void zmq::plain_mechanism_t::send_zap_request (const std::string &username,