Commit 67013f19 authored by Ian Barber's avatar Ian Barber

Merge pull request #664 from hintjens/master

NULL mechanism was not dealing with ZAP denials properly
parents 971b275f 321a8ffe
...@@ -242,24 +242,28 @@ int zmq::null_mechanism_t::receive_and_process_zap_reply () ...@@ -242,24 +242,28 @@ int zmq::null_mechanism_t::receive_and_process_zap_reply ()
// Address delimiter frame // Address delimiter frame
if (msg [0].size () > 0) { if (msg [0].size () > 0) {
rc = -1;
errno = EPROTO; errno = EPROTO;
goto error; goto error;
} }
// Version frame // Version frame
if (msg [1].size () != 3 || memcmp (msg [1].data (), "1.0", 3)) { if (msg [1].size () != 3 || memcmp (msg [1].data (), "1.0", 3)) {
rc = -1;
errno = EPROTO; errno = EPROTO;
goto error; goto error;
} }
// Request id frame // Request id frame
if (msg [2].size () != 1 || memcmp (msg [2].data (), "1", 1)) { if (msg [2].size () != 1 || memcmp (msg [2].data (), "1", 1)) {
rc = -1;
errno = EPROTO; errno = EPROTO;
goto error; goto error;
} }
// Status code frame // Status code frame
if (msg [3].size () != 3 || memcmp (msg [3].data (), "200", 3)) { if (msg [3].size () != 3 || memcmp (msg [3].data (), "200", 3)) {
rc = -1;
errno = EACCES; errno = EACCES;
goto error; goto error;
} }
......
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