Commit Graph

2850 Commits

Author SHA1 Message Date
Claudio Biagi
d41ed6180b Proxy performance fix, ticket #3439
Improve performance of the proxy forwarding batch of message.
Add throughput benchmark for proxy.
Fix valgrind error reported on unitialized vars
RELICENSE: Add emtr grant
2019-03-08 15:02:58 +01:00
Simon Giesecke
36d265ee7d Problem: redundant parentheses in return statements
Solution: remove them
2019-03-01 05:46:10 -05:00
Simon Giesecke
0c363fbb76 Problem: argument is unnecessarily copied
Solution: move instead
2019-03-01 05:46:10 -05:00
Simon Giesecke
d61d662ecb Problem: reconnect interval exponential backoff and may lead to integer overflows
Solution: guard calculation against integer overflows
2019-02-27 08:50:01 -05:00
Eelis van der Weegen
8259c519b3 Problem: Program crashes if memory allocation in socket_poller_t::rebuild fails.
Solution: Report memory allocation failure as ENOMEM so applications can handle it gracefully.

Fixes #3427.
2019-02-23 09:55:04 +01:00
Luca Boccassi
f83b13b2d6 Problem: build fails on VS2010 as it does not have snprintf
Solution: ifdef it
2019-02-17 20:15:59 +00:00
Luca Boccassi
c63b0955e5 Problem: zmq_threadstart name not distinguished
Solution: name it ZMQapp instead of ZMQbg, as it's created by the
application
2019-02-17 20:15:59 +00:00
Luca Boccassi
c8d039a3c7 Problem: unused variable warning in thread_start on !Linux
Solution: use LIBZMQ_UNUSED
2019-02-17 20:15:59 +00:00
Luca Boccassi
f7ca7515d7 Problem: new thread parameter not initialised in ctor
Solution: do it and remove ifndef windows
2019-02-17 20:15:59 +00:00
Luca Boccassi
d02561eec0 Problem: IO thread name starts counting at 1
Solution: start at 0
2019-02-17 20:15:59 +00:00
Luca Boccassi
563396445a Problem: IO thread name uses space separator, the rest uses /
Solution: use / like the rest of the names
2019-02-17 20:15:59 +00:00
Luca Boccassi
de76789ac6 Problem: new thread naming breaks build on !Linux and overwrites prefix
Solution: use the thread class function rather than one of the pthread
functions, and take into account the thread prefix context option
2019-02-17 20:15:59 +00:00
Kymeta Corp
484374f2b6 Problem: Threads don't have names which complicates debugging.
Solution:
1. Use optional name parameter in thread_t::start for operating
systems that have thread names.
2. Give start_thread() an optional name parameter for the
thread's name. If this parameter is set, it will be appended to "0MQ:".
If not set, "0MQ" will be used as the thread's name.
3. Give epoll the ability to name its thread. Then use this in
io_thread and reaper to name them.
2019-02-17 20:15:33 +00:00
Simon Giesecke
7fbd977184 Problem: assertion triggered in stream_connecter_base::close
Solution: change into regular control flow condition
2019-02-12 03:47:26 -05:00
Simon Giesecke
2759f459df Problem: C4267 warnings due to implicit conversion from size_t to int
Solution: change variable type to size_t
2019-02-12 03:47:26 -05:00
Simon Giesecke
120edd9809 Problem: selection of condition_variable_t implementation is confusing and not configurable
Solution: move configuration to build definition
2019-02-12 03:47:26 -05:00
Simon Giesecke
d7e1cf3eb0 Problem: std::condition_variable can only be used with std::unique_lock<std::mutex>, leading to two mutexes used in condition_variable_t
Solution: use std::condition_variable_any instead
2019-02-11 07:12:43 -05:00
Luca Boccassi
feadf6d40f Problem: cannot monitor state of queues at runtime
Solution: add API and ZMQ_EVENT_PIPES_STATS event which generates 2
values, one for the egress and one for the ingress pipes respectively.
Refactor the events code to be able to send multiple values.
2019-02-10 16:33:26 +00:00
Luca Boccassi
cb73745250 Problem: cannot send more than one value per v2 event
Solution: refactor code and add extra frame with value count before the
values in v2
2019-02-07 20:42:47 +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
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
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
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
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
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
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
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
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
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
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
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