Commit c5078ea1 authored by Ian Barber's avatar Ian Barber

Merge pull request #580 from hurtonm/master

Stop ZMTP handshake when an unexpected message comes
parents 92b02b98 20a7978d
...@@ -88,8 +88,9 @@ int zmq::curve_client_t::process_handshake_message (msg_t *msg_) ...@@ -88,8 +88,9 @@ int zmq::curve_client_t::process_handshake_message (msg_t *msg_)
state = connected; state = connected;
break; break;
default: default:
errno = EAGAIN; errno = EPROTO;
rc = -1; rc = -1;
break;
} }
if (rc == 0) { if (rc == 0) {
rc = msg_->close (); rc = msg_->close ();
......
...@@ -98,7 +98,7 @@ int zmq::curve_server_t::process_handshake_message (msg_t *msg_) ...@@ -98,7 +98,7 @@ int zmq::curve_server_t::process_handshake_message (msg_t *msg_)
} }
break; break;
default: default:
errno = EAGAIN; errno = EPROTO;
rc = -1; rc = -1;
break; break;
} }
......
...@@ -109,8 +109,9 @@ int zmq::plain_mechanism_t::process_handshake_message (msg_t *msg_) ...@@ -109,8 +109,9 @@ int zmq::plain_mechanism_t::process_handshake_message (msg_t *msg_)
state = ready; state = ready;
break; break;
default: default:
errno = EAGAIN; errno = EPROTO;
rc = -1; rc = -1;
break;
} }
if (rc == 0) { if (rc == 0) {
rc = msg_->close (); rc = msg_->close ();
......
...@@ -599,8 +599,6 @@ int zmq::stream_engine_t::next_handshake_message (msg_t *msg_) ...@@ -599,8 +599,6 @@ int zmq::stream_engine_t::next_handshake_message (msg_t *msg_)
if (rc == 0) { if (rc == 0) {
if (mechanism->is_handshake_complete ()) if (mechanism->is_handshake_complete ())
mechanism_ready (); mechanism_ready ();
if (input_paused)
activate_in ();
} }
return rc; return rc;
......
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