0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-31 01:43:02 +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;
break;
default:
errno = EAGAIN;
errno = EPROTO;
rc = -1;
break;
}
if (rc == 0) {
rc = msg_->close ();

View File

@ -98,7 +98,7 @@ int zmq::curve_server_t::process_handshake_message (msg_t *msg_)
}
break;
default:
errno = EAGAIN;
errno = EPROTO;
rc = -1;
break;
}

View File

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

View File

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