Commit Graph

3140 Commits

Author SHA1 Message Date
Luca Boccassi
be77a8d932
Merge pull request #3903 from bjovke/msvc_cplusplus
Problem: MSVC always reports __cplusplus macro value as 199711L. Some…
2020-05-09 10:50:43 +01:00
Doron Somech
3da84c6d06 problem: no thread-safe alternative for ZMQ_PAIR
Solution: create ZMQ_CHANNEL, the thread safe alternative
2020-05-09 08:49:01 +03:00
Jovan Bunjevacki
804d528114 Problem: MSVC always reports __cplusplus macro value as 199711L. Some newer features are switched off even with latest Visual studio version.
Solution: Add check for MSVC version along with __cplusplus check.
2020-05-09 01:20:47 +02:00
Luca Boccassi
397ac80850 Problem: ZMTP v1 static allocator is needlessly resized
Solution: don't do it, resizing the shared allocator makes sense
as it can take the message buff for zero copy, but the static allocator
is fixed
2020-05-08 18:18:34 +01:00
Luca Boccassi
7df845fb82 Problem: memory sanitizer detects uninitialised global variable usage
Solution: revert "Problem: complexity of start_connecting"

https://travis-ci.org/github/google/oss-fuzz/jobs/680325364

This reverts commit c590873ff7.

Conflicts:
	src/session_base.cpp
	src/session_base.hpp
2020-05-04 22:02:04 +01:00
Luca Boccassi
60ccf54fa6 Problem: sub/cancel broken with CURVE
Solution: handle downgrading sub/cancel messages in CURVE engine
2020-05-03 17:42:53 +01:00
Luca Boccassi
534580c31d
Merge pull request #3893 from gummif/gfa/blob-ref
Problem: extra blob copy
2020-05-02 14:26:06 +01:00
Gudmundur Adalsteinsson
47a080aac0 Problem: extra blob copy
Solution: use reference tag
2020-05-01 22:27:44 +00:00
Gudmundur Adalsteinsson
284d90a436 Problem: unnecessary event struct and UB
Solution: simply use zmq_poller_event_t
2020-05-01 22:12:30 +00:00
Gudmundur Adalsteinsson
e18772f942 Problem: -1 used for invalid socket
Solution: use retired_fd instead
2020-04-29 17:12:08 +00:00
Luca Boccassi
1443c0e787
Merge pull request #3887 from gummif/gfa/unify-fd
Problem: Multiple fd_t definitions
2020-04-28 13:32:52 +01:00
Gudmundur Adalsteinsson
d426f2ab0c Problem: Multiple fd_t definitions
Solution: Unify definition
2020-04-28 08:50:18 +00:00
Gudmundur Adalsteinsson
bf22a9f3e9 Problem: Poller event fd unspecified
Solution: Specify an invalid file descriptor for socket events
2020-04-27 21:00:45 +00:00
Luca Boccassi
a525323757
Merge pull request #3878 from Eelis/master
Problem: out-of-bounds array access in socket_poller::check_events.
2020-04-20 12:50:41 +01:00
Luca Boccassi
f00f464566
Merge pull request #3866 from gummif/gfa/poller-refactoring
Problem: poller item lookup can be simplified
2020-04-20 09:34:57 +01:00
Eelis van der Weegen
063f14a940 Problem: out-of-bounds array access in socket_poller::check_events. 2020-04-20 03:22:31 +02:00
Gudmundur Adalsteinsson
0b32fb3629 Problem: poller item lookup can be simplified
Solution: Extract generic find function
2020-04-19 20:53:56 +00:00
Doron Somech
6ca07a30e3 problem: checking the wrong socket when sending hello msg 2020-04-18 22:45:49 +03:00
Luca Boccassi
ada6f0c058
Merge pull request #3871 from somdoron/DISCONNECT_MSG
problem: router doesn't know when peer disconnected
2020-04-18 10:49:50 +01:00
Gudmundur Adalsteinsson
9c6738bb45 Problem: No support to query poller size
Solution: Add zmq_poller_size that queries the number
of objects registered, allowing safer usages of poller
to avoid livelock situations.
2020-04-17 18:37:01 +00:00
Doron Somech
81444136d5 problem: router doesn't know when peer disconnected
ZMQ_ROUTER_NOTIFY doesn't have a context and doesn't play nice with protocols. with ZMQ_DISCONNECT_MSG we can set it to a protocol message, like DISCONNECT in majordomo. Router will send it when a peer is disconnected. Another advantage of ZMQ_DISCONNECT_MSG is that it also works on inproc.

Together with ZMQ_HEARTBEAT it allows to build very reliable protocols, and much simpler as well.
2020-04-17 18:04:28 +03:00
Doron Somech
93da6763b0 problem: ZMQ_HEARTBEAT is not useful without sending an hello message
When using ZMQ_HEARTBEAT one still needs to implement application-level heartbeat in order to know when to send a hello message.
For example, with the majordomo protocol, the worker needs to send a READY message when connecting to a broker. If the connection to the broker drops, and the heartbeat recognizes it the worker won't know about it and won't send the READY msg.
To solve that, the majordomo worker still has to implement heartbeat. With this new option, whenever the connection drops and reconnects the hello message will be sent, greatly simplify the majordomo protocol, as now READY and HEARTBEAT can be handled by zeromq.
2020-04-17 14:54:58 +03:00
grmt
718ad8ab96
add wss transport and fix tipc tests when building using cmake on linux (#3857)
* Allow CMAKE to generate ws and wss transports
I guess there is little use of just ws transport, so by default
GnuTLS (and libsodium) are enabled

* cmake libzmq including wss transport (ubuntu 19.10 and ubuntu 19.10 + wsl 1.0)
test_security_fails (libsodium assert !?)

* updated relicense

* make external libs gnutls nss sodium optional

* #ifdef WSS classes and functions, build test*ws* only if correct libs are included, warning if libs not present

* make libsodium optional

* cmake fix tests TIPC transport

* clang-format pointed out a wrongly placed #ifdef

* GnuTLS before 3.6.7 is not safe

* msvc doesn't agree with strlen in array declaration, test_socks now at least compiles on windows

* windows: libsodium build fails, missing include dirs set by env var

* ws transport test only works when GnuTLS is found

* Fixed condition to use NSS / built in SHA1, so that test_ws_transport should now pass, also when GnuTLS is not found
2020-04-13 23:03:19 +01:00
Luca Boccassi
7276b6809a
Merge pull request #3868 from gummif/gfa/poller-sleep
Problem: poller sleeps forever if no events
2020-04-13 22:52:46 +01:00
Gudmundur Adalsteinsson
458d805eb6 Problem: poller sleeps forever if no events
Solution: Fail with error if no events are active and timeout is infinite
2020-04-13 21:18:12 +00:00
Gudmundur Adalsteinsson
a468ac782a Problem: poller item fd uninitialized
Solution: Set to zero for socket events
2020-04-13 20:08:08 +00:00
Gudmundur Adalsteinsson
7b1fef28f9
Problem: boilerplate when init msg from data copy (#3860)
* Problem: boilerplate when init msg from data copy

Solution: Add zmq_msg_init_buffer to construct
a message by copying memory from buffer.
2020-04-09 23:59:43 +01:00
JaeSang Yoo
38fd1fdc8e Problem: some cond. compile may cause problem
Some ifdefs in condition checking may cause problem in some compiler or
static analyzers. When PGM and NORM both are disabled, some condition
will be derived as false || false.

Solution: Splitted condition checking for every ifdef conditions
2020-03-14 22:20:54 +09:00
JaeSang Yoo
4f436ce00f Problem: some conditional compile was not applied
Conditinoal compile for OPENPGM and NORM is mixed.
Also found few codes which needs conditional compile but not applied.

Solution: Apply conditional compile preprocessors
2020-03-14 19:55:54 +09:00
JaeSang Yoo
ebd22ecf85 Problem: literals protocol names still remains
Solution: replace into named constants
2020-03-14 19:55:54 +09:00
Luca Boccassi
f9417dab4d Problem: msg_t functions do not respect coding style
Solution: fix them
2020-03-07 13:25:18 +00:00
Rickard Hallerbäck
2206cb37e0
ip_resolver_t: Silencing C++-warning -Wnon-virtual-dtor (#3837)
* ip_resolver_t: adding virtual descructor to silence C++-warning -Wnon-virtual-dtor

* adding my relicense
2020-02-28 16:49:12 +00:00
Luca Boccassi
4f45ac135a Problem: formatting not up to date
Solution: run make clang-format-diff
2020-02-23 18:25:20 +00:00
Bill Torpey
debbe08fb8
add option to stop trying to reconnect on ECONNREFUSED (#3831)
* add option to stop trying to reconnect on ECONNREFUSED
2020-02-23 17:17:22 +00:00
Luca Boccassi
52044b38f7
Merge pull request #3823 from somdoron/ZMQ_PEER
problem: zeromq doesn't has a thread-safe peer to peer socket
2020-02-09 21:53:18 +00:00
Doron Somech
70bc7dd925 problem: zeromq doesn't has a thread-safe peer to peer socket
Solution: a new socket type, called PEER. Very similar to SERVER, but can only connect to other PEERs. Also a new zmq_connect_peer method, that connect and return a routing-id in thread-safe and atomic operation
2020-02-09 23:20:14 +02:00
Luca Boccassi
821685f249
Merge pull request #3822 from somdoron/GROUPMAXLENGTH
problem: maximum size of group doesn't match the RFC maximum size
2020-02-09 13:10:47 +00:00
Doron Somech
05194eb549 problem: maximum size of group doesn't match the RFC maximum size 2020-02-09 14:46:23 +02:00
Simon Giesecke
f17a794d59
Merge pull request #3814 from bluca/sub_cancel_decoder
Implement ZMTP 3.1 subscribe/cancel via commands
2020-02-07 09:26:21 +01:00
Luca Boccassi
a7bb41ef77
Merge pull request #3820 from somdoron/WSENCODING
websocket problems
2020-02-06 16:39:38 +00:00
Doron Somech
652834296b problem: ws_transport is missing the path the endpoint name 2020-02-06 17:22:28 +02:00
Doron Somech
071ec1a9bb problem:Fallback to localhost in ws_address has no effect
Solution: return after the fallback

fixes #3809
2020-02-06 17:22:11 +02:00
Doron Somech
7bfd9512e6 problem: ws_encoder allocate a new msg for masking
solution: if msg is not shared or constant, mask the message in place
2020-02-06 09:34:22 +02:00
Luca Boccassi
38b6888c3e Problem: libzmq does not advertise ZMTP 3.1
Solution: bump minor version number in the engine as all 3.1 features
are now implemented
2020-02-05 17:03:39 +00:00
Luca Boccassi
253e9dd27b Problem: libzmq does not send ZMTP 3.1 sub/cancel commands
Solution: if all peers of a socket are >= 3.1 use sub/cancel commands
instead of the old 0/1 messages.
For backward compatibility, move the handling of 0/1 or sub/cancel
command strings to the encoders, so that the right thing can be done
depending on the protocol version.
Do not set the command flag until the encoder, so that we can handle
the inproc case (which skips the encoder).
2020-02-05 17:03:39 +00:00
Cameron Smith
49ecde8d80 support compiling with IBM XL 16.1 w/ clang front end 2020-02-05 11:00:34 -05:00
Simon Giesecke
495fb00b7e Problem: pointee types are unnecessarily non-const
Solution: add const where possible
2020-02-04 18:34:19 +01:00
Simon Giesecke
db8f4fba21 Problem: redundant inline/ZMQ_FINAL declarations
Solution: remove them
2020-02-04 18:34:13 +01:00
Simon Giesecke
dfcca75d0b Problem: curve_encoding_t build fails with old libsodium versions
Solution: add version check and fall back to old implementation for old versions
2020-02-04 10:04:40 +01:00
Simon Giesecke
4177bf7445 Problem: curve_encoding_t involves unnecesary heap allocations and copying of message data
Solution: use crypto_box_easy_afternm and crypto_box_open_easy_afternm
in-place
2020-02-03 22:33:15 +01:00
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