mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-26 18:42:43 +01:00
Update CURVE mechanism to the latest ZAP revision
This commit is contained in:
@@ -84,6 +84,9 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_,
|
||||
// Put the socket into non-blocking mode.
|
||||
unblock_socket (s);
|
||||
|
||||
if (!get_peer_ip_address (s, peer_address))
|
||||
peer_address = "";
|
||||
|
||||
#ifdef SO_NOSIGPIPE
|
||||
// Make sure that SIGPIPE signal is not generated when writing to a
|
||||
// connection that was already closed by the peer.
|
||||
@@ -534,7 +537,8 @@ bool zmq::stream_engine_t::handshake ()
|
||||
else
|
||||
if (memcmp (greeting_recv + 12, "CURVE\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) {
|
||||
if (options.as_server)
|
||||
mechanism = new (std::nothrow) curve_server_t (session, options);
|
||||
mechanism = new (std::nothrow)
|
||||
curve_server_t (session, peer_address, options);
|
||||
else
|
||||
mechanism = new (std::nothrow) curve_client_t (options);
|
||||
alloc_assert (mechanism);
|
||||
|
||||
Reference in New Issue
Block a user