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_)
state = connected;
break;
default:
errno = EAGAIN;
errno = EPROTO;
rc = -1;
break;
}
if (rc == 0) {
rc = msg_->close ();
......
......@@ -98,7 +98,7 @@ int zmq::curve_server_t::process_handshake_message (msg_t *msg_)
}
break;
default:
errno = EAGAIN;
errno = EPROTO;
rc = -1;
break;
}
......
......@@ -109,8 +109,9 @@ int zmq::plain_mechanism_t::process_handshake_message (msg_t *msg_)
state = ready;
break;
default:
errno = EAGAIN;
errno = EPROTO;
rc = -1;
break;
}
if (rc == 0) {
rc = msg_->close ();
......
......@@ -599,8 +599,6 @@ int zmq::stream_engine_t::next_handshake_message (msg_t *msg_)
if (rc == 0) {
if (mechanism->is_handshake_complete ())
mechanism_ready ();
if (input_paused)
activate_in ();
}
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