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

Some explicit endpoint type changes to support GCC 5 (#3468)

* Some explicit endpoint type changes to support GCC 5

* ../RELICENSE/SergheiNovac.md
This commit is contained in:
Serhio 2019-04-05 12:54:26 +03:00 committed by Luca Boccassi
parent 6c613902da
commit db7bdd1b1a
4 changed files with 37 additions and 18 deletions

15
RELICENSE/SergheiNovac.md Normal file
View File

@ -0,0 +1,15 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Serghei Novac
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "carbofos", with
commit author "Serghei Novac <serghei.novac@epydoc.com>", are copyright of Serghei Novac.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Serghei Novac
2019/03/05

View File

@ -683,14 +683,15 @@ int zmq::socket_base_t::bind (const char *endpoint_uri_)
int rc = listener->set_local_address (address.c_str ());
if (rc != 0) {
LIBZMQ_DELETE (listener);
event_bind_failed (address, zmq_errno ());
event_bind_failed (make_unconnected_bind_endpoint_pair (address),
zmq_errno ());
return -1;
}
listener->get_local_address (_last_endpoint);
add_endpoint (_last_endpoint.c_str (), static_cast<own_t *> (listener),
NULL);
add_endpoint (make_unconnected_bind_endpoint_pair (_last_endpoint),
static_cast<own_t *> (listener), NULL);
options.connected = true;
return 0;
}

View File

@ -136,8 +136,8 @@ void zmq::vmci_connecter_t::out_event ()
}
// Create the engine object for this connection.
stream_engine_t *engine =
new (std::nothrow) stream_engine_t (fd, options, endpoint);
stream_engine_t *engine = new (std::nothrow) stream_engine_t (
fd, options, make_unconnected_bind_endpoint_pair (endpoint));
alloc_assert (engine);
// Attach the engine to the corresponding session object.
@ -146,7 +146,8 @@ void zmq::vmci_connecter_t::out_event ()
// Shut the connecter down.
terminate ();
socket->event_connected (endpoint, fd);
socket->event_connected (make_unconnected_bind_endpoint_pair (endpoint),
fd);
}
void zmq::vmci_connecter_t::timer_event (int id_)
@ -181,7 +182,8 @@ void zmq::vmci_connecter_t::add_reconnect_timer ()
if (options.reconnect_ivl != -1) {
int rc_ivl = get_new_reconnect_ivl ();
add_timer (rc_ivl, reconnect_timer_id);
socket->event_connect_retried (endpoint, rc_ivl);
socket->event_connect_retried (
make_unconnected_bind_endpoint_pair (endpoint), rc_ivl);
timer_started = true;
}
}
@ -247,7 +249,7 @@ void zmq::vmci_connecter_t::close ()
const int rc = ::close (s);
errno_assert (rc == 0);
#endif
socket->event_closed (endpoint, s);
socket->event_closed (make_unconnected_bind_endpoint_pair (endpoint), s);
s = retired_fd;
}

View File

@ -87,7 +87,8 @@ void zmq::vmci_listener_t::in_event ()
// If connection was reset by the peer in the meantime, just ignore it.
if (fd == retired_fd) {
socket->event_accept_failed (endpoint, zmq_errno ());
socket->event_accept_failed (
make_unconnected_bind_endpoint_pair (endpoint), zmq_errno ());
return;
}
@ -106,8 +107,8 @@ void zmq::vmci_listener_t::in_event ()
}
// Create the engine object for this connection.
stream_engine_t *engine =
new (std::nothrow) stream_engine_t (fd, options, endpoint);
stream_engine_t *engine = new (std::nothrow) stream_engine_t (
fd, options, make_unconnected_bind_endpoint_pair (endpoint));
alloc_assert (engine);
// Choose I/O thread to run connecter in. Given that we are already
@ -122,7 +123,7 @@ void zmq::vmci_listener_t::in_event ()
session->inc_seqnum ();
launch_child (session);
send_attach (session, engine, false);
socket->event_accepted (endpoint, fd);
socket->event_accepted (make_unconnected_bind_endpoint_pair (endpoint), fd);
}
int zmq::vmci_listener_t::get_local_address (std::string &addr_)
@ -198,7 +199,7 @@ int zmq::vmci_listener_t::set_local_address (const char *addr_)
goto error;
#endif
socket->event_listening (endpoint, s);
socket->event_listening (make_unconnected_bind_endpoint_pair (endpoint), s);
return 0;
error:
@ -218,7 +219,7 @@ void zmq::vmci_listener_t::close ()
int rc = ::close (s);
errno_assert (rc == 0);
#endif
socket->event_closed (endpoint, s);
socket->event_closed (make_unconnected_bind_endpoint_pair (endpoint), s);
s = retired_fd;
}