Commit Graph

125 Commits

Author SHA1 Message Date
hitstergtd
876ee5d6b4 Problem: test_pub_invert_matching missing in autotools build
Solution:
- add it to Makefile.am
2016-04-26 16:29:06 +01:00
Luca Boccassi
5178251587 Problem: test_ipc_wildcard is ran on Windows
Solution: move it to the unix-only section of Makefile.am and
tests/CMakeLists.txt since it uses Unix IPC sockets.
2016-04-21 14:17:10 +01:00
somdoron
e6dae56c6e Scatter-Gather socket types 2016-04-21 14:50:58 +03:00
Frederic Tregon
625b618776 Fixed ZMQ_REQ_CORRELATE (see pull request #1730)
Problem: Since pull request #1730 was merged, protocol for REQ socket is
checked at the session level and this check does not take into account
the possibility of a request_id being part of the message. Thus the option
ZMQ_REQ_CORRELATE would no longer work.
This is now fixed: the possiblity of a 4 bytes integer being present
before the delimiter frame is taken into account (whether or not this
breaks the REQ/REP RFC is another issue).
2016-04-02 18:36:29 +02:00
Luca Boccassi
9d94eb11b3 Problem: test_fork causes valgrind false positive
Solution: do not run test_fork if --enable-valgrind is set. Note that
later versions of Valgrind (3.11) not yet available in all
distributions fix this problem, so we might revert in the future.
2016-03-19 21:54:55 +00:00
Luca Boccassi
00e0957640 Problem: false positive on valgrind 3.10
Solution: update builds/valgrind/valgrind.supp to ignore glibc's
__libc_freeres calls. This code runs after the program exits, and
tries to de-allocate memory allocated internally by glibc, so it has
nothing to do with libzmq code. This suppression is added by default
in newer versions of Valgrind, not yet available on older
distributions.
2016-03-19 21:54:52 +00:00
Luca Boccassi
2b2f9046d4 Problem: no Makefile target for Valgrind
Solution: import ax_valgrind_check.m4 macro file to provide a
conveniente automake hook to run Valgrind on all tests.
Add --enable-valgrind to ./configure call and then run make
check-valgrind to run memcheck, helgrind, drd and sgcheck on all
tests. Run check-valgrind-memcheck to run only memcheck.
2016-03-19 21:54:29 +00:00
Luca Boccassi
15fd419f22 Problem: test_large_msg requires 2GB of free RAM
Solution: remove temporarily until proper message limits have been
implemented, then a more granular test case can be added without
such high requirements which are problematic in embedded environment,
build systems, VMs and CI systems
2016-03-16 21:47:58 +00:00
Luca Boccassi
6df753c55a Problem: no code coverage integration
Solution: import ax_code_coverage.m4 from autoconf-archive and use it
in configure.ac and Makefile.am in order to provide a make
check-code-coverage target behind a --enable-code-coverage configure
flag, that can be used to generate a gcov/lcov code coverage report.
Depends on having gcov and lcov installed.
2016-03-13 19:28:23 +00:00
Luca Boccassi
2d9e7b57f9 Problem: make dist does not tar up macros.hpp
Solution: add it to Makefile.am file list
2016-03-06 17:56:24 +00:00
Min RK
d5b66295d4 Deprecate zmq_utils.h
instead of removing it, which breaks downstream builds.
2016-02-18 10:28:07 +01:00
Luca Boccassi
8bee4e2547 Merge pull request #1799 from hintjens/master
Making gyp builds work
2016-02-12 10:40:43 +00:00
Pieter Hintjens
44c3859073 Problem: minor glitch, test_socketopt_hwm <> test_sockopt_hwm
Doesn't affect building, just potentially confusing.

Solution: fix it.
2016-02-12 11:24:35 +01:00
Constantin Rack
22e830bece Merge pull request #1798 from hintjens/master
Getting gyp build working
2016-02-12 10:07:14 +01:00
Pieter Hintjens
fde81d7e07 Problem: can't build using gyp
I'm adding gyp support so that we can easily pull in libzmq
and other C/C++ projects into gyp packages, especially via
node-gyp.

Solution: add gyp definition

This works only for Windows, OS/X, and Linux. We set a single
macro in project.gyp according to the system, and the rest is
done in builds/gyp/platform.hpp. The values in that file are
not dynamic. Your mileage will vary.
2016-02-11 22:41:01 +01:00
Luca Boccassi
0afac59018 Problem: empty files are against ISO C++
Solution: if not building with tweetnacl, do not include its sources
in Makefile.am. CMake already includes them optionally.
2016-02-11 21:05:10 +00:00
Pieter Hintjens
f8ed793f76 Problem: tweetnacl sources are a mess
- they have no copyright / license statement
- they are in some randomish directory structure
- they are a mix of postable and non-portable files
- they do not conform to conditional compile environment

Overall, it makes it rather more work than needed, in build scripts.

Solution: clean up tweetnacl sauce.

- merged code into single tweetnacl.c and .h
- standard copyright header, DJB to AUTHORS
- moved into src/ along with all other source files
- all system and conditional compilation hidden in these files
- thus, they can be compiled and packaged in all cases
- ZMQ_USE_TWEETNACL is set when we're using built-in tweetnacl
- HAVE_LIBSODIUM is set when we're using external libsodium
2016-02-11 18:06:07 +01:00
Pieter Hintjens
b49a60410a Problem: use of libsodium vs. tweetnacl is confused
It's unclear which we need and in the source code, conditional code
treats tweetnacl as a subclass of libsodium, which is inaccurate.

Solution: redesign the configure/cmake API for this:

* tweetnacl is present by default and cannot be enabled
* libsodium can be enabled using --with-libsodium, which replaces
  the built-in tweetnacl
* CURVE encryption can be disabled entirely using --enable-curve=no

The macros we define in platform.hpp are:

    ZMQ_HAVE_CURVE    1        //  When CURVE is enabled
    HAVE_LIBSODIUM    1        //  When we are using libsodium
    HAVE_TWEETNACL    1        //  When we're using tweetnacl (default)

As of this patch, the default build of libzmq always has CURVE
security, and always uses tweetnacl.
2016-02-11 13:32:01 +01:00
Luca Boccassi
edc4ee03e8 Problem: ZMQ_USEFD does not follow conventions
Solution: rename socket option (and variables and files) from usefd
to use_fd.
2016-02-09 09:36:14 +00:00
Luca Boccassi
c158178798 Problem: ZMQ_PRE_ALLOCATED_FD is too long
Solution: rename socket option (and variables and files) from
pre_allocated_fd to usefd.
2016-02-08 22:46:34 +00:00
Min RK
2902fd60b9 add --with-tweetnacl to configure
allows building with tweetnacl without cmake
2016-02-08 11:40:50 +01:00
Luca Boccassi
84ad4bf0ff Problem: cannot use new pre-allocated FD with TCP
Solution: parse the value set by the ZMQ_PRE_ALLOCATED_FD sockopt
when creating a new TCP socket and use it if valid.
Add new tests/test_pre_allocated_fd_tcp.cpp unit test.
2016-02-04 16:57:26 +00:00
Luca Boccassi
9b885b7c00 Problem: cannot use new pre-allocated FD with IPC
Solution: parse the value set by the ZMQ_PRE_ALLOCATED_FD sockopt
when creating a new IPC socket and use it if valid.
Add new tests/test_pre_allocated_fd_ipc.cpp unit test.
2016-02-04 16:57:26 +00:00
Pieter Hintjens
6f94af8cca Problem: various errors in build scripts
- zmq_utils.h was removed
- udp_address.cpp and udp_engine.cpp were added

Solution: patch all affected build scripts
2016-02-01 11:18:08 +01:00
somdoron
5ebfd1728f make udp support for radio-dish 2016-01-29 21:17:11 +02:00
somdoron
dc945998a4 missing virtual modifier or session_base 2016-01-28 18:31:05 +02:00
somdoron
b8425a25cf radio-dish pattern 2016-01-27 18:22:48 +02:00
Min RK
5fe75f0e43 truncate rc to INT_MAX
to avoid overflow for large messages

send/recv still succeed for large messages,
but `zmq_msg_size` must be used to get the true size.
2016-01-20 13:43:51 +01:00
Laszlo Boszormenyi (GCS)
be387d5e56 Last bits of Hurd support 2016-01-20 07:18:22 +01:00
Constantin Rack
6d491a4289 Merge pull request #1707 from minrk/tweetnacl
include tweetnacl in dists
2016-01-15 16:04:30 +01:00
Min RK
cf57a88d49 include tweetnacl in dists 2016-01-15 16:01:48 +01:00
Pieter Hintjens
055995e535 Problem: builds directory contains packaging scripts
Specifically, the RedHat tools.

Solution: move this into packaging/
2016-01-15 10:25:38 +01:00
somdoron
aadaf99011 add timers API to libzmq 2015-12-18 12:23:22 +02:00
Ilya Kulakov
68b13fbddb Add the VMCI transport.
VMCI transport allows fast communication between the Host
and a virtual machine, between virtual machines on the same host,
and within a virtual machine (like IPC).

It requires VMware to be installed on the host and Guest Additions
to be installed on a guest.
2015-12-08 13:16:09 +06:00
Constantin Rack
5ba328d7f3 Problem: there is no test for setsockopt ZMQ_TCP_SEND/RECV_BUFFER
Solution: add test case
2015-11-13 10:44:00 +01:00
somdoron
da2bc60abe Removing zmq_pollfd as it is replaced by zmq_poller 2015-10-22 11:52:24 +03:00
somdoron
6501b8089f port zpoller to libzmq as zmq_poller 2015-10-18 21:07:23 +03:00
Pieter Hintjens
50859e40b9 Problem: drop tests on CLIENT/SERVER are misleading
These sockets deal only with single part data (at present), so the
drop tests are misleading / inappropriate.

Solution: remove them.
2015-09-13 12:17:53 +02:00
somdoron
1aaa893e02 add tests for polling on thread safe sockets 2015-08-16 13:57:28 +03:00
sappo
8bf4d1eaaf Problem: Missing src/ prefix for libzmq library in Makefile.am for test_getsockopt_memset
Solution: Add prefix to fix test compilation
2015-08-13 07:13:00 +02:00
Constantin Rack
effc26c695 Merge pull request #1476 from hintjens/master
Problem: lack test case for large stream messages
2015-08-12 10:03:45 +02:00
Rik van der Heijden
c68e9a39bf Merge fix for zeromq/zeromq4-1#52, getsockopt ZMQ_RCVMORE now resets all bits 2015-08-11 21:37:50 +02:00
Pieter Hintjens
5d5cdac161 Problem: source packages lack makefiles for all systems except msvc
Solution: specify the necessary EXTRA_DIST

I added a Makefile.am in builds that covers all systems except msvc,
which already has a Makefile.am that does this.

Fixes #1505
2015-08-11 19:34:25 +02:00
Jens Auer
6b9b13be6c Fixed whitespace error. 2015-07-20 22:34:22 +02:00
Jens Auer
23797120ff Fixed #1477 corruption in "zero-copy" raw_decoder for payloads larger than 8192 bytes #1477
Fixed wrong message::init arguments.
2015-07-20 22:22:13 +02:00
Jens Auer
3679793601 "zero-copy" raw_decoder
A memcpy is eliminated when receiving data on a ZMQ_STREAM socket. Instead
of receiving into a static buffer and then copying the data into the
buffer malloced in msg_t::init_size, the raw_decoder allocates the memory
for together with the reference-counter and creates a msg_t object
on top of that memory. This saves the memcpy operation.

For small messages, data is still copied and the receive buffer is reused.
2015-07-05 16:05:46 +02:00
Dylan Cali
a9fd750e1c add tests for #949 2015-06-28 21:23:25 -05:00
Jonathan Reams
cbb3b176a6 Add ZMTP heartbeats
This commit adds ZMTP connection heartbeats described in
http://rfc.zeromq.org/spec:37/ZMTP.
2015-06-24 13:24:53 -04:00
Jens Auer
51cb57e2c9 Fixed wrong handling of shared messages
The shared reference count was not shared but copied. msg_t cannot
store the refcnt itsef but has to store a pointer to an externally
allocated (shared) refcnter. The changes to lmsg are reverted to
use content_t again. Howver, this introduces an allocation in v2_decoder
when creating the message which can be avoided. When allocating the reception
buffer, space is allocated for the maximum number of reference counts
(8192 / max_vsm_size = 8192/64 = 128 zmq:atomic_counter objects). This
increases the buffer by 128*sizeof(atomic_counter) = 128*4 = 512 bytes only.
When creating a message, the refcnt member is set to the address of one of the
pre-allocated atomic_counter_t objects. To do so, a new msg_t type zcmsg
is introduced because msg::copy must discriminate between the message types
when releasing memory.
2015-06-14 13:35:33 +02:00
Min RK
fdb7d68056 test zmq_msg custom free-function
new allocation caused reference counters to lose track on copy
2015-06-08 15:18:53 -07:00