0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-17 04:50:57 +08:00

Stop ZMTP handshake when an unexpected message comes

This commit is contained in:
Martin Hurton 2013-06-22 08:11:55 +02:00
parent 92b02b98cd
commit 20a7978d67
4 changed files with 5 additions and 5 deletions

View File

@ -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 ();

View File

@ -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;
} }

View File

@ -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 ();

View File

@ -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;