0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-13 17:27:57 +08:00

8526 Commits

Author SHA1 Message Date
Axel Rietschin
a6039d8716 Add forgotten test_pubsub. Currently only tests NORM if built. 2023-10-24 10:47:19 +01:00
Yueshan
95caddb9a1 Update msg.cpp
allow the max_vsm_size of data can init as vsm type msg

the init message of vsm size should be <= max_vsm_size include equal size.
2023-10-22 11:47:21 +01:00
Luca Boccassi
b30a19ebde
Merge pull request #4602 from nnog/flaky-test
test_proxy_steerable: reduce cpu and thread count
2023-10-13 15:21:28 +01:00
George Cockshull
77303a1926 test_proxy_steerable: reduce cpu and thread count
Problem: flakiness on slow CI VMs

Solution: fewer worker threads, poll rather than thrash,
consistent timings. user cpu ~300% -> 15%.
2023-10-13 08:19:38 -04:00
Luca Boccassi
6b80df14f4
Merge pull request #4600 from nnog/fix-proxy-steerable
Fix zmq_proxy_steerable
2023-10-12 21:53:48 +01:00
George Cockshull
058ad60b9a zmq_proxy_steerable: support non-REP socket types
Problem: reimplemented zmq_proxy_steerable control socket type is not
backwards compatible - replies are always sent.

In the past, zmq_proxy_steerable never sent a reply for
commands that weren't STATISTICS, so only really worked with PAIR and didn't
work at all with REP. Now it only supports REP and PAIR semantics changed. This
breaks compatibility with PAIR in a subtle and slightly annoying way if
HWMs are hit without reading the replies.

Solution: Add a check to send the empty reply only for
REP control sockets. This restores backwards compatibility, and supports
REP, PAIR, and SUB (for non-reply commands).

I had no knowledge of the pre-MPL-2.0 implementation. This fix is based
on docs and prior API usage. I contribute this under MPL-2.0.
2023-10-12 15:22:44 -04:00
George Cockshull
f8b3cc8108 Fix zmq_proxy_steerable PAUSE/RESUME
Problem: the new reimplementation of zmq_proxy_steerable had PAUSE/RESUME
that didn't follow expected behaviour. Possibly mixed up. Test didn't properly
cover the issue.

Solution: improve test coverage, fix the proxy command parsing.

I had no knowledge of the pre-MPL-2.0 implementation. This fix is based
on documented semantics and prior API usage. I contribute this
under MPL-2.0.
2023-10-12 15:22:44 -04:00
James Harvey
9d31965548
Handle tcp self connection issues (#4599) 2023-10-10 14:46:48 +01:00
Luca Boccassi
dbb7e3dc01 Problem: 4.3.5 is out, need new version
Solution: bump to 4.3.6
2023-10-09 12:21:03 +01:00
Luca Boccassi
622fc6dde9 Update NEWS for 4.3.5 v4.3.5 2023-10-09 11:47:05 +01:00
Luca Boccassi
5cf39bf0ce
Merge pull request #4598 from brettviren/reimplement-proxy-steerable
A clean room re-implementation of zmq_proxy_steerable()
2023-10-09 10:36:47 +01:00
Brett Viren
5712ad5138 A clean-room implementation of zmq_proxy_steerable().
It is contriubted under the MPL-2.0.

I had no knowledge of the previous implementation of zmq_proxy_steerable().

This version was developed based on expectations set in the old man page with one exception.  This version uses a REP/REQ for the proxy control protocol sockets.  The old man page example used PUB/SUB which is nonsensical given the STATISTICS command requires two way communication.
2023-10-08 19:56:03 -04:00
Nehal Patel
8cdc4ed71a
Problem: unused variables warnings
Solution: fix them
2023-10-04 09:51:43 +01:00
Hennadii Stepanov
de5ee18203 Replace egrep with grep -E
For the GNU Grep package version >= 3.8, the `egrep` command emits:
```
egrep: warning: egrep is obsolescent; using grep -E
```
which makes the `./autogen.sh` script very noisy.
2023-08-26 22:19:35 +01:00
Jeffery Weston
ec013f3a17 fix assert error on late-joining subscriber after publisher has filled NORM buffer 2023-07-21 19:46:44 +01:00
Cornelius
ecc63d0d3b
Problem: long flag isn't set for subscriptions if topic has between 246 and 255 characters (#4564)
* Problem: long flag isn't set for subscriptions if topic has between 246 and 255 characters

Solution: fix V3.1 encoder to calculate long flag after evaluating the subscribe and cancel commands
2023-06-20 15:17:26 +01:00
Luca Boccassi
7af09a0e3b obs: trigger build on merge 2023-06-18 15:40:05 +01:00
Luca Boccassi
61fd887d11 spec: do not attempt to install curve_keygen if curve is disabled 2023-06-18 13:06:57 +01:00
Luca Boccassi
7fef478481 spec: remove duplicated macros 2023-06-18 12:51:43 +01:00
Guillaume DELACOURT
5657b4586f Always allow DNS when resolving TCP and UDP adresses. DNS resolution is done after interface resolution, so it can always be enabled to have a fallback mecanism on hostname resolution. 2023-06-12 20:28:32 +01:00
Guillaume DELACOURT
e0296d9cdd Checks for pthread setname and setaffinity API are compilation checks, not execution checks. 2023-06-12 00:12:26 +01:00
Guillaume DELACOURT
797c7f09f8 When setting thread priority, always set the value to zero when the policy is not compatible. Also, only call nice when the priority is set to a strictly positive value. 2023-06-12 00:11:21 +01:00
Luca Boccassi
5bf04ee2ff Problem: docs for ZMQ_RECONNECT_IVL_MAX are stubs
Solution: write them now that the option is back
2023-06-06 18:09:12 +01:00
Luca Boccassi
346907065f Problem: trailing whitespace
Solution: remove it
2023-06-06 18:00:08 +01:00
Luca Boccassi
7175f0acb5
Merge pull request #4556 from stvales/master
Problem: relicensing forced to remove support for ZMQ_RECONNECT_IVL_MAX option
2023-06-06 16:40:57 +01:00
Stéphane Valès
de1bd5c8e7 Problem: relicensing forced to remove support for ZMQ_RECONNECT_IVL_MAX option
Solution: reimplement support for ZMQ_RECONNECT_IVL_MAX without knowledge of the previous code.
2023-06-06 15:15:22 +02:00
Luca Boccassi
1a921db728
Merge pull request #4555 from bluca/relicense
Relicense from LGPL3 + exceptions to Mozilla Public License version 2.0
2023-06-06 13:50:00 +01:00
Luca Boccassi
3e5e405f33 Remove RELICENSE/ directory
Grants archived at:

https://github.com/rlenferink/libzmq-relicense/blob/master/RELICENSE

No longer necessary to keep them here, as the relicensing is complete.
2023-06-05 20:31:47 +01:00
Luca Boccassi
da31917f4f Relicense from LGPL3 + exceptions to Mozilla Public License version 2.0
Relicense permission collected from all relevant authors as tallied at:
https://github.com/rlenferink/libzmq-relicense/blob/master/checklist.md
The relicense grants are collected under RELICENSE/ and will be moved
to the above repository in a later commit.

Fixes https://github.com/zeromq/libzmq/issues/2376
2023-06-05 20:31:47 +01:00
Luca Boccassi
87bb4db114
Merge pull request #4554 from bluca/relicense
Problem: cannot relicense due to missing agreement from 3 authors
2023-06-05 20:00:28 +01:00
Luca Boccassi
7bbd49726b Problem: no permission to relicense ZMQ_RECONNECT_IVL_MAX
Solution: remove the implementation. Thijs Terlouw <thijsterlouw@gmail.com>,
the author, did not respond to requests to allow relicensing to MPL2,
so we have to remove his copyrighted work.
Remove the implementation and make get/set return -EOPNOTSUPP.
2023-06-05 00:22:20 +01:00
Luca Boccassi
ff47aeb791 Problem: no permission to relicense tweetnacl integration
Solution: remove implementation. Frank Hartmann <soundart@gmx.net>,
the author, rejected our request to relicense under MPL2, so we
have to remove his copyrighted work.
Tweetnacl is not security-supported and could not be used in
production environments anyway, the supported backend is libsodium.
2023-06-04 23:54:31 +01:00
Luca Boccassi
13bc1de421 Problem: no permission to relicense zmq_proxy_steerable
Solution: remove implementation. Laurent Alebarde <l.alebarde@free.fr>,
the author, did not respond to requests to allow relicensing to MPL2,
so we have to remove his copyrighted work.
Make the API into an empty stub that returns -EOPNOTSUPP.
2023-06-04 23:54:31 +01:00
Jeff Weston
eaaea73bf1
Change NORM to set TTL using MULTICAST_HOPS sockopt (#4552)
* Change NORM to set TTL using MULTICAST_HOPS instead of hard-coding.  Changes default TTL from 255 to 1.
2023-05-19 20:53:20 +01:00
Nicolas Benes
4d1dccaebd Fix pkg_config_defines in CMakeFile
PR #4545 sets `pkg_config_defines` too late, i.e. after the pkg-config
file is already generated. It must be set before `configure_file`.
2023-05-16 17:47:51 +01:00
Luca Boccassi
cc12997a17
Merge pull request #4545 from panicgh/pc-file-fix
Add missing pkg_config_defines when built with CMake
2023-05-12 10:16:57 +01:00
Nicolas Benes
2da2bd8f6d RELICENSE: add statement
Signed-off-by: Nicolas Benes <nbenes.gh@xandea.de>
2023-05-12 06:29:44 +02:00
Luca Boccassi
077dd92616
Merge pull request #4546 from cdepillabout/link-openpgm-cmake-fresh
Link to openpgm when building with cmake
2023-05-11 13:59:13 +01:00
Dennis Gosnell
a6c2f6ba72 Problem: no relicense agreement by cdepillabout
Solution: added relicense agreement
2023-05-11 20:22:42 +09:00
Dennis Gosnell
5381be6c71 Problem: don't link to openpgm when building with cmake
Solution: Add `target_link_libraries()` to `libzmq` for openpgm when
openpgm has been enabled.
2023-05-11 20:22:42 +09:00
Nicolas Benes
c079ca5cc4 Add missing pkg_config_defines when built with CMake
The pkg_config_defines variable was only set in configure.ac, but not in
CMake. This lead to the `-DZMQ_BUILD_DRAFT_API=1` flag to be omitted
from the generated pkg-config file.

Signed-off-by: Nicolas Benes <nbenes.gh@xandea.de>
2023-05-09 23:15:46 +02:00
Luca Boccassi
532b61275e
Merge pull request #4542 from bjornstromberg/libzmq-patch-pr-4432
Problem: merged pr-4432 broke FindSodium on linux
2023-04-22 11:59:25 +01:00
Björn Strömberg
f56a44d35d
Problem: no relicense agreement by bjornstromberg
Solution: added relicense agreement
2023-04-22 09:13:22 +02:00
bjornstromberg
47b2aec813
Problem: merged pr-4432 broke FindSodium on linux
Solution: rename the FindSodium to Findsodium so it matches what the build script actually looks for. tested on ubuntu-20.04lts with cmake 3.16.
2023-04-22 08:58:55 +02:00
Jeff Weston
2d30020691
Add NORM Transport configuration sockopts (#4541)
* added NORM transport configuration socket options, and enabled NORM use of existing sockopts ZMQ_RATE for NORM fixed-rate operation, and ZMQ_TOS
2023-04-20 18:55:40 +01:00
Luca Boccassi
be8af6f128
Merge pull request #4540 from keith-dev/master
Support clang-16 on Termux
2023-04-19 11:57:08 +01:00
Keith Williams
bf3d37b7d0 Add RELICENSE for Keith Williams 2023-04-19 01:16:05 +01:00
Keith Williams
abf2444f09 remove c99 extention from c++11 code 2023-04-18 22:27:06 +01:00
Keith Williams
27dda213fe extend tipc check to support Android under Termux 2023-04-18 22:25:00 +01:00
Constantin Rack
5a5f90e07e
Merge pull request #4537 from chachoi/master
Add support for QNX 7.1 build
2023-04-11 22:22:54 +02:00
James Choi
c19d4c9bf0 Add RELICENSE for James Choi
Signed-off-by: James Choi <chachoi@blackberry.com>
2023-04-11 15:48:27 -04:00
James Choi
10e5847fa8 Add support for QNX 7.1 build
Signed-off-by: James Choi <chachoi@blackberry.com>
2023-04-11 15:48:07 -04:00
Luca Boccassi
1b52e19b2b
Merge pull request #4533 from autoantwort/gnutls-include-dir
Don't assume that GnuTLS is on the search path
2023-03-27 22:34:39 +01:00
Leander Schulten
08a6f8f84d license 2023-03-27 17:47:30 +02:00
Leander Schulten
f508394909 Don't assume that GnuTLS is on the search path 2023-03-27 16:06:23 +02:00
Luca Boccassi
94bf58e43c
Merge pull request #4522 from stephanlachnit/p-cmake-fix-devpoll
CMake: fix devpoll detection not working properly
2023-03-05 17:49:19 +00:00
Luca Boccassi
3f5d915b56
Merge pull request #4523 from stephanlachnit/p-fix-cmake-pgm-vmci
CMake: properly set ZMQ_HAVE_OPENPGM and ZMQ_HAVE_VMCI
2023-03-05 17:49:02 +00:00
Luca Boccassi
e6130935c7
Merge pull request #4521 from stephanlachnit/p-fix-pollset
CMake: fix not defining pollset in platform.hpp
2023-03-05 17:48:31 +00:00
Stephan Lachnit
6147de01da
RELICENSE: add statement
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2023-03-05 13:32:42 +01:00
Stephan Lachnit
87065068ca
CMake: properly set ZMQ_HAVE_OPENPGM and ZMQ_HAVE_VMCI
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2023-03-03 11:11:41 +01:00
Stephan Lachnit
6fc2a61d16
CMake: fix devpoll detection not working properly
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2023-03-03 11:01:47 +01:00
Stephan Lachnit
08d60dfdfa
CMake: fix not defining pollset in platform.hpp
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2023-03-03 10:56:26 +01:00
Luca Boccassi
8c725093ac
Merge pull request #4509 from sphaero/udploop
Problem: infinite loop binding a dgram socket if it fails
2023-02-06 15:23:35 +00:00
Arnaud Loonstra
b261f9a678 treat bind errors as a protocol_error instead of connection_error preventing an infinite loop of trying to create the udp socket as through the protocol_error the creation of the socket fails 2023-02-03 16:33:18 +01:00
Luca Boccassi
6e2d632b18
Merge pull request #4502 from casaroli/fix-for-nuttx
Fixes for memory allocation and zero size
2023-02-03 09:16:26 +00:00
Marco Casaroli
52333da0e2 Add RELICENSE for Marco Casaroli 2023-02-03 09:35:35 +01:00
Marco Casaroli
d16db180d3 Do not break if malloc size is zero
I get a scenario where `size_` is `0` so there is nothing to `malloc()`.

According to `malloc(3)`:

If size is 0, then malloc() returns either NULL, or a unique pointer value thatcan later be
success‐fully passed to free().

According to `free(3)`:

If ptr is NULL, no operation is performed.

So, if `size_` is null and `_data` also, there is no OOM error.

We can adjust the assert to not fail on this scenario.
2023-02-03 09:35:35 +01:00
Luca Boccassi
a666cb1b40
Merge pull request #4507 from daira/zmq_snprintf
#4494 added calls to snprintf, but did not take into account that snprintf can truncate
2023-02-01 21:44:27 +00:00
Daira Hopwood
6dc559c072 #4494 added calls to snprintf, but did not take into account that snprintf
can truncate, and then return the number of characters that would have been
written without truncation.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2023-02-01 19:15:46 +00:00
Luca Boccassi
333c88e9ff
Merge pull request #4505 from barracuda156/darwin
tests: use NOT APPLE instead of NOT MATCHES Clang
2023-02-01 00:30:26 +00:00
Sergey Fedorov
2438952f75 Add relicense statement 2023-02-01 08:02:53 +08:00
Sergey Fedorov
74af53fdfa tests: use NOT APPLE instead of NOT MATCHES Clang 2023-02-01 05:37:59 +08:00
Marco Casaroli
f049edbf12 Use parenthesis for alloc_assert macro 2023-01-31 14:46:46 +01:00
Luca Boccassi
ce6d48c578
Merge pull request #4500 from bluca/ci
CI fixes
2023-01-31 10:48:44 +00:00
Luca Boccassi
bd0a34899a Problem: test_filter_ipc is flacky
Solution: expect send failure and use random endpoint
2023-01-31 01:16:24 +00:00
Luca Boccassi
ccdc2f7583 Problem: VMCI tests are not skipped outside VMs
Solution: check CID and skip if unavailable
2023-01-31 00:28:38 +00:00
Luca Boccassi
acfdf67127
Merge pull request #4497 from MartinDelille/badge
Add conan badge
2023-01-27 01:32:42 +00:00
Martin Delille
8850ccc450
Add relicense statement 2023-01-27 02:26:12 +01:00
Martin Delille
75e9a950d9
Add conan badge 2023-01-27 00:29:47 +01:00
Luca Boccassi
abb0ada5f7
Merge pull request #4494 from sphaero/depr_sprintf
deprecate sprint and replace with snprintf
2023-01-24 23:36:00 +00:00
Arnaud Loonstra
f7df6c8599 deprecate sprint and replace with snprintf 2023-01-24 22:45:48 +01:00
Luca Boccassi
b674ce68d0
Merge pull request #4490 from bluca/ci
Problem: various CI issues
2023-01-16 10:28:05 +00:00
Luca Boccassi
a820627f55 Problem: test_zmq_ppoll_signals does not cleanup context
Solution: do it, to avoid false positive in valgrind
2023-01-16 00:52:30 +00:00
Luca Boccassi
7e0fdd82de Problem: test_zmq_ppol_signals uses fixed TCP port
Solution: use random one to avoid random failures
2023-01-16 00:52:30 +00:00
Luca Boccassi
117cbe690c Problem: buffer overflow in new test case
Solution: fix it
2023-01-15 23:44:12 +00:00
Luca Boccassi
ee9c0919e2 Problem: address sanitizer complains about uninitialised func pointer
Solution: just call the function directly
2023-01-15 23:44:00 +00:00
Luca Boccassi
3cafc0c260
Merge pull request #4489 from bluca/ci
Problem: various CI issues
2023-01-12 09:49:59 +00:00
Luca Boccassi
78777fb9f5 Problem: shipping binaries is a responsibility that requires time
Solution: stop shipping binary releases for Windows. These days there's vcspkg, conda and more
that provide pre-built binaries for Windows.
Being a software supplier requires a lot of time and effort, and we have no bandwidth.
2023-01-12 01:07:06 +00:00
Luca Boccassi
961206abd5 Problem: libsodium doesn't build anymore in VS2010
Solution: disable it in appveyor, not our problem to solve
2023-01-12 01:07:06 +00:00
Luca Boccassi
7781dd1bbd Problem: formatting errors with clang-format-11
Solution: apply update
2023-01-12 01:07:06 +00:00
Luca Boccassi
47d0ecf639 Problem: missing VMCI can also return EPROTONOSUPPORT and the tests fail
Solution: ignore that too
2023-01-12 01:07:06 +00:00
Luca Boccassi
634cf9eea7 Problem: windows-2016 build no longer runs in CI
Solution: remove it
2023-01-12 01:07:06 +00:00
Luca Boccassi
3919956535 Problem: build fails with PGM + CXX98 + clang++
Solution: redefine 'restrict' which is used as an attribute in PGM headers,
but that is not available when using clang and CXX98
2023-01-11 23:43:13 +00:00
Luca Boccassi
049f79f72e
Merge pull request #4488 from ilkondr/ilkondr/poll_eintr
Problem: message can't be received due to signal
2023-01-10 18:55:45 +00:00
Ilya Kondrashkin
04720b6b91 Problem: message can't be received due to signal
Issue caught in Golang runtime, which widely uses signal SIGURG for
scheduling. Sometimes messages cannot be received. Technically
socket_base_t::process_commands() returns failure even if some commands were
processed, but next message from mailbox could not be received during interrupt.

Solution: retry receiving from mailbox with zero timeout after EINTR.

Signed-off-by: Ilya Kondrashkin <ikondrashkin@nfware.com>
2023-01-10 16:04:56 +00:00
Luca Boccassi
8d0f6f359e
Merge pull request #4486 from Rabenda/fix/qemu-user-build
fix: fix build on qemu-user
2023-01-09 17:25:29 +00:00
Han Gao
48960c2293 fix: fix build on qemu-user
In qemu-user, CACHELINE_SIZE probe is undefined

Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-01-10 01:12:20 +08:00
Luca Boccassi
bdd471fa17
Merge pull request #4480 from trofi/gcc-13-rebind-fix
src/secure_allocator.hpp: define missing 'rebind' type
2022-12-22 11:51:15 +01:00
Sergei Trofimovich
438d5d8839 src/secure_allocator.hpp: define missing 'rebind' type
`gcc-13` added an assert to standard headers to make sure custom
allocators have intended implementation of rebind type instead
of inherited rebind. gcc change:
    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=64c986b49558a7

Without the fix build fails on this week's `gcc-13` as:

    [ 92%] Building CXX object tests/CMakeFiles/test_security_curve.dir/test_security_curve.cpp.o
    In file included from /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/ext/alloc_traits.h:34,
                     from /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/bits/stl_uninitialized.h:64,
                     from /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/memory:69,
                     from tests/../src/secure_allocator.hpp:42,
                     from tests/../src/curve_client_tools.hpp:49,
                     from tests/test_security_curve.cpp:53:
    /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/bits/alloc_traits.h: In instantiation of 'struct std::__allocator_traits_base::__rebind<zmq::secure_allocator_t<unsigned char>, unsigned char, void>':
    /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/bits/alloc_traits.h:94:11:   required by substitution of 'template<class _Alloc, class _Up> using std::__alloc_rebind = typename std::__allocator_traits_base::__rebind<_Alloc, _Up>::type [with _Alloc = zmq::secure_allocator_t<unsigned char>; _Up = unsigned char]'
    /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/bits/alloc_traits.h:228:8:   required by substitution of 'template<class _Alloc> template<class _Tp> using std::allocator_traits< <template-parameter-1-1> >::rebind_alloc = std::__alloc_rebind<_Alloc, _Tp> [with _Tp = unsigned char; _Alloc = zmq::secure_allocator_t<unsigned char>]'
    /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/ext/alloc_traits.h:126:65:   required from 'struct __gnu_cxx::__alloc_traits<zmq::secure_allocator_t<unsigned char>, unsigned char>::rebind<unsigned char>'
    /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/bits/stl_vector.h:88:21:   required from 'struct std::_Vector_base<unsigned char, zmq::secure_allocator_t<unsigned char> >'
    /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/bits/stl_vector.h:423:11:   required from 'class std::vector<unsigned char, zmq::secure_allocator_t<unsigned char> >'
    tests/../src/curve_client_tools.hpp:64:76:   required from here
    /<<NIX>>/gcc-13.0.0/include/c++/13.0.0/bits/alloc_traits.h:70:31: error: static assertion failed: allocator_traits<A>::rebind_alloc<A::value_type> must be A
       70 |                         _Tp>::value,
          |                               ^~~~~

The change adds trivial `rebind` definition with expected return type
and satisfies conversion requirements.
2022-12-20 23:00:53 +00:00
Luca Boccassi
dfbfc59c3f
Merge pull request #4432 from Teebonne/patch-1
sodium, not Sodium
2022-12-06 14:39:21 +01:00