Problem: no permission to relicense ZMQ_RECONNECT_IVL_MAX

Solution: remove the implementation. Thijs Terlouw <thijsterlouw@gmail.com>,
the author, did not respond to requests to allow relicensing to MPL2,
so we have to remove his copyrighted work.
Remove the implementation and make get/set return -EOPNOTSUPP.
This commit is contained in:
Luca Boccassi 2023-02-18 14:20:54 +00:00 committed by Luca Boccassi
parent ff47aeb791
commit 7bbd49726b
5 changed files with 23 additions and 62 deletions

View File

@ -619,23 +619,11 @@ Default value:: 100
Applicable socket types:: all, only for connection-oriented transports Applicable socket types:: all, only for connection-oriented transports
ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval ZMQ_RECONNECT_IVL_MAX: DEPRECATED
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_RECONNECT_IVL_MAX' option shall retrieve the maximum reconnection The 'ZMQ_RECONNECT_IVL_MAX option is an empty stub that only returns an
interval for the specified 'socket'. This is the maximum period 0MQ shall wait *EOPNOTSUPP* error, as the author did not provide a relicense agreement for
between attempts to reconnect. On each reconnect attempt, the previous interval the Mozilla Public License v2 relicense of libzmq.
shall be doubled until ZMQ_RECONNECT_IVL_MAX is reached. This allows for
exponential backoff strategy. Default value means no exponential backoff is
performed and reconnect interval calculations are only based on
ZMQ_RECONNECT_IVL.
NOTE: Values less than ZMQ_RECONNECT_IVL will be ignored.
[horizontal]
Option value type:: int
Option value unit:: milliseconds
Default value:: 0 (only use ZMQ_RECONNECT_IVL)
Applicable socket types:: all, only for connection-oriented transport
ZMQ_RECONNECT_STOP: Retrieve condition where reconnection will stop ZMQ_RECONNECT_STOP: Retrieve condition where reconnection will stop
@ -985,8 +973,8 @@ Applicable socket types:: All, when using TCP, IPC, PGM or NORM transport.
ZMQ_TOPICS_COUNT: Number of topic subscriptions received ZMQ_TOPICS_COUNT: Number of topic subscriptions received
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gets the number of topic (prefix) subscriptions either Gets the number of topic (prefix) subscriptions either
* received on a (X)PUB socket from all the connected (X)SUB sockets or * received on a (X)PUB socket from all the connected (X)SUB sockets or
* acknowledged on an (X)SUB socket from all the connected (X)PUB sockets * acknowledged on an (X)SUB socket from all the connected (X)PUB sockets
NOTE: in DRAFT state, not yet available in stable releases. NOTE: in DRAFT state, not yet available in stable releases.

View File

@ -750,22 +750,11 @@ Default value:: 100
Applicable socket types:: all, only for connection-oriented transports Applicable socket types:: all, only for connection-oriented transports
ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval ZMQ_RECONNECT_IVL_MAX: DEPRECATED
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_RECONNECT_IVL_MAX' option shall set the maximum reconnection interval The 'ZMQ_RECONNECT_IVL_MAX option is an empty stub that only returns an
for the specified 'socket'. This is the maximum period 0MQ shall wait between *EOPNOTSUPP* error, as the author did not provide a relicense agreement for
attempts to reconnect. On each reconnect attempt, the previous interval shall be the Mozilla Public License v2 relicense of libzmq.
doubled until ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential
backoff strategy. Default value means no exponential backoff is performed and
reconnect interval calculations are only based on ZMQ_RECONNECT_IVL.
NOTE: Values less than ZMQ_RECONNECT_IVL will be ignored.
[horizontal]
Option value type:: int
Option value unit:: milliseconds
Default value:: 0 (only use ZMQ_RECONNECT_IVL)
Applicable socket types:: all, only for connection-oriented transports
ZMQ_RECONNECT_STOP: Set condition where reconnection will stop ZMQ_RECONNECT_STOP: Set condition where reconnection will stop
@ -784,7 +773,7 @@ connection attempts to non-0MQ sockets. Note that when specifying this option
you may also want to set `ZMQ_HANDSHAKE_IVL` -- the default handshake interval you may also want to set `ZMQ_HANDSHAKE_IVL` -- the default handshake interval
is 30000 (30 seconds), which is typically too large. is 30000 (30 seconds), which is typically too large.
The 'ZMQ_RECONNECT_STOP_AFTER_DISCONNECT' option will stop reconnection when The 'ZMQ_RECONNECT_STOP_AFTER_DISCONNECT' option will stop reconnection when
zmq_disconnect() has been called. This can be useful when the user's request failed zmq_disconnect() has been called. This can be useful when the user's request failed
(server not ready), as the socket does not need to continue to reconnect after (server not ready), as the socket does not need to continue to reconnect after
user disconnect actively. user disconnect actively.

View File

@ -213,7 +213,6 @@ zmq::options_t::options_t () :
tcp_maxrt (0), tcp_maxrt (0),
reconnect_stop (0), reconnect_stop (0),
reconnect_ivl (100), reconnect_ivl (100),
reconnect_ivl_max (0),
backlog (100), backlog (100),
maxmsgsize (-1), maxmsgsize (-1),
rcvtimeo (-1), rcvtimeo (-1),
@ -428,11 +427,11 @@ int zmq::options_t::setsockopt (int option_,
break; break;
case ZMQ_RECONNECT_IVL_MAX: case ZMQ_RECONNECT_IVL_MAX:
if (is_int && value >= 0) { #ifdef ZMQ_HAVE_WINDOWS
reconnect_ivl_max = value; return WSAEOPNOTSUPP;
return 0; #else
} return -EOPNOTSUPP;
break; #endif
case ZMQ_BACKLOG: case ZMQ_BACKLOG:
if (is_int && value >= 0) { if (is_int && value >= 0) {
@ -1076,11 +1075,11 @@ int zmq::options_t::getsockopt (int option_,
break; break;
case ZMQ_RECONNECT_IVL_MAX: case ZMQ_RECONNECT_IVL_MAX:
if (is_int) { #ifdef ZMQ_HAVE_WINDOWS
*value = reconnect_ivl_max; return WSAEOPNOTSUPP;
return 0; #else
} return -EOPNOTSUPP;
break; #endif
case ZMQ_BACKLOG: case ZMQ_BACKLOG:
if (is_int) { if (is_int) {

View File

@ -127,10 +127,6 @@ struct options_t
// Default 100ms // Default 100ms
int reconnect_ivl; int reconnect_ivl;
// Maximum interval between attempts to reconnect, in milliseconds.
// Default 0 (unused)
int reconnect_ivl_max;
// Maximum backlog for pending connections. // Maximum backlog for pending connections.
int backlog; int backlog;

View File

@ -123,17 +123,6 @@ int zmq::stream_connecter_base_t::get_new_reconnect_ivl ()
? _current_reconnect_ivl + random_jitter ? _current_reconnect_ivl + random_jitter
: std::numeric_limits<int>::max (); : std::numeric_limits<int>::max ();
// Only change the new current reconnect interval if the maximum reconnect
// interval was set and if it's larger than the reconnect interval.
if (options.reconnect_ivl_max > 0
&& options.reconnect_ivl_max > options.reconnect_ivl) {
// Calculate the next interval
_current_reconnect_ivl =
_current_reconnect_ivl < std::numeric_limits<int>::max () / 2
? std::min (_current_reconnect_ivl * 2, options.reconnect_ivl_max)
: options.reconnect_ivl_max;
}
return interval; return interval;
} }