0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-01 19:05:18 +08:00

7512 Commits

Author SHA1 Message Date
Simon Giesecke
4273ffd266 Partially revert "Problem: monitor events are output as decimal in assertion messages"
This partially reverts commit 19c6aa5c9210144205b3e7f26752ebec8302a2f2.
2019-02-07 10:42:32 -05:00
Luca Boccassi
4bdb05df78
Merge pull request #3400 from sigiesec/fix-issue-3397
Add test for ZMQ_BINDTODEVICE
2019-02-07 14:53:48 +00:00
Simon Giesecke
9cb1fca115 Problem: on a failure to setsockopt SO_BINDTODEVICE, libzmq asserts
Solution: return an error to the user instead
2019-02-07 09:39:02 -05:00
Simon Giesecke
ec4ecb01ff Problem: no test for ZMQ_BINDTODEVICE
Solution: add test case run with cap_net_admin
Fixes #3397
2019-02-07 09:39:02 -05:00
Doron Somech
a3a40a01c9
Merge pull request #3399 from sigiesec/fix-unity-64-bit
Problem: test build fails on 32 bit systems
2019-02-07 14:46:19 +02:00
Simon Giesecke
ac19d5f41c Problem: test build fails on 32 bit systems
Solution: define UNITY_SUPPORT_64 to force 64 bit support
2019-02-07 12:13:11 +01:00
Luca Boccassi
eb42e0442b
Merge pull request #3396 from sigiesec/fix-issue-3394
Fix regression introduced by 68d520e
2019-02-07 11:07:04 +00:00
Simon Giesecke
a763d734f2 Problem: formatting broken
Solution: run clang-format
2019-02-07 11:44:18 +01:00
Simon Giesecke
7cf0d125d3 Problem: failed address resolution on TCP connect is not observable
Solution: added TODO comment for now
2019-02-07 11:07:37 +01:00
Simon Giesecke
e45ede49b5 Problem: regression introduced by 68d520e, changing behaviour of unblocking sockets
Solution: move unblock call to original location
2019-02-07 11:04:05 +01:00
Simon Giesecke
db8c26fce3 Problem: testutil_unity uses undefined names on Windows
Solution: make compilation conditional
2019-02-07 11:04:05 +01:00
Simon Giesecke
8de7e529ec Problem: no test case for tcp name resolution no longer working
Solution: add test case
2019-02-07 11:04:05 +01:00
Simon Giesecke
84dc40dd90 Problem: regression introduced by 68d520e, leading to tcp name resolution no longer working
Solution: restore "local" flag values in call to resolve

Fixes #3394
2019-02-07 11:03:51 +01:00
Luca Boccassi
5ecf8f93e2
Merge pull request #3395 from somdoron/ZeroCond
Problem: invoking the conditional variable for zero time is expensive
2019-02-06 22:08:16 +00:00
Luca Boccassi
792a1e61f3
Merge pull request #3393 from sigiesec/add-v2-monitoring
Add v2 monitoring ipc/tipc tests
2019-02-06 21:34:46 +00:00
somdoron
462dd36d0e Problem: invoking the conditional variable for zero time is expensive
Solution: for zero timeout, unlock and relock immediately instead of timedwait
2019-02-06 21:07:53 +02:00
Simon Giesecke
61e476ec89 Problem: MAX_SOCKET_STRING is too short for ipc wildcard binds
Solution: increase size to 256
2019-02-06 09:09:14 -05:00
Simon Giesecke
b54b55d854 Problem: sun_path in an AF_UNIX address might not be null-terminated
Solution: use addrlen to determine the length
2019-02-06 07:18:28 -05:00
Simon Giesecke
31015fdcfe Problem: ipc_address data member does not conform with naming convention
Solution: rename data member
2019-02-06 07:12:21 -05:00
Simon Giesecke
808028fe02 Problem: use of unnecessary complex stringstream
Solution: use memcpy instead
2019-02-06 07:11:10 -05:00
Simon Giesecke
19c6aa5c92 Problem: monitor events are output as decimal in assertion messages
Solution: output as hex instead
2019-02-06 07:11:10 -05:00
Simon Giesecke
a86592f78c Problem: test_monitor is not run for ipc and tipc
Solution: add test cases
2019-02-06 07:11:10 -05:00
Simon Giesecke
9b1627f041
Merge pull request #3391 from bluca/listener_unistd
Problem: build broken with newer gcc
2019-02-05 14:13:31 -05:00
Luca Boccassi
2df988eec3 Problem: build broken with newer gcc
Solution: add missing includes to stream_listener_base
2019-02-05 18:57:33 +00:00
Luca Boccassi
0b4bb92395
Merge pull request #3389 from sigiesec/fix-issue-3387
Problem: close always fails with wildcard bind, since directory is no…
2019-02-05 16:17:35 +00:00
Simon Giesecke
8d784f26ab Problem: close always fails with wildcard bind, since directory is not empty
Solution: unlink the socket file first
2019-02-05 10:17:28 -05:00
Luca Boccassi
b14bb2d8f8
Merge pull request #3388 from sigiesec/add-missing-include
Problem: missing include directive for close/closesocket
2019-02-05 14:24:16 +00:00
Simon Giesecke
ded4ff6fd2 Problem: missing include directive for close/closesocket
Solution: add appropriate includes
2019-02-05 09:21:06 -05:00
Luca Boccassi
b8b1b8def3
Merge pull request #3384 from sigiesec/remove-socks-tcp-code-duplication
Remove socks/tcp code duplication
2019-02-05 13:19:54 +00:00
Luca Boccassi
69a6522741
Merge pull request #3386 from sigiesec/remove-locale-dependency
Problem: tcp address strings are dependent on locale
2019-02-05 13:18:26 +00:00
Simon Giesecke
74d62bb908 Problem: tcp address strings are dependent on locale
Solution: use sprintf instead of std::stringstream
Fixes #3385
2019-02-05 05:45:35 -05:00
Simon Giesecke
e583276380 Problem: unnecessary platform-specific code parts around socklen_t
Solution: use zmq_socklen_t
2019-02-05 03:34:32 -05:00
Simon Giesecke
c215235fb2 Problem: redundant string operations in zmq::udp_engine_t::sockaddr_to_msg
Solution: reuse string lengths and use memcpy instead
2019-02-05 03:34:32 -05:00
Simon Giesecke
d451a95234 Problem: redundant code in different preprocessor branches
Solution: change preprocessor guard scope
2019-02-05 03:34:32 -05:00
Simon Giesecke
fc6ef0ebff Problem: zmq::get_peer_ip_address duplicates code from get_socket_address
Solution: change to use get_socket_address
2019-02-05 03:34:32 -05:00
Simon Giesecke
2f7a450294 Problem: socks_connecter_t duplicates code around opening and configuring a TCP socket
Solution: use tcp_open_socket function
2019-02-05 03:34:32 -05:00
Simon Giesecke
68d520ef68 Problem: tcp_connecter_t and tcp_listener_t duplicate code around opening and configuring a TCP socket
Solution: extract common parts into tcp_open_socket function
2019-02-05 03:34:32 -05:00
Simon Giesecke
3f4e64edc0 Problem: bind_to_device unnecessarily accepts a non-const string parameter
Solution: add const
2019-02-04 09:29:42 -05:00
Simon Giesecke
12c4b55af8 Problem: socks_connecter_t duplicates code with stream_connecter_base_t
Solution: let socks_connecter_t derive from stream_connecter_base_t and remove duplicate code
2019-02-04 09:29:42 -05:00
Simon Giesecke
14da2ab629
Merge pull request #3382 from bluca/tipc_endpoint
Problem: tipc disconnect does not work anymore
2019-02-03 23:31:59 +01:00
Luca Boccassi
0411bc159a Problem: tipc disconnect does not work anymore
Solution: change back the indentifier endpoint to the one passed by the
user rather than the resolved one, otherwise when the user passes the
same string to the disconnect call they do not match anymore
2019-02-03 23:01:20 +01:00
Simon Giesecke
c28cbf76d1
Merge pull request #3381 from bluca/test_ipv6_monitor
Problems: ipv6 test_monitor hangs, old Windows build fails
2019-02-03 22:57:11 +01:00
Luca Boccassi
a9a5b2bde5 Problem: DRAFT build broken on old Windows
Solution: define uint64_t if not available in the system headers and
remove inclusion of inttypes.h which does not exist and is already
conditionally included in zmq.h if required, do not use PRIx64
2019-02-03 22:11:52 +01:00
Luca Boccassi
84847138a1 Problem: test_monitor fails with ipv6
Solution: correctly set the ipv6 flag in the connecting socket
2019-02-03 20:56:07 +01:00
Luca Boccassi
01b2a8ce21 Problem: unittest_radix_tree binary not ignored
Solution: add it to .gitignore
2019-02-03 19:57:08 +01:00
Luca Boccassi
33a493c4f8
Merge pull request #3379 from sigiesec/add-v2-monitoring
Add v2 monitoring
2019-02-03 08:54:58 +01:00
Simon Giesecke
0e2e303b10 Problem: test_monitor is not run for ipv6
Solution: add test case using ipv6
2019-02-02 19:00:33 +01:00
Simon Giesecke
f22b0b7483 Problem: test_monitor failing for assertion on endpoint addresses on ZMQ_EVENT_LISTENING event
Solution: fix address passed and refactor set_local_address to remove code duplication and unnecessary address parsing when ZMQ_USE_FD is used
2019-02-02 18:33:29 +01:00
Simon Giesecke
f3561f7759 Problem: no assertions for endpoint addresses on ZMQ_EVENT_MONITOR_STOPPED and ZMQ_EVENT_LISTENING events
Solution: added assertions
2019-02-02 18:29:33 +01:00
Simon Giesecke
5e2da02528 Problem: test case is leaking test socket
Solution: close test socket
2019-02-02 17:15:27 +01:00
Simon Giesecke
54240dccbb Problem: stream listeners do not provide correct local and remote address information (test_monitor is failing)
Solution: query local and remote addresses on accepting a connection
2019-02-02 16:52:15 +01:00
Simon Giesecke
8f90f579f5 Problem: no assertions for local and remote addresses in monitor tests
Solution: added such assertions and extended test utilities
2019-02-02 16:34:19 +01:00
Simon Giesecke
f884fa725c Problem: get_monitor_event_internal segfaults when using address
Solution: dereference the pointer to the array before accessing the
element
2019-02-02 15:36:26 +01:00
Simon Giesecke
b18d28eec1 Problem: no tests for v2 monitor events and test_socket_monitor_versioned
Solution: add first test case
2019-02-02 15:33:27 +01:00
Simon Giesecke
30e0cbbcdc Problem: test_monitor depends on testutil_security
Solution: move general monitoring test utilities to new testutil_monitoring
2019-02-02 15:33:27 +01:00
Simon Giesecke
482a3a2272 Problem: documented constants are not defined
Solution: add definition to zmq.h
2019-02-02 15:33:27 +01:00
Simon Giesecke
367246bb23 Problem: test_monitor is not using a test framework
Solution: migrate to unity
2019-02-02 15:33:27 +01:00
Simon Giesecke
478e42442b Problem: no documentation on zmq_socket_monitor_versioned
Solution: add initial version of documentation
2019-02-02 15:33:27 +01:00
Simon Giesecke
d8b5204f73 Problem: socks_connecter_t does not set local address
Solution: query the local address and set it
2019-02-02 15:33:27 +01:00
Simon Giesecke
87082557f0 Problem: stream_connecter_base_t does not set local address
Solution: pass the local address by subclasses to create_engine
2019-02-02 15:33:27 +01:00
Simon Giesecke
aec9b130f7 Problem: get_socket_address and get_socket_name not available throughout libzmq and restricted to local address
Solution: move to address.hpp/.cpp and generalize
2019-02-02 15:33:27 +01:00
Simon Giesecke
01371398e9 Problem: monitor events are unversioned
Solution: add monitor event socket option
2019-02-02 15:33:27 +01:00
Simon Giesecke
2e73554644 Problem: socks_connecter_t, vmci_connecter_t and vmci_listener_t duplicate code with stream_*_base_t
Solution: add TODO comments to resolve this debt
2019-02-02 15:23:56 +01:00
Simon Giesecke
b462cc0912 Problem: misleading comments referring to a "library shutdown"
Solution: change to refer to the context
2019-02-02 15:23:56 +01:00
Simon Giesecke
9a376fbe24 Problem: code duplication in get_address of ipc/tcp/tipc listener classes
Solution: pull up to base class
2019-02-02 15:23:56 +01:00
Simon Giesecke
5c81bbe82e Problem: norm_engine.cpp missing in CMakeLists.txt
Solution: added it
2019-02-02 15:23:56 +01:00
Luca Boccassi
4d8e5fb2e9
Merge pull request #3378 from sigiesec/refactor-stream-listeners-and-connecters
Refactor stream listeners and connecters
2019-02-01 11:26:13 +01:00
Luca Boccassi
1aa6f7070c
Merge pull request #3377 from sigiesec/fix-3376
Fix handling of random port numbers with tipc
2019-02-01 11:02:24 +01:00
Simon Giesecke
e162c8bda3 Problem: code duplication around getsockname
Solution: also use get_socket_address from base class
2019-02-01 04:58:57 -05:00
Simon Giesecke
2b04946f49 Problem: code duplication around getsockname
Solution: also use get_socket_address from base class
2019-02-01 04:58:57 -05:00
Simon Giesecke
c476cf3d14 Problem: implicit cast between signed and unsigned types on some platforms
Solution: perform explicit cast
2019-02-01 04:58:57 -05:00
Simon Giesecke
95eb8a7a99 Problem: parts of in_event duplicated across subclasses of stream_listener_base_t
Solution: extract function create_engine into base class
2019-02-01 04:58:57 -05:00
Simon Giesecke
93c1843f3e Problem: duplication across ipc_listener_t, tcp_listener_t, tipc_listener_t
Solution: extract common base class stream_listener_base_t
2019-02-01 04:58:57 -05:00
Simon Giesecke
a40a3b7a34 Problem: several data members in stream_connecter_base_t are visible more than necessary
Solution: make them private and adapt initialization order
2019-02-01 04:58:57 -05:00
Simon Giesecke
a766a4b67e Problem: reconnect_timer_id duplicated and essentially used only in base class
Solution: removed definitions and uses in subclasses
2019-02-01 04:58:57 -05:00
Simon Giesecke
bed3b0cfb4 Problem: tipc_listener_t data members not conforming to naming style
Solution: add underscore prefix
2019-02-01 04:58:57 -05:00
Simon Giesecke
2a5fb6cb8e Problem: ipc_listener_t data members not conforming to naming style
Solution: add underscore prefix
2019-02-01 04:58:57 -05:00
Simon Giesecke
7e73587741 Problem: duplication in *_event methods across subclasses of stream_connecter_base_t
Solution: pull up common code, introduce new create_engine function in base class
2019-02-01 04:58:57 -05:00
Simon Giesecke
a09099a615 Problem: process_term and close duplicated across subclasses of stream_connecter_base_t
Solution: pull up
2019-02-01 04:58:57 -05:00
Simon Giesecke
531df586d0 Problem: rm_fd code duplicated across stream_connecter_t subclasses
Solution: pull up tcp_connecter_t::rm_handle and use in all subclasses
2019-02-01 04:58:57 -05:00
Simon Giesecke
1a230e89ca Problem: process_plug, get_new_reconnect_ivl and add_reconnect_timer duplicated across subclasses of stream_connector_base_t
Solution: pull up to stream_connector_base_t
2019-02-01 04:58:57 -05:00
Simon Giesecke
74667ebcba Problem: destructors of tcp_connecter_t, ipc_connecter_t, tipc_connecter_t contain duplicated code
Solution: pull up to stream_connecter_base_t
2019-02-01 04:58:57 -05:00
Simon Giesecke
d6f8d246e2 Problem: data members are duplicated across tcp_connecter_t, ipc_connecter_t, tipc_connecter_t
Solution: extract common base class stream_connecter_base_t
2019-02-01 04:58:47 -05:00
Simon Giesecke
361d7168ad Problem: tipc_connector_t::_handle_valid is redundant
Solution: replace by checks against valid value of _handle
2019-02-01 04:33:03 -05:00
Simon Giesecke
a13eb1a9d8 Problem: ipc_connector_t::_handle_valid is redundant
Solution: replace by checks against valid value of _handle
2019-02-01 04:33:03 -05:00
Simon Giesecke
065e81879a Problem: tipc_connector_t::_timer_started is unspecifically named
Solution: rename to _reconnect_timer_started
2019-02-01 04:33:03 -05:00
Simon Giesecke
ca87aaed57 Problem: ipc_connector_t::_timer_started is unspecifically named
Solution: rename to _reconnect_timer_started
2019-02-01 04:33:03 -05:00
Simon Giesecke
c94ad64876 Problem: tipc_connector_t data members not conforming to naming conventions
Solution: add underscore prefix to data members
2019-02-01 04:33:03 -05:00
Simon Giesecke
58063a75a2 Problem: ipc_connector_t data members not conforming to naming conventions
Solution: add underscore prefix to data members
2019-02-01 04:33:03 -05:00
Simon Giesecke
4d362887bb Problem: stream_engine_t::_endpoint is unnecessarily non-const
Solution: declare _endpoint const
2019-02-01 04:33:03 -05:00
Simon Giesecke
091df743a8 Problem: stream_engine_t::_peer_address is unnecssarily non-const
Solution: extract initialization code into get_peer_address function and declare _peer_address const
2019-02-01 04:33:03 -05:00
Simon Giesecke
ae79b41d4c Problem: bug in tipc_listener_t::set_address, random port is determined but not used
Solution: assign result to address

Fixes #3376
2019-02-01 04:30:20 -05:00
Simon Giesecke
afe48e2b16 Problem: unnecessary explicit definitions/deletions of special member functions in tipc_address_t
Solution: remove them
2019-02-01 04:28:35 -05:00
Simon Giesecke
19b64709bb
Merge pull request #3374 from bluca/hurd
Problem: one more test fails on GNU/Hurd
2019-01-28 09:51:50 +01:00
Luca Boccassi
9fae3d1f10 Problem: one more test fails on GNU/Hurd
Solution: mark test_rebind_ipc as XFAIL on Hurd as it does not
implement getsockname on IPC and thus it's impossible to use
wildcard IPC binds.
Document that ZMQ_LAST_ENDPOINT does not work on Hurd with IPC.
2019-01-27 14:04:18 +00:00
Doron Somech
fe4e333334
Merge pull request #3369 from bluca/abi_checker_travis
Problem: have to check ABI compatibility manually
2019-01-20 20:24:09 +02:00
Luca Boccassi
f9b0945c1b Problem: have to check ABI compatibility manually
Solution: automate it on Travis
2019-01-20 16:38:17 +00:00
Constantin Rack
331fee4b38
Merge pull request #3368 from bluca/release_branch
Problem: race condition breaks automated OBS release
2019-01-20 16:51:26 +01:00
Luca Boccassi
51557b9b96 Problem: race condition breaks automated OBS release
Solution: instead of using a temporary release branch that gets
deleted after an arbitrary timer, which never matches the time OBS
actually takes to do a full git clone, keep the branch permanently
in place and simply move it forward to the latest tag on each
release.
2019-01-20 14:34:29 +00:00
Constantin Rack
329155655c
Merge pull request #3367 from bluca/alignment_cache_size
Problems: test failures on PPC and GNU/hurd
2019-01-20 08:42:03 +01:00