1487 Commits

Author SHA1 Message Date
Pieter Hintjens
0c332648f8 Fixed wildcard IPC endpoint and added test case
Conflicts:
    .gitignore
    tests/Makefile.am
2016-06-09 15:10:53 +01:00
Pieter Hintjens
840feef1c3 Fixed use of deprecated tempnam 2016-06-09 15:01:29 +01:00
Luca Boccassi
b2a2291373 Problem: make dist does not tar up macros.hpp
Solution: add it to Makefile.am file list
2016-06-04 18:52:07 +02:00
Luca Boccassi
422b19654e Problem: no newline at end of zmq.cpp, gcc warn
Solution: add it to avoid warning on Solaris 10
2016-04-12 22:34:12 +01:00
Luca Boccassi
0c66618e40 Problem: redundant Windows errno conversion
Solution: in the Windows-specific ifdef in tcp_listener set_address,
check for error and set errno only after the IPv4 fallback has failed
too, to avoid setting errno when the socket creation succeeds through
the fallback.
2016-04-07 14:31:37 +01:00
Luca Boccassi
6892b7b60d Problem: zmq_connect (TCP) has no IPv4 fallback
Solution: if opening an IPv6 TCP socket fails because IPv6 is not
available, try to open an IPv4 socket instead when creating and
connecting a TCP endpoint.
2016-04-07 14:31:37 +01:00
Luca Boccassi
792ee7690e Problem: zmq_bind IPv4 fallback still tries IPv6
Solution: if opening an IPv6 TCP socket fails because IPv6 is not
available, try to open an IPv4 socket instead when creating and
binding a TCP endpoint.
2016-04-07 14:17:16 +01:00
Soren Hansen
8f1b6f5872 Avoid terminating connections prematurely
While sending very large messages (far beyond what fits in a the tcp
buffer, so it takes multiple sendto system calls for it to finish),
zmq_close will close the connection regardless of ZMQ_LINGER.

In case no engine is attached, a pipe->check_read() is needed to look
for the delimiter in the pipe and ultimately trigger the pipe
termination.

However, if there *is* an engine attached, the check_read() looks ahead
and finds the delimiter and terminates the connection even though the
engine might actually still be in the middle of sending a message.

This happens because while the io_thread is still busy sending the data,
the pipe can get terminated and the io thread ends up being terminated.
2016-03-30 17:01:35 +01:00
Luca Boccassi
6e1424349b Problem: curve keys getsockopt uninitialised read
Solution: always initialised zmq::options_t class variables arrays to
avoid reading uninitialised data when CURVE is not yet configured and
a getsockopt ZMQ_CURVE_{SERVER | PUBLIC | SECRET]KEY is issued.

Backport from libzmq.
2016-02-16 14:11:00 +00:00
meox
aafdcc8d2e [PATCH] fix error with gcc 5.2 2016-02-12 22:19:51 +00:00
Jean-Christophe Fillion-Robin
d2687e75b6 Fix unused parameter and variable warnings.
Backported from zeromq/libzmq@00aeadd

It fixes the following warnings:

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
In file included from /path/to/src/mechanism.cpp:22:0:
/path/to/src/mechanism.hpp:49:36: warning: unused parameter 'msg_' [-Wunused-parameter]
         virtual int encode (msg_t *msg_) { return 0; }
                                    ^
/path/to/src/mechanism.hpp:51:36: warning: unused parameter 'msg_' [-Wunused-parameter]
         virtual int decode (msg_t *msg_) { return 0; }
                                    ^
/path/to/src/mechanism.cpp:126:51: warning: unused parameter 'name_' [-Wunused-parameter]
 int zmq::mechanism_t::property (const std::string name_,
                                                   ^
/path/to/src/mechanism.cpp:127:45: warning: unused parameter 'value_' [-Wunused-parameter]
                                 const void *value_, size_t length_)
                                             ^
/path/to/src/mechanism.cpp:127:60: warning: unused parameter 'length_' [-Wunused-parameter]
                                 const void *value_, size_t length_)
                                                            ^

/path/to/src/mechanism.cpp:127:60: warning: unused parameter 'length_' [-Wunused-parameter]
                                 const void *value_, size_t length_)
                                                            ^

In file included from /path/to/src/pipe.cpp:28:0:
/path/to/src/ypipe_conflate.hpp: In instantiation of 'bool zmq::ypipe_conflate_t<T, N>::unwrite(T*) [with T = zmq::msg_t; int N = 256]':
/path/to/src/pipe.cpp:489:1:   required from here
/path/to/src/ypipe_conflate.hpp:73:33: warning: unused parameter 'value_' [-Wunused-parameter]
         inline bool unwrite (T *value_)
                                 ^

/path/to/src/zmq_utils.cpp:178:30: warning: unused parameter 'z85_public_key' [-Wunused-parameter]
 int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key)
                              ^
/path/to/src/zmq_utils.cpp:178:52: warning: unused parameter 'z85_secret_key' [-Wunused-parameter]
 int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key)
                                                    ^

/path/to/tests/test_hwm.cpp:205:57: warning: unused parameter 'recv_hwm' [-Wunused-parameter]
 int test_inproc_bind_and_close_first (int send_hwm, int recv_hwm)
                                                         ^
[ 69%] Linking CXX executable bin/test_connect_resolve
/path/to/tests/test_disconnect_inproc.cpp:31:14: warning: unused parameter 'argc' [-Wunused-parameter]
 int main(int argc, char** argv) {
              ^
/path/to/tests/test_disconnect_inproc.cpp:31:27: warning: unused parameter 'argv' [-Wunused-parameter]
 int main(int argc, char** argv) {
                           ^

/path/to/tests/test_stream.cpp:39:81: warning: missing initializer for member 'zmtp_greeting_t::as_server' [-Wmissing-field-initializers]
     = { { 0xFF, 0, 0, 0, 0, 0, 0, 0, 1, 0x7F }, { 3, 0 }, { 'N', 'U', 'L', 'L'} };
                                                                                 ^
/path/to/tests/test_stream.cpp:39:81: warning: missing initializer for member 'zmtp_greeting_t::filler' [-Wmissing-field-initializers]
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---

# Conflicts:
#	src/stream.cpp
#	src/stream_engine.cpp
#	tests/test_stream_disconnect_notifications.cpp
2016-01-30 04:13:39 -05:00
Jean-Christophe Fillion-Robin
4055bbb01f Problem: Private/internal macros defined in public header.
Solution: Move the macros to a private header.

Backported from zeromq/libzmq@3341942

# Conflicts:
#	include/zmq.h
#	src/address.cpp
#	src/client.cpp
#	src/server.cpp
#	src/socks_connecter.cpp
#	src/zmq.cpp
2016-01-30 03:52:24 -05:00
Jean-Christophe Fillion-Robin
300d80ffe9 rename ZMQ_UNUSED macro to LIBZMQ_UNUSED
Backported from zeromq/libzmq@63260d8

# Conflicts:
#	include/zmq.h
#	src/client.cpp
#	src/server.cpp
2016-01-30 03:46:46 -05:00
Jean-Christophe Fillion-Robin
9df7ed0740 place a ZMQ_UNUSED macro and replace all unused variables with ZMQ_UNUSED macro
Backported from zeromq/libzmq@bff2284

# Conflicts:
#	src/client.cpp
#	src/server.cpp
2016-01-30 03:42:29 -05:00
Josh Blum
43b9d9d619 Fix C linkage for public symbols MSVC
The header symbols are declared extern "C",
however the the implementations are compiled in a C++ source.
The result is that the library symbols get C++ name mangled
and the resulting dll is missing all of the symbols from the header.
The fix was to add extern "C" in zmq.cpp and zmq_utils.cpp
2016-01-23 01:25:01 -08:00
Richard Newton
fb6a0b24f7 Merge pull request #107 from minrk/backport-721
backport stream socket empty frame fix
2015-08-02 19:23:48 +01:00
Dylan Cali
d2574dd45f backport zeromq/libzmq@09e7416
fixes zmq_unbind failing for wildcard endpoints
2015-06-28 23:26:19 -05:00
Dylan Cali
f1cec450db backport zeromq/libzmq@54e0fde
fixes zmq_unbind failing with ENOENT
2015-06-28 23:25:48 -05:00
Min RK
3d6f11e56d backport stream socket empty frame fix
backport of zeromq/libzmq#721

In the discussion, it was decided to backport, but that never actually happened.

test file was renamed after the above PR, so the version from master is pulled in here.
2015-06-07 11:20:27 -07:00
Min RK
9de7eeb467 don't check POLLOUT for single-socket proxies 2015-06-07 11:14:25 -07:00
Min RK
0f10ef1b38 fix scope of itemsout poll
indentation was correct, but poll was inside `if control`,
causing it to only be called if there is a control message.

This would cause proxy messages to only be delivered after a control message had been sent.
2015-06-05 13:45:10 -07:00
Rik van der Heijden
95019b00a0 Fix another degradation, CPU maxes out when POLLOUT is set because poll exits on POLLOUT and doesn't wait for POLLIN 2015-05-27 14:14:37 +02:00
Rik van der Heijden
683059d3a2 Fix degradation from #1382, POLLOUT was tested but not requested 2015-05-24 22:37:24 +02:00
Rik van der Heijden
4bba965d98 Problem: zmq_proxy_steerable didnt act on PAUSE/RESUME (fixes issue #88) 2015-05-01 20:57:40 +02:00
Rik van der Heijden
8a9fece30a Backport zeromq/libzmq#1382: Do not send data to backend when there are no listeners (+ test) 2015-05-01 20:51:37 +02:00
Martin Hurton
a1d1222dcc pub: Don't delay pipe termination 2015-05-01 08:43:53 +02:00
Martin Hurton
812c2016b1 push: Don't delay pipe termination 2015-05-01 08:43:49 +02:00
Pieter Hintjens
b589fb98b8 Problem: shutdown asserts if WSASTARUP wasn't done previously
This is a silly assertion that causes problems if libzmq.dll is
called in some esoteric ways.

Solution: if the shutdown code detects WSANOTINITIALISED, then
exit silently.

Fixes #1377
Fixes #1144

Conflicts:

	src/signaler.cpp
2015-04-21 23:27:54 +02:00
Martin Hurton
d8d9d17b21 Adjust number of sent messages on hiccups
Not adjusting the sent message count may lead to situation when SUB
socket does not forward its subscriptions.
2015-02-20 09:12:25 +01:00
Pieter Hintjens
77ef79e3b5 Problem: issue #1273, protocol downgrade attack
Solution: backport fix from libzmq master. Also backported test
cases.
2014-12-05 09:08:02 +01:00
Pieter Hintjens
d73b240880 Merged patch for #1190 2014-09-20 10:37:18 +02:00
Jonathan Reams
16b2db6062 Clean up after using randombytes from libsodium
When Curve authentication is used, libsodium opens a file
descriptor to /dev/urandom to generate random bytes. When
the ZMQ context terminates, it should ensure that file gets
closed.
2014-08-31 14:02:57 -04:00
Ewen McNeill
f35d0b6f8d z/OS: Loop on EAGAIN on close() in ~signaler
Updated:
    src/signaler.cpp: Add close_wait_ms() static function to loop
       when receiving EAGAIN in response to close(), with ms long
       sleeps, up to a maximum limit (default 2000ms == 2 seconds);
       used in signaler_t::~signaler_t() destructor.
2014-07-24 11:11:54 +12:00
Olaf Mandel
eaf732c25e Fix failed assertion for WSAENOTSOCK
In de9eef306, the error number assigned to WSAENOTSOCK was EFAULT, but
zmq.cpp:919 expects an ENOTSOCK in this case.
2014-06-10 15:06:27 +02:00
Olaf Mandel
2c754fc0a9 Extend zmq::wsa_error_to_errno()
The list of error codes is taken from zmq::wsa_error_no(). Most of the
new WSA error codes result in EFAULT, but some return a more specific
value (even EAGAIN).

Backport of zeromq/libzmq#1072
2014-06-04 17:41:03 +02:00
Olaf Mandel
d4d26b1cc0 Fix race condition in connecting inproc sockets
This is a backport of libzmq:3678c32b9
by Martin Hurton <hurtonm@gmail.com>
2014-05-21 17:02:01 +02:00
Olaf Mandel
550c32ed10 Fix identity handling for inproc transport
Fixes #872

Backport of hurtonm/libzmq@a09407829; included as
zeromq/libzmq@e376ad278 in development repos.
2014-05-12 15:21:56 +02:00
Maarten Ditzel
488cf5e04c Merge branch 'master' of https://github.com/zeromq/zeromq4-x 2014-04-14 13:36:27 +02:00
Maarten Ditzel
75fbd4f8d6 Fix issue #75 2014-04-14 11:01:49 +02:00
Martin Hurton
2ae11cdc8d Resolve issue #939
This bug is caused by fq which can terminate pipe before sending all
frames of a message first. So sometimes two messages were mixed and this
confused ZAP handler.

This patch just modifies one pipe parameter so that socket consumes all
messages before dropping the pipe.
2014-04-03 20:37:10 +02:00
KIU Shueng Chuan
c1b055a6d8 fix: win32 tcp_keepalive gets set even when option is -1 2014-03-25 07:12:06 +01:00
Cosmo Harrigan
e0f718bbd2 Backport zmq_proxy_steerable and fix error in proxy function prototype. 2014-03-17 17:55:59 -07:00
Pieter Hintjens
7f08204e9f Source package did not build 2014-03-10 22:40:48 +01:00
Josh Blum
dd5603d6e9 Updated NEWS for #909 2014-03-03 12:09:40 +01:00
Richard Newton
c7a7de12a3 Backported fix for #888 2014-02-13 14:56:09 +00:00
Pieter Hintjens
e655fd138d Merge pull request #57 from Debian/counter
Fix timestamp counter on s390/s390x
2014-02-05 21:11:10 +01:00
Alessandro Ghedini
4b9cd7764a Only export zmq_* symbols 2014-02-05 20:43:13 +01:00
Alessandro Ghedini
2493a99735 Fix timestamp counter on s390/s390x
Fixes #811
2014-02-05 20:42:40 +01:00
Pieter Hintjens
830e022987 Fixed #868 2014-02-03 11:22:22 +01:00
Eric Cornelius
63fe43a101 Corrects ypipe initialization when conflate is NOT enabled. Fixes LIBZMQ-584 2014-01-15 12:18:50 -08:00