Commit 3cb77e42 authored by Simon Giesecke's avatar Simon Giesecke

Use revision_pos constant

parent 758f903d
......@@ -485,6 +485,9 @@ void zmq::stream_engine_t::restart_input ()
}
}
// Position of the revision field in the greeting.
const size_t revision_pos = 10;
bool zmq::stream_engine_t::handshake ()
{
zmq_assert (_handshaking);
......@@ -495,9 +498,6 @@ bool zmq::stream_engine_t::handshake ()
return false;
const bool unversioned = rc != 0;
// Position of the revision field in the greeting.
const size_t revision_pos = 10;
if (!(this
->*select_handshake_fun (unversioned,
_greeting_recv[revision_pos])) ())
......@@ -579,8 +579,8 @@ void zmq::stream_engine_t::receive_greeting_versioned ()
set_pollout (_handle);
// Use ZMTP/2.0 to talk to older peers.
if (_greeting_recv[10] == ZMTP_1_0
|| _greeting_recv[10] == ZMTP_2_0)
if (_greeting_recv[revision_pos] == ZMTP_1_0
|| _greeting_recv[revision_pos] == ZMTP_2_0)
_outpos[_outsize++] = _options.type;
else {
_outpos[_outsize++] = 0; // Minor version number
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment