Simon Giesecke
4ad239acbc
Problem: curve encoding and decoding are not easily testable
...
Solution: extract into separate class curve_encoding_t
2020-02-03 17:07:15 +01:00
Simon Giesecke
3e394fddb4
Problem: naming convention violated by curve_mechanism_base
...
Solution: change to conform with naming convention
2020-02-03 11:44:10 +01:00
Simon Giesecke
406c423c9a
Problem: C-style casts used
...
Solution: use static_cast instead
2020-01-27 10:38:00 +01:00
Simon Giesecke
78961eeab7
Problem: non-modifying member functions not marked as const/static
...
Solution: add const/static
2020-01-27 10:38:00 +01:00
Simon Giesecke
41e3f14d6a
Problem: ptr/ref parameters and local variables are non-const but never modified
...
Solution: add const
2020-01-27 10:38:00 +01:00
Simon Giesecke
759fed8e7e
Problem: meaningless inline specified on function declarations
...
Solution: remove them
2020-01-27 10:38:00 +01:00
Simon Giesecke
f8f7913737
Problem: irregular loop conditions
...
Solution: use standard loop constructs and optimize some loops
2020-01-27 10:38:00 +01:00
Simon Giesecke
628adf1cb7
Problem: inconsistent polymorphic inheritance
...
Solution: consistently use virtual, override and final
2020-01-27 08:46:55 +01:00
Simon Giesecke
36a8df2f8c
Problem: sockets can be created after calling zmq_ctx_shutdown
...
Solution: fix handling of _starting and _terminate flags
Add tests for this situation.
Clarify documentation of zmq_ctx_shutdown and zmq_socket.
Fixes #3792
2020-01-26 18:06:14 +01:00
Denis Collette
64fc106123
Problem: preious commit contains tabs
...
Solution: replace tabs with spaces
2020-01-22 20:15:50 -04:00
Denis Collette
1450681fb4
Problem: Issue #3766 states that strtok is not thread safe and should be replaced
...
Solution: Replaced calls to strtok with strtok_r (strtok_s for windows)
in ws_engine.cpp
2020-01-22 19:40:26 -04:00
Luca Boccassi
ddae567f16
Problem: ZMQ_WSS socket options not defined in src/zmq_draft.h
...
Solution: add them
2020-01-19 14:39:29 +00:00
Matthias Loy
c357c378d8
fix: websocket url without path
...
websocket urls without a path caused crash!
2020-01-18 23:04:16 +01:00
Doron Somech
60ef14f80b
problem: ws_engine don't support WS RFC close control msg
...
Solution: when peer send a close msg, close the connection
2020-01-18 19:30:23 +02:00
Doron Somech
b120ec33a9
problem: ws_engine don't support WS RFC ping-pong
...
Solution: implement both PONG response and producing pings
2020-01-18 18:28:00 +02:00
Christoph Kahl
c5dab4f48f
mingw: add missing namespace
2020-01-09 21:44:53 +01:00
Simon Giesecke
73eb1eac05
Merge pull request #3767 from bluca/libbsd
...
Problems: reimplementation of strlcpy, CMake does not use pkg-config for NSS, wrong pc generated by autoconf with GNUTLS
2020-01-06 11:46:38 +01:00
xqcool
382c6d7186
Update array.hpp ( #3769 )
...
* Update array.hpp
Problem:Calling back on an empty container causes undefined behavior.
Solution:Check with the function empty()
* Create xqcool.mq
Adds relicensing grant
2020-01-01 10:37:51 +01:00
Luca Boccassi
3832bd6b11
Problem: UWP build fails
...
Solution: initialize local variable in all cases to false positive
compiler warning
2019-12-28 21:17:09 +01:00
Luca Boccassi
068385c951
Problem: internal reimplementation of strlcpy used by default on Linux
...
Solution: use libbsd by default when available, and the internal implementation
only as a fallback, to take advantage of Linux distros maintenance of the
string libraries.
2019-12-28 16:21:06 +01:00
Luca Boccassi
246cc77efc
Merge pull request #3763 from sigiesec/replace-strcpy
...
Avoid possible buffers overruns in ws_engine
2019-12-25 16:13:13 +01:00
Simon Giesecke
3dbbc28bb8
Problem: use of unsafe strcpy
...
Solution: use memcpy with known size instead
2019-12-25 13:56:26 +01:00
Simon Giesecke
334e837b88
Problem: ws_engine uses unsafe strcpy
...
Solution: use strcpy_s instead (define custom if not available)
2019-12-25 13:56:26 +01:00
Simon Giesecke
14ab794671
Problem: local functions not declared static
...
Solution: add static
2019-12-25 13:52:21 +01:00
Simon Giesecke
fa804c7783
Problem: pseudo-loops which had exactly one iteration
...
Solution: removed them
2019-12-25 13:52:21 +01:00
Simon Giesecke
579aa5b440
Problem: non-loop-variables initialized via loop initializer
...
Solution: move initialization to declaration
2019-12-25 13:52:21 +01:00
Simon Giesecke
d4cc592387
Problem: loop variable modified in loop step and body
...
Solution: modify it in loop body only
2019-12-25 13:52:21 +01:00
Simon Giesecke
ddbf45cf8d
Problem: redundant break after return
...
Solution: remove them
2019-12-24 10:17:10 +01:00
Simon Giesecke
2256bd5b0b
Problem: unnecessary copying of string literals
...
Solution: just copy the address
2019-12-23 14:12:07 +01:00
Simon Giesecke
4c3f115469
Problem: raw malloc used unnecessarily
...
Solution: use std::string instead
2019-12-23 14:12:07 +01:00
Simon Giesecke
30e2398e67
Problem: WSS-specific members and options are compiled without ZMQ_HAVE_WSS
...
Solution: properly guard members and options
2019-12-23 11:58:07 +01:00
Simon Giesecke
9e548bd591
Problem: insecure and inefficient strcpy used
...
Solution: use memcpy with known length
2019-12-23 11:58:07 +01:00
Simon Giesecke
9f16513ebe
Problem: loop sending signaler event is obscure
...
Solution: add comments and remove continue/break
2019-12-10 16:19:25 +01:00
Simon Giesecke
3ace237988
Revert "Removed unreachable code paths"
...
This reverts commit 4f77cfa327
.
2019-12-10 16:08:52 +01:00
Simon Giesecke
f60f909899
Problem: missing use of C++11 = delete and = default
...
Solution: introduce macros ZMQ_DEFAULT and ZMQ_NON_COPYABLE_NOR_MOVABLE
2019-12-09 09:48:21 +01:00
Simon Giesecke
86d7de38ca
Problem: redundant empty destructor
...
Solution: Remove definition
2019-12-08 19:43:31 +01:00
Simon Giesecke
f8adf9ea55
Problem: unnecessary value parameters
...
Solution: change to const references
2019-12-08 15:24:48 +01:00
Simon Giesecke
cb2b377d9f
Problem: redundant else after return
...
Solution: remove else
2019-12-08 15:24:48 +01:00
Simon Giesecke
fdabd73da6
Problem: parameters not const where const possible
...
Solution: add const
2019-12-08 15:24:48 +01:00
Simon Giesecke
84267e734b
Problem: inconsistent parameter names on definition/declaration
...
Solution: align them
2019-12-08 15:24:48 +01:00
Simon Giesecke
cd954e207d
Problem: use of C-style casts
...
Solution: use static_cast/reinterpret_cast instead
2019-12-08 15:24:48 +01:00
Simon Giesecke
a83c57d0bb
Problem: identifiers not conformant with naming convention
...
Solution: fix identifier names
2019-12-08 15:24:48 +01:00
Luca Boccassi
df993d113c
Merge pull request #3751 from sigiesec/windows-domain-sockets-signaler
...
Use Unix domain sockets for listener when available on Windows
2019-12-07 00:25:21 +00:00
Simon Giesecke
ca552d563f
Problem: listener socket uses TCP loopback connections which sometimes go awry
...
Solution: Use domain sockets instead if available
2019-12-06 19:11:50 +01:00
Simon Giesecke
bd4c2d60ba
Problem: zmq::listener_t::create_wildcard_address not reusable in ip.cpp
...
Solution: move to ip.hpp as zmq::create_ipc_wildcard_address
2019-12-06 19:11:50 +01:00
Simon Giesecke
3bcaea535c
Problem: zmq_fdpair function is very long
...
Solution: Extract TCP/IP loopback variant into zmq_fdpair_tcpip
2019-12-06 17:51:13 +01:00
liedtkeInTUM
65d2f1f498
Problem: if IPC enabled libzmq does not compile when in uwp build ( #3747 )
...
* Problem: if IPC enabled libzmq does not compile when in uwp build
* Problem 10.0.##### can be valid windows target versions
* Problem: No builds are triggered on uwp platform
* Problem: epoll is set before UWP platform is checked
* Problem: used wrong CMAKE_SYSTEM_NAME specifier
* Problem: build tests fails during cmake configure
* Use Win32 build step for Win32-uwp platform
* Disable compile options that produce warnings that leads to a ci fail
* winnt version is set by cmake, no need for redefinition in windows.hpp
* Eliminate all warning according Incremental and opt:icf are specified
* Prefer to disable opt flags in debug config rather than incremental linking
* CMAKE_GENERATOR should not include uwp definition
* Add release build with uwp configuration
* Problem: pointer potentially uninitialized
2019-12-06 13:27:24 +00:00
Andrij Abyzov
5a854780f2
Problem: cannot send arbitrary data from XSUB to XPUB.
...
Solution: now if the first frame in a multipart message is not subscribe/unsubscribe,
the rest of the parts are also considered to be not subscribe/unsubscribe.
2019-12-04 16:25:08 +01:00
Luca Boccassi
a61db18eee
Problem: WSS LAST_ENDPOINT returns WS transport
...
Solution: add wss_address_t subclass of ws_address_t to override the
to_string method
2019-11-28 12:37:53 +00:00
Luca Boccassi
c711941e9a
Problem: wildcard port binding does not work with WS sockets
...
Solution: remove the path from the address when resolving
2019-11-28 09:27:05 +00:00
Luca Boccassi
79d75f017c
Problem: WS sockets return TCP protocol strings with ZMQ_LAST_ENDPOINT
...
Solution: use the correct address class when resolving
2019-11-28 09:27:05 +00:00
Andrij Abyzov
04761133bf
Fix zmq::select_t::loop formatting
2019-11-20 09:29:59 +01:00
Andrij Abyzov
108977c838
Change XSUB -> XPUB multipart message processing.
...
Now only the first part in a multipart message will be treated as subscribe/unsubscribe.
The rest will be considered user messages regardless of the first byte.
2019-11-19 18:22:12 +01:00
Luca Boccassi
9ced36e407
Problem: WSAEventSelect checks for FD_OOB, but select does not
...
WSAEventSelect is used on Windows (when select is the polling method)
only if waiting for more than one socket family, excluding IPv4/6.
It is then passed FD_OOB, which means it can be woken by OOB messages,
but select later on never checks for it.
Remove FD_OOB as it's not actually used for anything.
2019-11-01 09:34:03 +00:00
Simon Giesecke
302436515c
Problem: windows socket error number cleared before saved to saved_errno
...
Solution: call tune_socket only if connect was successful
2019-10-29 23:04:54 +01:00
Simon Giesecke
66d0f3511f
Problem: ipc transport not supported under Windows
...
Solution: implement support
2019-10-29 23:04:54 +01:00
Simon Giesecke
7f43e7ff75
Problem: build targeting Windows XP is broken
...
Solution: fix build issues
2019-10-19 14:04:55 +02:00
Michele Dionisio
9f65720dc0
Revert "Problem: pkg-config file cannot be used for static linking on CentOS 7"
...
This reverts commit 765c24740d
.
2019-10-14 20:43:33 +02:00
Luca Boccassi
683bf1d732
Merge pull request #3713 from mdionisio/useless_ceil
...
avoid to use std::ceil
2019-10-14 15:53:39 +01:00
Michele Dionisio
f07f47b1e3
avoid to use ceil function
...
ceil function is usually in math library that can be avoided as dependency
2019-10-14 16:18:27 +02:00
Chih-Hsuan Yen
765c24740d
Problem: pkg-config file cannot be used for static linking on CentOS 7
...
Solution: add -lm to Libs.private of libzmq.pc so that the std::ceil
usage in src/decoder_allocators.cpp is satisfied during static linking
on CentOS 7.
See https://github.com/zeromq/libzmq/issues/3710 for a reproducer.
2019-10-12 22:36:31 +08:00
somdoron
9b15658eb1
problem: zero-sized messages cause assertion when glibc assertion are on
...
Solution: when a zero-sized message is encoded or decoded avoid mem copy
2019-10-07 09:11:44 +03:00
somdoron
618227f63c
problem: GNUTLS handshake is getting blocked because of timeout on some versions
...
Solution: disable handshake timeout
2019-10-06 11:05:56 +03:00
somdoron
a9bb526403
problem: wss transport return incorrect return code for error
...
Solution: return -1 for errors
2019-10-04 20:46:00 +03:00
somdoron
2018be643a
problem: valgrind complain about uninitialized value
...
Solution: initialize the value
2019-10-04 17:13:48 +03:00
somdoron
977f137a83
problem: cannot check WS and WSS capability
...
Solution: add capability check to zmq_has
2019-10-04 16:27:36 +03:00
somdoron
41b9af2c79
problem: WS transport doesn't support mechanism
...
Solution: add support to mechanism
2019-10-04 16:24:48 +03:00
somdoron
7296fb5b15
problem: unsecured websocket is rarely used in production
...
Solution: support websocket with tls (wss)
2019-10-02 08:58:26 +03:00
trya
2fe9dd9101
Problem: ZMQ_CONFLATE on PUB sockets delivers to only one subscriber at most
...
Solution: Fix behavior of dbuffer on writes. Message passed in argument
of dbuffer::write can be assigned directly to the back buffer without
leaking, since the message has already the right reference count (see
dist::distribute and msg_t::add_refs). Secondly, in order to prevent the
message pending in the front buffer from leaking if it hasn't been
closed yet (for example because the peer is not reachable anymore), move
back buffer to front buffer using msg_t::move instead of swapping the
buffers, thus allowing release of the message in the front buffer.
2019-09-24 02:57:24 +02:00
somdoron
9be8334938
problem: sha1 external module conflict with czmq
...
Solution: allow to use external library (nss) for sha1 to avoid the conflict
2019-09-11 15:01:28 +03:00
somdoron
52e0d965b3
problem: ws_engine doesn't check Sec-WebSocket-Protocol
...
Solution: Validate Sec-WebSocket-Protocol and make sure ZWS2.0 is one of the protocols
2019-09-05 23:11:29 +03:00
somdoron
a48fdd6a7f
problem: ws_engine doesn't send correct host and path
...
Solution: extract path and host from the address
2019-09-05 17:33:38 +03:00
Luca Boccassi
6fb8ef0711
Problem: can no longer send user data from XSUB to XPUB
...
Solution: fix regression introduced by:
https://github.com/zeromq/libzmq/pull/3168
Correctly fall back to user message if the first byte is neither 0 nor
1, and add a simple unit test
Fixes https://github.com/zeromq/libzmq/issues/3656
2019-09-02 11:33:19 +01:00
Francesco Montorsi
b3582da8fb
Introduce extended set/get methods for ZMQ contexts ( #3642 )
...
* Introduce DRAFT zmq_ctx_set_ext() and zmq_ctx_get_ext() methods. Change
ZMQ_THREAD_NAME_PREFIX to allow for non-numeric thread name prefixes.
2019-08-27 23:41:23 +01:00
Andrei Tomashpolskiy
2aa87c94cc
UDP engine aborts on networking-related errors from socket syscalls (2) #2862 ( #3640 )
...
* UDP engine aborts on networking-related errors from socket syscalls #2862
2019-08-25 15:55:42 +01:00
Andrei Tomashpolskiy
f48c86d077
UDP engine aborts on networking-related errors from socket syscalls #2862 ( #3638 )
...
* UDP engine aborts on networking-related errors from socket syscalls #2862
* Add relicense statement
2019-08-22 18:52:31 +01:00
Luca Boccassi
9bb197e030
Merge pull request #3613 from TomzBench/mingw-fix
...
no void pointer to store function pointer
2019-08-19 11:15:29 +01:00
Simon Giesecke
e9b67001dd
Problem: invalid syntax for calling convention on function pointer
...
Solution: fix syntax and formatting, remove C-ism for defining struct
2019-08-19 10:13:11 +02:00
Luca Boccassi
87988bf4c8
Problem: formatting error
...
Solution: run make clang-format-diff to fix it
2019-08-11 12:00:13 +01:00
thomas
64d58c432c
relicense add
2019-08-10 11:15:26 -04:00
thomas
87b81926aa
no void pointer to store function pointer
2019-08-10 10:43:28 -04:00
Christopher Hall
72854e6342
problem: DragonFly BSD does not allow mapping global IPv4 addresses when IPv6 is used
...
solution: Handle as for OpenBSD by not attemption to set this option on the socket
Signed-off-by: Christopher Hall <hsw@ms2.hinet.net>
2019-08-06 12:11:06 +08:00
Luca Boccassi
4d5e97adac
Problem: formatting errors introduced by #3601
...
Solution: fix them with make clang-format-diff
2019-07-30 13:43:48 +01:00
Jacques Germishuys
b3123a2fd1
Problem: __try and __except isn't universally supported on windows
...
Solution: Manually push/pop an exception registration record.
Only set the thread name with a debugger present
2019-07-30 11:31:22 +01:00
Shubham Lagwankar
f07d88be09
Problem: redundant check in condition
...
Solution: remove it
2019-07-26 11:43:57 -04:00
aixxe
63409579e7
Problem: Usage of 'if_nametoindex' not supported in Windows XP.
...
Solution: Add ZMQ_HAVE_WINDOWS_TARGET_XP check to src/udp_address.cpp.
2019-07-25 20:38:54 +01:00
Mancaș George
13387c5cdc
Problem: stream_engine use after free
...
Solution: Don't allow concurrent heartbeat timers
2019-07-24 13:04:32 +00:00
Luca Boccassi
a56d36b8e5
Merge pull request #3587 from somdoron/stream_engine_base
...
problem: ws_engine duplicate code from stream_engine
2019-07-18 11:57:27 +01:00
somdoron
157b2a2ee0
problem: ws_engine duplicate code from stream_engine
...
Solution: New class called stream_engine_base which is inherited by ws_engine, zmtp_engine and raw_engine.
2019-07-18 11:28:08 +03:00
Luca Boccassi
7262701876
Problem: build on centos6/ubuntu12 still broken
...
Solution: move the definition of __STDC_LIMIT_MACROS somewhere the test actually uses
2019-07-16 18:15:47 +01:00
Luca Boccassi
496c8eb05a
Problem: missing copyright and license header from new file
...
Solution: add it
2019-07-16 17:37:40 +01:00
Luca Boccassi
10a0baf691
Problem: wrong copyright dates in newly added files
...
Solution: fix them
2019-07-16 17:36:44 +01:00
Luca Boccassi
38c31154d0
Problem: build broken with older compilers
...
Solution: define __STDC_LIMIT_MACROS before including stdint.h so that SIZE_MAX
is defined
2019-07-16 17:34:58 +01:00
Luca Boccassi
3692b26649
Merge pull request #3579 from somdoron/zws2
...
problem: browser cannot communicate with zeromq directly
2019-07-16 13:28:30 +01:00
somdoron
39941a0c82
problem: browser cannot communicate with zeromq directly
...
Solution: implement ZWS 2.0 which websocket transport for zeromq
2019-07-16 10:12:20 +03:00
Simon Giesecke
1781cff37b
Problem: plaintext secrets placed in insecure memory
...
Solution: Use secure_allocator_t for plaintext secrets
2019-07-14 17:12:39 +02:00
Simon Giesecke
92dbb4caee
Problem: no C++ style secure memory allocator available
...
Solution: Added secure_allocator_t based on libsodium's memory management functions when available
2019-07-14 17:12:39 +02:00
Doron Somech
9c5cf8573c
Merge pull request #3573 from sigiesec/use-std-vector
...
Problem: use of malloc is error-prone
2019-07-10 20:07:33 +03:00
Simon Giesecke
1de4cf6ffa
Problem: use of malloc is error-prone
...
Solution: use std::vector instead, simplify control-flow
2019-07-10 18:26:58 +02:00
Luca Boccassi
c819eedd89
Problem: missing rc checks in udp_engine
...
Solution: add them
2019-07-09 17:25:58 +01:00
Thomas M. DuBuisson
90ff30c086
Free memory when curve_client sends invalid ready message.
2019-07-08 21:05:36 -07:00
Luca Boccassi
8e6bafcbe0
Problem: application metadata not parsed correctly when using CURVE
...
Solution: create buffers large enough to contain arbitrary metadata
2019-07-08 10:47:27 +01:00
Luca Boccassi
ddd0da2f57
Merge pull request #3476 from TomMD/fix/memory-leak
...
Request handling leaked memory. Depending on the application's use o…
2019-07-06 10:05:25 +01:00
Thomas M. DuBuisson
367cedb7c6
Fix request-handling memory leak
2019-07-05 16:53:46 -07:00
Shubham Lagwankar
1186e9868a
Problem: code doesn't follow libzmq naming conventions
...
Solution: rename types/variables that are inconsistent
2019-06-28 11:57:45 -04:00
Luca Boccassi
a43c842e0d
Merge pull request #3556 from ssbl/better-names
...
Problem: variable and type names are not descriptive
2019-06-27 18:23:19 +01:00
Shubham Lagwankar
d1e6fe19b4
Problem: variable and type names are not descriptive
...
Solution: use more descriptive names
This commit also improves comments related to some of the changes.
2019-06-27 11:57:01 -04:00
jean-airoldie
cfcab66c71
Problem: {in,out}_batch_size must be configured at compiled time
...
Solution: Added a socket option to configure them at runtime.
2019-06-27 02:31:11 -04:00
Shubham Lagwankar
15dafb1c1c
Problem: radix tree's apply function uses incorrect resizing logic ( #3548 )
...
* Problem: radix tree's apply function uses incorrect resizing logic
Solution: rewrite the function using a vector
The buffer is extended once by 256 bytes, which will not be enough if
the node holds data larger than this number.
2019-06-20 07:58:08 +01:00
Luca Boccassi
3c06ec118f
Problem: formatting errors
...
Solution: apply clang-format-diff
2019-06-11 10:31:15 +01:00
Philippe Bernardino Leite
8a02f70706
pthread_equal to compare thread ids
...
I am trying to port ZeroMQ to z/OS USS and I faced several problems. One of them is this function "is_current_thread" trying to compare two thread ids with operator "==". I've changed the code to use the official function "pthread_equal" to compare thread ids and now it's working fine.
2019-06-10 22:10:01 -03:00
Christophe Guillon
58c30dc7d1
Add support for SOCKS5 basic authentication
2019-06-10 16:40:06 +02:00
Christophe Guillon
42cfa697f2
Fix issues with SOCKS5 proxy connection
...
Two issues where introduced by commit 12c4b55a
:
- the proxy connection was done to the target address instead of
the proxy address
- on error the proxy connection status was not reset to unplugged
2019-06-10 14:32:20 +02:00
Romain Moret
5b07a1199c
Fix compiler error
2019-05-21 15:07:00 +02:00
Romain Moret
27005cc1ae
Implement thread name on windows, cleanup thread naming internals
2019-05-21 12:12:19 +02:00
Doron Somech
046ccfc408
Merge pull request #3513 from bluca/clang7
...
Problem: clang-format 5 has issues with comments
2019-05-18 19:18:42 +03:00
Luca Boccassi
bde18f3ede
Problem: comments before ifdefs are wrongly formatted
...
Solution: now that clang-format 6+ is used in the CI, fix it
2019-05-18 17:09:17 +01:00
Luca Boccassi
19ff4d0b6a
Problem: zmq_socket_monitor_versioned_typed duplicates zmq_socket_monitor_versioned
...
Solution: unify the two APIs, as they are both still in DRAFT state and
thus can be changed.
2019-05-18 16:44:07 +01:00
Luca Boccassi
41be0f5386
Problem: new xpub option is in critical path
...
Solution: use unlikely to optimize for the most common case
2019-05-18 16:44:07 +01:00
Luca Boccassi
a53dfe936a
Problem: many unnecessary ifdefs covering new xpub option
...
Solution: remove them, only public headers have to be ifdef'd
2019-05-18 16:44:07 +01:00
imkcy9
2f98f7034b
Support XPub socket send last value caching to last subscription pipe with ZMQ_XPUB_MANUAL_LAST_VALUE. ( #3511 )
...
* Add ZMQ_XPUB_MANUAL_LAST_VALUE
* Surpport xpub send last value caching to one pipe with ZMQ_XPUB_MANUAL_LAST_VALUE
* Add test_xpubub_manual_last_value
* Add relicense and doc
2019-05-17 22:12:32 +01:00
jean-airoldie
606a8f7967
Problem: Socket monitoring only allows ZMQ_PAIR
...
Solution: Allow ZMQ_PUB and ZMQ_PUSH sockets types for the monitoring.
This way someone could create a ZMQ_PULL socket connected to multiple
monitoring sockets at the same time.
2019-05-15 01:48:46 -04:00
Simon Giesecke
6e1c58e86e
Problem: PLAIN HELLO message incorrectly uses WELCOME literal
...
Solution: change to HELLO
2019-05-10 03:55:07 -04:00
Simon Giesecke
d46c580977
Problem: signature of zmq_poller_fd does is incompatible with regular error handling
...
Solution: change return type to int (again) and return fd via an output parameter
2019-05-09 11:09:35 -04:00
Simon Giesecke
63c4d8be78
Problem: syntax error on Windows related to socket descriptor type
...
Solution: use proper fd_t type, and also define and use a zmq_fd_t in the API
2019-05-09 07:21:08 -04:00
jean-airoldie
cdbe120738
Problem: No invalid pointer handling for zmq_poller_fd
...
Solution: Add some and document it.
2019-05-02 17:10:20 -04:00
jean-airoldie
046534480b
Problem: Cannot get thread safe socket fd
...
Solution: Add a method to get the zmq_poller's signaler fd. Then we can
associate a poller instance with every thread safe socket and use its
fd.
2019-04-27 22:58:42 -04:00
Shubham Lagwankar
e9678efe00
Problem: unused Windows-specific code in sleep_ms
...
Solution: remove it since sleep_ms isn't used on Windows
2019-04-24 14:39:27 -04:00
Rosen Penev
091e15a28d
Add <ios> include to fix uClibc++ compilation
...
Under uClibc++, streamoff is defined in <ios>. This header is needed to fix compilation.
2019-04-19 12:16:01 -07:00
Luca Boccassi
3c21eed0a1
Problem: CI format check fails
...
Solution: fix it
2019-04-06 00:12:32 +01:00
Serhio
db7bdd1b1a
Some explicit endpoint type changes to support GCC 5 ( #3468 )
...
* Some explicit endpoint type changes to support GCC 5
* ../RELICENSE/SergheiNovac.md
2019-04-05 10:54:26 +01:00
Simon Giesecke
42e27b7d0d
Problem: socket returned by ZMQ_FD cannot be used with CreateIoCompletionPort
...
Solution: add WSA_FLAG_OVERLAPPED socket flag
2019-03-27 09:56:11 +01:00
Simon Giesecke
47dba21005
Problem: code is unnecessarily imperative
...
Solution: make more functional-style
2019-03-24 13:46:15 -04:00
Simon Giesecke
1450830611
Problem: unused include directives
...
Solution: remove and add where needed
2019-03-23 09:46:37 -04:00
Simon Giesecke
2f40d21618
Problem: access to moved object
...
Solution: use move target instead
2019-03-22 12:06:12 -04:00
Simon Giesecke
e17232f725
Problem: possible use-after-free
...
Solution: check for failure and do not access any members afterwards
2019-03-22 12:06:12 -04:00
Luca Boccassi
17c47da01c
Merge pull request #3452 from jacquesg/strnlen
...
Problem: strnlen may not be available
2019-03-18 12:09:38 +00:00
Jacques Germishuys
b26542bbfc
Problem: strnlen may not be available
...
Solution: Provide an implementation
2019-03-18 11:37:53 +00:00
Jacques Germishuys
8a2296711d
Problem: epoll_t no longer requires _worker
...
Solution: Remove _worker
2019-03-18 10:16:13 +00:00
Jacques Germishuys
212ab4f834
Problem: /dev/poll doesn't compile
...
Solution: Make devpoll_t derive from worker_poller_base_t
2019-03-18 10:15:27 +00:00
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
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
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