Commit Graph

2168 Commits

Author SHA1 Message Date
a4z
9201009f17 Problem: socket_base uses macros for mutex lock and unlock
Solution: add a lock guard that takes optional a mutex and use it
2016-09-04 10:11:47 +02:00
Hunter Laux
fd758d7239 [gssapi] memory allocation mismatch on windows
The gssapi has some helper functions gssalloc_malloc()/gssalloc_free()
which on windows doesn't call malloc()/free(). Instead these are
wrappers around HeapAlloc() and HeapFree(). To complicate matters
gssapi doesn't export these helper functions, so you're left using
the allocation method of your choice.

See Here:
89683d1f13/src/lib/gssapi/generic/gssapi_alloc.h

The zmq gssapi implementation is calling malloc and then calling
gss_release_buffer() to free the memory. gss_release_buffer uses
gssalloc_free() to free this buffer which on windows calls HeapFree()
instead of free(). This causes an access violation on windows.
2016-08-26 18:23:31 -07:00
reza-ebrahimi
a2db60e1b8 Fixing indentation related to commit #2071 2016-07-31 20:19:03 +03:30
Reza Ebrahimi
e5599de6c3 Convert manual (locking and unlocking) mutexes to scoped mutexes for the case of unlocking mutex even if the protected operation throws an exception (#2071) 2016-07-31 13:27:11 +01:00
hjp
bbece557c9 Fix copy/paste error (#2070) 2016-07-31 00:50:07 +01:00
Peter J. Holzer
e175fe21e5 Avoid race condition with accept4 where available
Linux provides accept4(2) which will return a socket with FD_CLOEXEC set
when called with the SOCK_CLOEXEC flag. So call this when available and
fall back to fcntl(..., FD_CLOEXEC) if not.
2016-07-30 21:45:30 +02:00
Jim Garlick
d090a871bc Problem: getifaddrs can fail with ECONNREFUSED
getifaddrs() can fail transiently with ECONNREFUSED on Linux.
This has been observed with Linux 3.10 when multiple processes
call zmq::tcp_address_t::resolve_nic_name() simultaneously.

Before asserting in this case, make 10 attempts, with exponential
backoff, given by (1 msec * 2^i), where i is the attempt number.

Fixes #2051
2016-07-20 09:33:33 -07:00
KIU Shueng Chuan
603cd1db88 change event monitoring functions to use zmq::fd_t 2016-06-20 22:27:52 +08:00
Fedor Sheremetyev
baea406683 Store manual subscriptions in XPUB and send them out on pipe termination. 2016-06-17 11:40:17 +01:00
Luca Boccassi
a343059aad Merge pull request #2041 from packetstash/select-fix-rebased
Copy instead of reference to a vector that gets reallocated.
2016-06-16 22:48:36 +01:00
Douglas Cuthbertson
4019112a82 Copy instead of reference to a vector that gets reallocated. 2016-06-16 17:34:22 -04:00
Armin Burgmeier
07a374357e Flush stderr buffer before calling zmq_abort in assert macros
On Windows, the written message does not seem to be guaranteed to be
written to stderr, in particular when stderr is redirected to a file. I
suppose this is because RaiseException terminates the process in a way
that does not give the CRT a chance to flush stdio buffers (or if it
does, there might be a problem when more than one CRT instance is linked
into the program and they overwrite each other's exception handler). Either
way, just make sure the assertion message ends up written to stderr to
ease diagnostics.
2016-06-13 09:26:45 -07:00
Michael Lutz
7a6ff07a01 Problem: Windows performance is not optimal due to select().
Solution: Provide poll() for Windows as well. This is a build option that
defaults to off as the resulting binary will only run on Windows Vista or
newer.

This is not tested with alternative Winsock service providers like VMCI,
but the documentation for WSAPoll does not mention limitations.

On my local machine, throughput improves by ~10 % (20 simultaneous
remote_thr workes to one local_thr, 10 byte messages), while latency
improves by ~30 % (measured with remote/local_lat).
2016-06-11 19:17:18 +02:00
Michael Lutz
8d8d32f4d0 Problem: Theoretical overflow when polling more than INT_MAX handles.
Solution: Always use fd_t when accessing the pollset.
2016-06-11 18:50:40 +02:00
Luca Boccassi
0dede9b50b Problem: std:vector.data breaks compat with C++98
Solution: use buffer address instead
2016-06-09 23:54:29 +01:00
Jose Luis Blanco-Claraco
38d7bec19e Fix build error in MSVC11
(and probably other MSVC versions)
2016-06-10 00:42:43 +02:00
Yann Diorcet
9835e18f64 Fix compilation with mingw64 using autotools 2016-06-01 15:07:16 +02:00
Ilya Kulakov
73e360fc49 VMCI family does not support non-blocking sockets.
It may even cause BSOD on Windows.
2016-05-27 19:46:03 -04:00
Adam Seering
b1e2b87f0f On systems where getifaddrs() exists but isn't implemented, behave as if 'resolve_nic_name()' were entirely unsupported 2016-05-27 00:02:37 -04:00
hitstergtd
40a2ed9e87 Problem: style broken in src/windows.hpp
Solution:
Wrap to lte 80 chars and fix it.
2016-05-20 15:37:09 +01:00
evoskuil
c050d95fcd Problem: no unit tests for base85 or public curve functions. 2016-05-19 03:46:15 -07:00
evoskuil
460bc7525b Problem: no function to derive curve public key from secret key. 2016-05-18 23:51:18 -07:00
evoskuil
6a99bb041d Problem: implicit integer narrowing cast warnings. 2016-05-18 12:02:30 -07:00
Chris-P-Bacon
874c346c20 Typo in define for libsodium
Since ZMQ_USE_SODIUM is nowhere defined i guess it's meant to be ZMQ_USE_LIBSODIUM?
2016-05-18 14:52:30 +02:00
somdoron
bbfed6b8d0 problem: memory issues, access uninitiailized memory and leak 2016-05-16 15:51:08 +03:00
somdoron
c4d0146f2c problem: udp doesn't enforce correct usage of bind/connect
solution: enforce that dish and gram can only bind and radio can only
connect
2016-05-16 13:34:38 +03:00
Doron Somech
0db70e247c problem: compilation error on windows 2016-05-16 12:48:47 +03:00
somdoron
55f0a5503e problem: dgram is not enforcing two-part message 2016-05-16 12:18:36 +03:00
somdoron
ded0e5a6d9 problem: udp_engine didn't work with dgram socket type 2016-05-16 12:18:36 +03:00
somdoron
eb80fa31ea problem: dgram more out logic was incorrect 2016-05-16 12:07:07 +03:00
somdoron
47c0b6ec25 problem: dgram doesn't need to prefetch messages 2016-05-16 10:31:38 +03:00
somdoron
d791932635 problem: terminating conn doesn't make sense in disconnected protocol 2016-05-16 10:28:42 +03:00
Bitiquinho
8cd64b76e4 Adapt to new draft header. Rebase dgram socket on pair socket 2016-05-15 16:16:09 -03:00
Bitiquinho
977e700893 Fix Copyright range 2016-05-15 15:37:33 -03:00
Bitiquinho
cea473de59 Added ZMQ_DGRAM socket option to precmpiled.hpp 2016-05-15 15:37:33 -03:00
Bitiquinho
365c8eda72 Add dgram_t class (based on stream socket and udp engine) 2016-05-15 15:35:35 -03:00
Luca Boccassi
72f19648d1 Merge pull request #1992 from evoskuil/master
Problem: name confl from windows.h, draft API decl in pch.
2016-05-14 11:49:08 +01:00
Constantin Rack
bd66cfe6f8 Merge pull request #1991 from hitstergtd/x-testcov-zmq-2
Problem: zmq_poller_destroy can segfault
2016-05-14 08:17:41 +02:00
evoskuil
2b798e486a Problem: name conflicts from windows.h, draft API declared in pch. 2016-05-13 20:41:26 -07:00
Luca Boccassi
94774f6915 Merge pull request #1988 from evoskuil/master
Problem: msvc builds are misconfigured.
2016-05-13 11:48:19 +01:00
evoskuil
9622a830d0 Problem: inapplicable, redundant and invalid references in msvc pch. 2016-05-13 01:40:14 -07:00
hitstergtd
477cc1cb12 Problem: zmq_poller_destroy parameter checking
Solution:
- Add checks for **poller_p_ to ensure that we do not segfault when either it
  or the value within it are NULL
- Add tests for the above and increase error state coverage
2016-05-12 18:09:59 +01:00
Luca Boccassi
f8c93d508f Merge pull request #1983 from hitstergtd/x-unused-thread
Problem: scheduling parameters unused on OSX
2016-05-12 16:53:22 +01:00
hitstergtd
e946b0d1a6 Problem: scheduling parameters unused on OSX
Solution:
Mark them with LIBZMQ_UNUSED macro as per convention; although in future the
appropriate pthread code should be updated to support thread scheduling
priorities (for Mac OS X, et. al.)
2016-05-12 16:36:59 +01:00
evoskuil
398a5fd454 Problem: vs2010/12 build breaks, exclude atomic & inttypes in msvc pch. 2016-05-12 03:14:30 -07:00
Hitster GTD
29c8e30fc0 Merge pull request #1982 from Hugne/bug_1968
tipc: add support for address domain suffix
2016-05-11 21:17:23 +01:00
Erik Hugne
f81ef1bc72 tipc: add support for address domain suffix
The TIPC protocol bindings in ZeroMQ defaults to a lookup domain
of 1.0.0 to prevent 'closest first' search, and instead always
do round robin if several sockets in the network or node have
the same name published. In retrospect, this might have been a
bad idea because it won't work on standalone configurations.
We solve this by allowing an optional domain suffix to be provided
in the address, and 0.0.0 should be used in that case, or if the
TIPC address range in the cluster configuration is defined to some
other value. Domain suffixes are only relevant for connecting
addresses.

Signed-off-by: Erik Hugne <erik.hugne@gmail.com>
2016-05-11 21:54:25 +02:00
Luca Boccassi
4ad68e0dfe Merge pull request #1981 from hitstergtd/x-unused-req
Problem: hint parameter throws unused warning
2016-05-11 15:57:12 +01:00
hitstergtd
5efa11828c Problem: hint parameter throws unused warning
Solution:
Mark it with LIBZMQ_UNUSED macro as per convention.
2016-05-10 18:22:15 +01:00
hitstergtd
545e8e848e Problem: sockfd_ parameter throws unused warning
Solution:
Mark it with LIBZMQ_UNUSED as per our convention.
2016-05-10 18:12:44 +01:00