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

6494 Commits

Author SHA1 Message Date
Constantin Rack
494c2a71f8
Merge pull request #2970 from bluca/format
Problem: CI check for format fails
2018-03-06 00:18:17 +01:00
Luca Boccassi
c36d8cb8e4 Problem: PR template does not mention clang-format
Solution: add paragraph explaining how to run it to make sure code is
correctly formatted.
2018-03-05 22:47:40 +00:00
Luca Boccassi
541ca30d8e Problem: make clang-format still shows error in the CI
Solution: run make clang-format-diff and commit the changes.
2018-03-05 22:41:11 +00:00
Luca Boccassi
4ea1e78d9d
Merge pull request #2969 from skaes/master
Problem: enormous memory increase due to zero copy decoding
2018-03-05 17:40:33 +00:00
Stefan Kaes
fcbd2a5710 Problem: enormous memory increase due to zero copy decoding
The zero copy decoding strategy implemented for 4.2.0 can lead to a large
increase of main memory usage in some cases (I have seen one program go up to
40G from 10G after upgrading from 4.1.4). This commit adds a new option to
contexts, called ZMQ_ZERO_COPY_RECV, which allows one to switch to the old
decoding strategy.
2018-03-05 18:13:28 +01:00
Ryan Hileman
3658b2b580 Problem: pthread condvar timeouts are broken (#2967)
* fix pthread condvar timeouts

This fixes a race condition / hang for threadsafe sockets.
Context: https://github.com/zeromq/czmq/issues/1873#issuecomment-370279244
2018-03-05 16:36:10 +00:00
Simon Giesecke
8cdfc8b9dd Problem: static initialization order fiasco
Solution: use local statics when available in a thread-safe implementation
2018-03-05 16:30:57 +01:00
Luca Boccassi
d54633add1
Merge pull request #2964 from bluca/fix_mtrie_32bit
Problem: unittest_mtrie fails on 32bit *nix
2018-03-02 19:06:51 +00:00
Luca Boccassi
23025f44c6 Problem: unittest_mtrie fails on 32bit *nix
Solution: correctly dereference pointer in test.
2018-03-02 18:00:17 +00:00
Luca Boccassi
173b54a8c9
Merge pull request #2950 from zeromq/add-unittests-mtrie
Problem: no unit tests for mtrie
2018-03-02 17:41:06 +00:00
Simon Giesecke
9cd01bb54f Problem: inconsistent return values from mtrie_t::rm
Solution: Return an enum from rm instead of a bool, and adapt existing uses
2018-03-02 13:42:50 +01:00
Simon Giesecke
36cdcc6c1a Problem: docs of mtrie referring to subscriptions and pipes
Solution: generalized terms to entries/values
2018-03-02 13:42:47 +01:00
Simon Giesecke
e34e03d1a6 Problem: missing test case for addition of duplicate entry
Solution: added test case
2018-03-02 13:42:46 +01:00
Luca Boccassi
d57422819a Problem: documentation for ZMQ_XPUB_VERBOSE(R) is unclear
Solultion: clarify that notifications for unique subs/unsubs are always
passed, and these option only affect the behaviour for duplicated ones.
2018-03-02 13:42:45 +01:00
Luca Boccassi
354491ddf2 Problem: no test for ZMQ_XPUB_VERBOSE(R)
Solution: add test_xpub_verbose to cover those APIs
2018-03-02 13:42:44 +01:00
Simon Giesecke
5d5def40b5 Problem: casts required due to void* arguments in a C++ class
Solution: introduce a type template argument
2018-03-02 13:42:42 +01:00
Simon Giesecke
15b4f596a8 Problem: insufficient unit tests for mtrie
Solution: added further test cases
2018-03-02 13:42:41 +01:00
Simon Giesecke
5fb0e97ab7 Problem: semantic issues
Solution: added some TODO comments, improved existing documentation
2018-03-02 13:42:31 +01:00
Simon Giesecke
8bb055ece8 Problem: insufficient unit tests for mtrie
Solution: added test case, reduced code duplication in tests
2018-03-02 13:40:53 +01:00
Simon Giesecke
0e34d13063 Problem: insufficient unit tests for mtrie
Solution: added unit test and assertions
2018-03-02 13:40:50 +01:00
Simon Giesecke
506f0e5c44 Problem: insufficient unit tests for mtrie
Solution: add test case
2018-03-02 13:40:49 +01:00
Simon Giesecke
56d806a9ef Problem: infufficient unit tests for mtrie
Solution: added some test cases for rm
2018-03-02 13:40:48 +01:00
Simon Giesecke
b42a59a839 Problem: insufficient unit tests for mtrie
Solution: added test case
2018-03-02 13:40:46 +01:00
Simon Giesecke
96fb17cb55 Problem: unittests not recognized by code coverage measurement
Solution: add CODE_COVERAGE_*FLAGS to unit tests build

Fixes #2949
2018-03-02 13:40:45 +01:00
Simon Giesecke
dbbc10e05b Problem: incomplete test coverage of mtrie
Solution: add some more test cases
2018-03-02 13:32:51 +01:00
Simon Giesecke
a9712c0bf2 Problem: no unittests for mtrie
Solution: made mtrie generic (to remove complex dependency on pipe_t),
and added some unit tests
2018-03-02 13:32:51 +01:00
Simon Giesecke
9fc3692e3f Problem: read-only arguments of mtrie are not declared as const
Solution: add const, introduce typedef
2018-03-02 13:32:50 +01:00
Luca Boccassi
31387f84e4
Merge pull request #2960 from Romain-Geissler-1A/fix-gcc-8-build
Fix gcc 8 build warning/error with -O3.
2018-02-27 11:00:49 +00:00
Romain Geissler
1e03f7b2d4 Fix gcc 8 build warning/error with -O3. 2018-02-27 10:12:22 +01:00
Luca Boccassi
b575b05d2c
Merge pull request #2951 from eponsko/master
Problem: No support for addressing using TIPC Port Identity
2018-02-19 17:24:24 +00:00
Pontus Sköldström
78aa9b1983 Support addressing TIPC Port Identity
ZeroMQ currently supports location independent addressing using TIPC
Port Names with tipc://{type,instance}. This commits adds support for
connecting and binding using TIPC Port Identity addresses. To connect
using Port Identities the expected format is tipc://<Z.C.N:Ref>, e.g.
"tipc://<1.2.3:123123>". To bind using TIPC Port Identities the expected
format is "tipc://<*>".
2018-02-19 17:34:40 +01:00
Luca Boccassi
4c7c9b87bf
Merge pull request #2947 from sigiesec/fix-unittest-poller-race
Problem: race condition in unittest_poller
2018-02-14 18:19:44 +00:00
Luca Boccassi
2700c15d67
Merge pull request #2946 from hartcw/master
Minor fixes for windows cmake build
2018-02-14 15:10:56 +00:00
Francis Hart
ef7cb96782 Fix cmake install error when BUILD_SHARED is off
This fixes an error with the cmake install configuration, which
attempted an invalid copy of a .pdb file on windows, when the
BUILD_SHARED option is disabled.
2018-02-14 15:22:54 +02:00
Francis Hart
d470475272 Add cmake build option for disabling tests
This adds a new cmake build option called BUILD_TESTS, that can be used
to enable/disable building of the tests. This is enabled by default.
2018-02-14 15:22:54 +02:00
Francis Hart
dee0213108 Ensure correct cmake target suffix for all builds
This updates the cmake set_target_properperties usage, so that the suffix
is specified for the MinSizeRel build type.
2018-02-14 15:22:54 +02:00
Simon Giesecke
5224b8704a Problem: race condition in unit test
Solution: fix order of statements in test_events_t
2018-02-13 22:27:15 -05:00
Luca Boccassi
487c275809
Merge pull request #2945 from kachanovskiy/master
Fix build break when SIO_LOOPBACK_FAST_PATH is not defined (i.e. in VS2010)
2018-02-13 22:29:38 +00:00
Kachanovskiy
e10464e45e Fix for build break when SIO_LOOPBACK_FAST_PATH is not defined (i.e. in VS2010) 2018-02-13 23:04:08 +01:00
Luca Boccassi
bc467f0631
Merge pull request #2944 from sigiesec/unity
Problem: insufficient unit tests for poller concept and ypipe
2018-02-13 19:05:51 +00:00
Simon Giesecke
94743fd21f Problem: wrong formatting in several files
Solution: apply clang-format
2018-02-13 18:40:43 +01:00
Simon Giesecke
90c6d993be Problem: kqueue_t fails unittest_poller
Solution: fix shutdown of kqueue_t
2018-02-13 18:38:30 +01:00
Simon Giesecke
3b90ad8c63 Problem: support of std::atomic is incomplete in VS <2015
Solution: use std::atomic only from VS 2015
2018-02-13 18:38:29 +01:00
Simon Giesecke
9aa957b445 Problem: appveyor builds fails if they are not the most recent commit
Solution: use shallow_clone option instead of clone_depth
2018-02-13 18:38:28 +01:00
Simon Giesecke
815c7db06b Problem: poll build runs as last appveyor build
Solution: change order of appveyor build jobs to enable faster feedback
on more diverse builds
2018-02-13 18:38:27 +01:00
Simon Giesecke
0458b85dec Problem: Some tests timeout on appveyor for POLLER=poll
Solution: Increase test timeouts for poll poller under Windows
2018-02-13 18:38:26 +01:00
Simon Giesecke
96131b5b4e Problem: no documentation of the poller concept
Solution: added documentation
2018-02-13 18:38:25 +01:00
Simon Giesecke
fafea72b92 Problem: header files not included in VS project files
Solution: add to list of sources
2018-02-13 18:38:24 +01:00
Simon Giesecke
a8e9032dc5 Problem: unreachable code in io_thread_t::process_stop
Solution: replaced by assertion
2018-02-13 18:38:24 +01:00
Simon Giesecke
922053237f Problem: test_sockopt_hwm not using unity
Solution: migrate test_sockopt_hwm to unity
2018-02-13 18:38:23 +01:00
Simon Giesecke
a5738529e8 Problem: wsa_assert does not include error code
Solution: extend output of wsa_assert
2018-02-13 18:38:22 +01:00
Simon Giesecke
e8e24030ea Problem: network initialization and shutdown functions not available for
reuse

Solution: extract into functions defined in ip.hpp

Problem: signaler_t::make_fdpair not reusable

Solution: move make_fdpair to ip.hpp

Problem: epoll worker with no fds cannot be stopped

Solution: use interruptible epoll_pwait call

Problem: insufficient unit tests for poller

Solution: add test cases
2018-02-13 18:38:17 +01:00
Simon Giesecke
ecb3b503c3 Problem: no output of details on test failure
Solution: set CTEST_OUTPUT_ON_FAILURE option
2018-02-12 17:17:32 +01:00
Luca Boccassi
e57afec80e
Merge pull request #2943 from sigiesec/fix-select-unix
Problem: data races in select/poll poller implementations
2018-02-12 16:09:08 +00:00
Simon Giesecke
c62574ffca Problem: segfault in select_t::trigger_events
Solution: fixed access to stale vector
2018-02-12 14:42:46 +01:00
Simon Giesecke
11a5388637 Problem: data race w.r.t. select_t::stopping
Solution: change termination condition of select_t
2018-02-12 14:42:33 +01:00
Simon Giesecke
e650240580 Problem: data race w.r.t. poll_t::stopping
Solution: remove stopping, stop on thread-safe conditions; add
additional checks for correct thread-safe usage
2018-02-12 14:41:53 +01:00
Simon Giesecke
08201bc1b9 Problem: select blocks forever under Unix
Solution: fixed call of select, and initialization of poll_t members
2018-02-12 14:39:02 +01:00
Luca Boccassi
a30133d8f5
Merge pull request #2935 from ZMQers/unity-base
Problem: no test framework, no unit tests
2018-02-12 11:01:08 +00:00
Luca Boccassi
d0e01b4bb2 Problem: regression with "select" on *nix (#2940)
* Problem: build failure with select as polling mechanism

Solution: cast mailbox_handle argument to (poller_t::handle_t) like in
the reaper thread class.

* Problem: build failure due to INT_MAX use without include

Solution: include limits and climits in src/select.cpp where INT_MAX is
used

* Problem: build failure due to unused variable in select.cpp

Solution: move the declaration of int rc inside the ifdef block where
it is actually used

* Problem: reference to wrong variable in select.cpp breaks build

Solution: fix it

* Problem: family_entry_t constructor has no body, build fails on *nix

Solution: add empty inline function in the struct

* Problem: no test coverage for poll and select

Solution: add Travis jobs for them on Linux

* Problem: Travis jobs cannot run in container infra

Solution: set sudo: false as it is not required anymore
2018-02-12 03:01:03 -05:00
Simon Giesecke
9ec95f9d46 Problem: build failure with VS <2015, has no snprintf
Solution: use _snprintf when snprintf is not available
2018-02-11 17:33:13 +00:00
Luca Boccassi
29e304ea5c Problem: unity license not mentioned in debian/copyright
Solution: add it
2018-02-11 17:33:13 +00:00
Luca Boccassi
1478fd0022 Problem: unittests not built with autotools
Solution: add them to Makefile.am, linking to the static libzmq.a
library and its dependencies
2018-02-11 17:33:13 +00:00
Luca Boccassi
f6f67cbf96 Problem: no autotools support for building with unity
Solution: add a noinst convenience static library and use it with the
tests that require it
2018-02-11 17:25:36 +00:00
Simon Giesecke
7ea924c763 Problem: segfault on thread_t::stop if thread was never started
Solution: add started flag
2018-02-11 17:25:36 +00:00
Simon Giesecke
56c726d425 Problem: no unit tests
Solution: set up initial unit tests
2018-02-11 17:25:36 +00:00
Simon Giesecke
f87d3ab294 Problem: pollers unnecessarily depend on whole ctx_t, but actually use only start_thread method
Solution: extract thread_ctx_t from ctx_t
2018-02-11 17:25:36 +00:00
sigiesec
687f6a694f Problem: license and source information missing
Solution: added MIT license file and github source info
2018-02-11 17:25:36 +00:00
sigiesec
5f854a31b7 Problem: test_security_curve not using test framework
Solution: use unity in test_security_curve
2018-02-11 17:25:36 +00:00
sigiesec
21879abb5b Problem: test_socket_null not using test framework
Solution: rewrite test_socket_null to use unity
2018-02-11 17:25:36 +00:00
sigiesec
61a28a26cc Problem: no test framework
Solution: add unity test framework, and integrate into cmake build
2018-02-11 17:25:36 +00:00
Luca Boccassi
afd5d9f721
Merge pull request #2939 from sigiesec/fix-poll-timer-event-retiring
Fixed a deadlock and an assertion failure in poll_t
2018-02-11 17:06:36 +00:00
Simon Giesecke
5873894c83 Problem: wrong assertion macro used on Windows
Solution: use wsa_assert instead of errno_assert
2018-02-11 13:52:41 +01:00
Simon Giesecke
2f27bcd74b Problem: assertion failure in poll_t::poll if timer_event retired a
pollset entry

Solution: clean up retired entries before poll
2018-02-11 13:49:26 +01:00
Simon Giesecke
a2af3d18cc Problem: unittest_poller fails for poll_t
Solution: fixed behaviour in corner cases
2018-02-11 13:49:25 +01:00
Simon Giesecke
ac777bad94
Merge pull request #2938 from bluca/format_autotools
Problem: make format-check not implemented with autotools
2018-02-10 15:26:53 -05:00
Simon Giesecke
504e6d0ecc
Merge pull request #2937 from bluca/gcc_4_build
Problem: DRAFT build broken with GCC 4.7
2018-02-10 15:25:54 -05:00
Luca Boccassi
d832267e23 Problem: make format-check not implemented with autotools
Solution: port implementation from zproject
2018-02-10 17:35:12 +00:00
Luca Boccassi
9b1ce59719 Problem: DRAFT build broken with GCC 4.7
Solution: change variable type in test_timers to match public API
2018-02-10 17:08:01 +00:00
Luca Boccassi
c33cb38af2
Merge pull request #2928 from eponsko/master
Add support for ZMQ_XPUB_NODROP on ZMQ_RADIO sockets
2018-02-09 17:15:47 +00:00
Luca Boccassi
eded1f8b90
Merge pull request #2923 from sigiesec/fastpath
Add support for SIO_LOOPBACK_FAST_PATH on Windows
2018-02-09 17:08:51 +00:00
Pontus Sköldström
a57f7e3824 Add support for ZMQ_XPUB_NODROP on ZMQ_RADIO sockets
Solves issue #2927
2018-02-09 16:20:50 +01:00
Simon Giesecke
a5e763039d Problem: use of TCP loopback fastpath not available for user sockets
Solution: add socket option
2018-02-09 14:22:42 +01:00
sigiesec
490d76da2f Problem: SIO_LOOPBACK_FAST_PATH not activated for signaler socket pair
Solution: activate SIO_LOOPBACK_FAST_PATH if available

See #2899
2018-02-09 13:50:40 +01:00
Luca Boccassi
9544dade49
Merge pull request #2926 from sigiesec/fix-issue-2925
Problem: assertion failure in poller_base.cpp:42
2018-02-09 09:49:17 +00:00
sigiesec
50d80d0835 Problem: test_timeo frequently fails on travis, probably because of slow
execution

Solution: relax test assertion to what can be guaranteed
2018-02-09 09:56:38 +01:00
sigiesec
88d8c768d1 Problem: test_timers frequently fails on travis-ci
Solution: relaxed test assertions, based on the actual time passed,
instead of assuming that this equals to the time slept
2018-02-09 09:55:40 +01:00
Simon Giesecke
3baefc66ea Problem: incomplete assertions around modifications of fd_entries vs.
load

Solution: add assertions, partially in debug build only, improved naming
2018-02-09 09:53:02 +01:00
Simon Giesecke
a1d55d0506 Problem: race conditions for options.linger (#2910)
* Problem: race conditions for options.linger

Solution: make options.linger atomic
2018-02-08 22:10:45 +00:00
Simon Giesecke
de0c669323 Problem: std::atomic not used on Visual C++ although it is available (#2930)
* Problem: std::atomic not used on Visual C++ although it is available

Solution: change conditional compilation to recognize _MSC_VER
2018-02-08 22:01:02 +00:00
Luca Boccassi
52d64e1d5d
Merge pull request #2929 from sigiesec/add-windows-poll-build
Add windows poll build on Appveyor
2018-02-08 22:00:30 +00:00
Luca Boccassi
cdfc6bb8b3
Merge pull request #2924 from sigiesec/tcp-cleanup
Problem: duplicated code, redundant member handle_valid, asymmetry between tcp_connecter and tcp_listener
2018-02-08 21:57:46 +00:00
Luca Boccassi
9fbd125b41
Merge pull request #2917 from ZMQers/thread-safe-simplification
Problem: code duplication and unnecessary nesting around ZMQ_THREAD_SAFE querying
2018-02-08 21:57:06 +00:00
sigiesec
147fe9ed77 Problem: code duplication and unnecessary nesting around ZMQ_THREAD_SAFE
querying

Solution: remove code duplication and rearrange conditions
2018-02-08 22:54:30 +01:00
Luca Boccassi
cb9ccfa154
Merge pull request #2921 from sigiesec/mechanism-cleanup
Problem: code style issues in mechanism_t and socket_base_t
2018-02-08 21:53:14 +00:00
Luca Boccassi
2e849a4d60
Merge pull request #2913 from ZMQers/add-const
Problem: several fields are non-const without need
2018-02-08 21:47:21 +00:00
Luca Boccassi
9872daa293
Merge pull request #2912 from ZMQers/socket-base-signaler-unreachable-code
Problem: unreachable code around socket_base_t::add/remove_signaler
2018-02-08 21:46:02 +00:00
Luca Boccassi
3491fd0421
Merge pull request #2932 from sigiesec/reapply-2920
fix Windows Intel compiler build failure
2018-02-08 21:44:07 +00:00
Tetsuya Hayashi
fdcb4520ca fix Windows Intel compiler build failure 2018-02-08 22:41:43 +01:00
Simon Giesecke
0b509c3d5b Problem: no CI build on Windows with POLLER=poll
Solution: add appveyor job
2018-02-08 22:20:13 +01:00