0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-07 12:57:40 +08:00

5344 Commits

Author SHA1 Message Date
Luca Boccassi
baf32a1985 Problem: no documentation for zmq_curve_public
Solution: add manpage
2016-12-26 14:54:58 +01:00
Luca Boccassi
a06f97d73a Problem: fix for read-after-free not documented
Solution: add a comment as it's easy to miss and very tempting to
"optimize"
2016-12-25 18:01:55 +01:00
Luca Boccassi
dc39ceb347 Merge pull request #2268 from imkos/master
Mingw32 Compile
2016-12-22 13:55:03 +01:00
Kos
43941052a9 add link libsodium.a 2016-12-22 14:25:00 +08:00
Kos
edad90f770 mingw32 fix 2016-12-22 09:35:49 +08:00
Luca Boccassi
fe3756defa Merge pull request #2266 from Cziken/master
Problem: Duplicated code
2016-12-19 18:07:37 +01:00
Wojciech Kula
ee72493e14 Problem: Duplicated code
Solution: set_curve_key method in options_t struct with little
improvement in switch-case block
2016-12-19 12:13:14 +01:00
Constantin Rack
7a8180ece7 Merge pull request #2265 from bluca/contribution_notice_github
Problem: contributing guidelines unclear for new devs
2016-12-18 16:52:15 +01:00
Luca Boccassi
e6b1f56131 Problem: contributing guidelines unclear for new devs
Solution: port Github PR template from CZMQ
2016-12-18 11:46:08 +00:00
Constantin Rack
2dec320b22 Merge pull request #2263 from bluca/revert_curve_break 2016-12-16 18:12:37 +01:00
Luca Boccassi
48e9e24726 Problem: #2262 broke curve
Solution: Revert "Problem: Duplicated code"

This reverts commit 022eeaf33d50f8a1515a28ffb8c8cafd843ca064.
2016-12-16 16:50:17 +00:00
Constantin Rack
2aa09d34ff Merge pull request #2262 from Cziken/master
Problem: Duplicated code
2016-12-16 17:32:27 +01:00
Wojciech Kula
022eeaf33d Problem: Duplicated code
Solution: set_curve_key method in options_t struct with little
improvement in switch-case block
2016-12-16 17:09:53 +01:00
Cziken
d514bb598a Fixed handling of WSAEWOULDBLOCK to be generic (#2260)
* Fixed handling of WSAEWOULDBLOCK to be generic

I don't know what was the intention of this early if statement but
now this is properly evaluated in wsa_error_no function if this is
performance issue I suggest moving evaluating this error code to the
beginning of wsa_error_no.

* Fixed handling of WSAEWOULDBLOCK to be generic

Introduced default pointer to const char * and overrides this as NULL
if function is called by zmq::wsa_error()

* Fixed handling of WSAEWOULDBLOCK to be generic

Introduced default pointer to const char * and overrides this as NULL
if function is called by zmq::wsa_error()
2016-12-16 15:51:00 +01:00
Luca Boccassi
2b565088d0 Merge pull request #2257 from minrk/check-event
zmq_poll: only compare FD when neither item is a zmq socket
2016-12-15 14:20:46 +01:00
Min RK
0abdc28c84 only compare FD when neither item is a zmq socket 2016-12-15 14:05:40 +01:00
Luca Boccassi
1910ef8d3e Merge pull request #2256 from laplaceyang/pr_zmq4_pub_with_zmtp_v1_sub
fix bug zmq4.x PUB msg to ZMTP1.0 SUB server
2016-12-15 14:02:50 +01:00
Min RK
02a6079968 Merge pull request #2255 from bluca/poll_fd_testcase
Problem: no mixed FD and zmq socket zmq_poll test
2016-12-15 13:39:20 +01:00
laplaceyang
8e8fdcc9ed fix bug zmq4.x PUB msg to ZMTP1.0 SUB server 2016-12-15 20:29:58 +08:00
Luca Boccassi
272d340c1f Problem: no mixed FD and zmq socket zmq_poll test
Solution: add one
2016-12-15 12:03:48 +00:00
Luca Boccassi
f9d231437a Merge pull request #2251 from hnwyllmm/master
misuse of 'close'
2016-12-13 12:43:07 +01:00
Laughing
a4e448d586 misuse of 'close'
use 'pollset_destroy' instead of 'close' to release pollset_fd
2016-12-13 11:09:01 +08:00
Constantin Rack
9052862619 Merge pull request #2250 from bluca/poll_regression
Problem: check for item.fd causes zloop_poller regression
2016-12-11 07:51:31 +01:00
Luca Boccassi
72176d5fbe Problem: check for item.fd causes zloop_poller regression
Solution: fix the check for the socket.
This regression happens when using zloop with zmq_pollitem_it with
only file descriptors registerted through zloop_poller.
2016-12-10 23:49:18 +00:00
Luca Boccassi
c47e017bdd Merge pull request #2249 from pavel-pimenov/fix-v817
"%" -> '%'
2016-12-10 16:01:38 +01:00
pavel.pimenov
4d6fbe17e0 "%" -> '%' 2016-12-10 17:27:42 +03:00
Luca Boccassi
39947d55c7 Merge pull request #2248 from pavel-pimenov/fix-precompiled
Add #include "precompiled.hpp"
2016-12-10 14:57:14 +01:00
pavel.pimenov
eff42fa321 Add #include "precompiled.hpp" 2016-12-10 16:44:51 +03:00
Constantin Rack
f64d3ad1e7 Merge pull request #2247 from bluca/trusty_unwind
Problem: there is no libunwind-dev on Ubuntu 14.04LTS
2016-12-09 20:57:01 +01:00
Luca Boccassi
379028fbd9 Problem: there is no libunwind-dev on Ubuntu 14.04LTS
Solution: depend on libunwind-dev | libunwind8-dev | libunwind7-dev
2016-12-09 18:42:19 +00:00
Luca Boccassi
ad4a1bd0f3 Merge pull request #2245 from anass-b/builds-vs2017
Build support for VS2017, Windows SDK 10.0.14393.0, toolset v141
2016-12-09 10:41:07 +01:00
Anass Bouassaba
ad045512b9 Build support for VS2017, Windows SDK 10.0.14393.0, toolset v141 2016-12-09 09:21:11 +01:00
Luca Boccassi
d4076578a3 Merge pull request #2244 from rotty/wip/fix-mstcpip-include
Fix #include case for <mstcpip.h>
2016-12-08 16:50:03 +01:00
Andreas Rottmann
365ca8595d Fix #include case for <mstcpip.h>
On native Windows, the file system is case-insensitive, so this this
doesn't matter there.

However, when compiling on a case-sensitive filesystem, such as when
cross-compiling from a Unixoid using mingw, we have to use the case
the file is supplied with, which is all lowercase.
2016-12-08 16:35:44 +01:00
Constantin Rack
519940d07c Merge pull request #2241 from bluca/aix_test
Problem: test_stream_exceeds_buffer fails to build on AIX
2016-12-07 05:46:34 +01:00
Luca Boccassi
dcec022358 Problem: test_stream_exceeds_buffer does not build on AIX
Solution: add missing includes
2016-12-06 20:34:10 +00:00
Luca Boccassi
8325355d73 Problem: test_stream_exceeds_buffer has redundant includes
Solution: remove them as they are already in testutil.hpp
2016-12-06 20:33:46 +00:00
Constantin Rack
5e03ad6d87 Merge pull request #2240 from bluca/aix_poll
Problem: 4.2.0 won't compile on AIX 7.1
2016-12-06 19:34:20 +01:00
Luca Boccassi
57db5f2a5c Problem: 4.2.0 won't compile on AIX 7.1
Solution: restore inclusion of poll.h if using poll before zmq.h as
it was originally, as AIX redefines the POSIX structures and provides
compatibility macros.
Also add alternative aliases for 32 bit AIX's pollitem struct:
  events -> reqevents
  revents -> rtnevents
2016-12-05 22:50:10 +00:00
Luca Boccassi
3f8e6c0812 Merge pull request #2239 from loachfish/master
avoid crashing in the multi-thread operation for std::vector
2016-12-05 14:22:28 +01:00
Justin.Hung
52ebffd715 avoid crashing in the multi-thread operation for std::vector
1. stl container is not thread safety
2. rm_fd() and loop() end to clear the retired event source will in multi-thread operation
3. may be crashed in reaper thread to delete the items in the std::vector as the source is nullptr
2016-12-05 09:28:05 +08:00
Constantin Rack
42c63368e6 Merge pull request #2238 from bluca/revert
Problem: PR #2236 breaks the build
2016-12-04 07:42:47 +01:00
Luca Boccassi
e46d91d41f Problem: PR #2236 breaks the build
Solution: Revert "avoid crashing in the multi-thread operation for std::vector"

This reverts commit e1368bdac804a49de101725ede1f900aebe82c10.
2016-12-03 22:10:19 +00:00
Constantin Rack
324f10494a Merge pull request #2236 from loachfish/master
avoid crashing in the multi-thread operation for std::vector
2016-12-03 16:09:56 +01:00
Justin.Hung
e1368bdac8 avoid crashing in the multi-thread operation for std::vector
1. stl container is not thread safety
2. rm_fd() and loop() end to clear the retired event source will in multi-thread operation
3. may be crashed in reaper thread to delete the items in the std::vector as the source is nullptr
2016-12-02 17:33:13 +08:00
Constantin Rack
9a20f42f62 Merge pull request #2235 from bluca/cmake_soversion
Problem: CMake build uses library version as the ABI version
2016-12-02 07:32:55 +01:00
Luca Boccassi
abeaba1557 Problem: CMake build uses library version as the ABI version
Solution: set SOVERSION in CMakeLists to match the SONAME generated
by libtool so that there is no mismatch between the output of the
*NIX build systems.

Before:
$ ls -l
total 2696
lrwxrwxrwx 1 luca luca      15 Dec  1 22:36 libzmq.so -> libzmq.so.4.2.0
lrwxrwxrwx 1 luca luca      15 Dec  1 22:36 libzmq.so.4.2.0 -> libzmq.so.4.2.1
-rwxr-xr-x 1 luca luca  906168 Dec  1 22:36 libzmq.so.4.2.1
$ readelf -d libzmq.so.4.2.1 | grep SONAME
 0x000000000000000e (SONAME)    Library soname: [libzmq.so.4.2.0]

After:
$ ls -l
total 2700
lrwxrwxrwx 1 luca luca      15 Dec  1 22:31 libzmq.so -> libzmq.so.5.1.0
-rwxr-xr-x 1 luca luca  906168 Dec  1 22:31 libzmq.so.4.2.1
lrwxrwxrwx 1 luca luca      15 Dec  1 22:31 libzmq.so.5.1.0 -> libzmq.so.4.2.1
$ readelf -d libzmq.so.4.2.1 | grep SONAME
 0x000000000000000e (SONAME)    Library soname: [libzmq.so.5.1.0]
2016-12-01 22:36:40 +00:00
Laughing
febf801584 bug fix: AIX pollset error (#2233)
* bug fix: AIX pollset error

buf fix:  AIX only, pollset 'rm_fd' set fd_table to null first then set pe->fd to retired_fd

* remove extra spaces

remove extra spaces
2016-12-01 11:59:23 +01:00
Constantin Rack
294bdb4eb6 Merge pull request #2231 from bluca/windows_ipv6_tos
Problem: Windows does not support IPV6_TCLASS
2016-11-30 21:07:32 +01:00
Luca Boccassi
33fcd2d6ca Problem: Windows does not support IPV6_TCLASS
Solution: don't use it on Windows.
There is a Windows-specific API for ToS, even IPv4 does not work and
it's just a silent no-op on that platform.
2016-11-30 11:09:12 +00:00
Constantin Rack
4a24805f70 Merge pull request #2225 from bluca/select_broken
Problem: select broken
2016-11-24 20:00:33 +01:00
Luca Boccassi
121c9d16f5 Problem: select.cpp/hpp build fails with reorder error
Solution: initialise class variables in the same order they are
declared
2016-11-24 13:07:47 +00:00
Luca Boccassi
ba74890f2f Problem: cannot pick select for poller
Solution: fix acinclude.m4 snippet that checks if select is
available to stop it erroring out.
2016-11-24 12:44:51 +00:00
Luca Boccassi
e6572fac80 Merge pull request #2222 from SuperFluffy/doc_explain_context
Add a single sentence explaining what a context is
2016-11-21 14:17:36 +01:00
Richard Janis Goldschmidt
ec25fd2ada Add a single sentence explaining what a context is 2016-11-21 14:11:33 +01:00
Luca Boccassi
53bf6dfcf0 Merge pull request #2221 from minrk/check-socket
only compare pollitem.fd if pollitem.socket is NULL
2016-11-21 12:17:01 +01:00
Min RK
f302d8a7b6 only compare pollitem.fd if pollitem.socket is NULL
item.fd should be ignored if item.socket is defined.

Failing to check .socket could cause false-matches, raising EINVAL in zmq_poller_modify_fd.
2016-11-21 11:47:50 +01:00
Constantin Rack
185fed3966 Merge pull request #2220 from bluca/zmq_msg_size
Problem: size of zmq_msg_t is not known to FFI wrappers
2016-11-20 14:59:45 +01:00
Luca Boccassi
8a286bb842 Problem: no documentation for ZMQ_MSG_T_SIZE ctx option
Solution: mention it in zmq_ctx_get manpage
2016-11-20 12:51:25 +00:00
Luca Boccassi
b480457283 Problem: ZMQ_MSG_T_SIZE is not mentioned in NEWS
Solution: mention it as it's a new public API (still draft until release)
2016-11-20 12:50:45 +00:00
Luca Boccassi
670bec56d8 Problem: size of zmq_msg_t is not known to FFI wrappers
Solution: add a ZMQ_MSG_T_SIZE context read-only option so that
wrappers can call zmq_ctx_get (ctx, ZMQ_MSG_T_SIZE) to get the
size at runtime.
2016-11-20 12:24:03 +00:00
Constantin Rack
3db69212b7 Merge pull request #2216 from rotty/master
Document terminating NUL behavior in API more explicitly
2016-11-16 20:03:18 +01:00
Andreas Rottmann
5d176cbe98 Document terminating NUL behavior in API more explicitly
This addresses #2169.
2016-11-16 19:56:18 +01:00
Constantin Rack
93ccb5a16d Merge pull request #2215 from Bklyn/udp-bugfix
Problem: inconsistent indentation and tabs in code
2016-11-15 20:41:32 +01:00
Caleb Epstein
10181d7641 Untabify 2016-11-15 14:33:47 -05:00
Luca Boccassi
5879f729dd Merge pull request #2214 from Bklyn/udp-bugfix
Problem: multicast is spelled incorrectly in udp_address class
2016-11-15 20:13:21 +01:00
Caleb Epstein
f577ceab4b Problem: multicast is spelled incorrectly in udp_address class
Solution: Fix typo of 'mutlicast' -> 'multicast'
2016-11-15 14:06:34 -05:00
Constantin Rack
ace95327a3 Merge pull request #2213 from Bklyn/udp-bugfix
Fix htons copy pasta
2016-11-15 19:55:54 +01:00
Caleb Epstein
cdac1ac9d3 Fix htons copy pasta 2016-11-15 13:51:49 -05:00
Constantin Rack
b9b0fd87a4 Merge pull request #2210 from bluca/ipv6_tos_v4_only
Problem: IPV6_TCLASS setsockopt fails on IPv4 socket
2016-11-14 13:58:28 +01:00
Luca Boccassi
90f091abf3 Problem: IPV6_TCLASS setsockopt fails on IPv4 socket
Solution: if setsockopt errors out and errno is set to ENOPROTOOPT
(or EINVAL on OSX) ignore it and carry on.
2016-11-14 12:52:31 +00:00
Luca Boccassi
bc1860430a Merge pull request #2209 from saifhhasan/master
Make ZMQ_TOS work with IPv6 sockets
2016-11-14 11:37:24 +01:00
Saif Hasan
fc8007e896 Make ZMQ_TOS work with IPv6 sockets
Summary:
To set `Type Of Service` for IP layer packets ZMQ provides `ZMQ_TOS` socket
option. However this only works for v4 sockets. Considering things are moving to
IPv6 heavily (especially within enterprise networks), ZMQ should support setting
`traffic class` for v6 based on `ZMQ_TOS`.

There is a subtle difference between v4 and v6 in terms of the positioning of
field but TOS has same meaning in both v4 and v6. Linux provides following APIs
for v4/v6 to set TOS field value.
```
// For v4
setsockopt(fd, IPPROTO_IP, IP_TOS, tos, sizeof(tos));

// For v6
setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, tos, sizeof(tos));
```

Test Plan:
Make sure Cmake works fine and all tests passes.
Imported this change to `OpenR` project and tested on our local testbed.
Captured some packets exchanged between PUB/SUB and ROUTER/ROUTER sockets
pairs. Verify that `TCLASS` value is set as per expectation.

Tasks: #2208
2016-11-14 02:19:55 -08:00
Constantin Rack
8ac7500f9d Merge pull request #2203 from bluca/bump_version
Problem: 4.2.0 is out, time to bump version for development
2016-11-12 21:01:11 +01:00
Constantin Rack
e50c6b6992 Merge pull request #2206 from bluca/dladdr
Problem: linker fails looking for dladdr
2016-11-12 21:00:04 +01:00
Luca Boccassi
1b3fcbd3ee Problem: linker fails looking for dladdr
Solution: search and add it via AC_CHECK_LIB when building with
libunwind, as the backtrace function uses dladdr. This problem
only appears on some distributions and with some compiler/toolchain
versions.
2016-11-10 23:10:01 +00:00
Luca Boccassi
8015794b81 Problem: 4.2.0 is out, time to bump version for development
Solution: update NEWS, include/zmq.h and packaging
2016-11-08 12:54:53 +00:00
Constantin Rack
065169a221 Merge pull request #2201 from bluca/news_blocky
Problem: NEWS says ZMQ_BLOCKY is a sock opt, but it's a ctx opt
2016-11-07 20:08:16 +01:00
Luca Boccassi
4b58b3735f Problem: NEWS says ZMQ_BLOCKY is a sock opt, but it's a ctx opt
Solution: fix it
2016-11-07 15:32:47 +00:00
Constantin Rack
067bfa13b8 Merge pull request #2198 from vyskocilm/master
Problem: linking fails on glibc 2.24 with dladdr missing
2016-11-06 11:40:47 +01:00
Michal Vyskocil
cab901c0a6 Problem: linking fails on glibc 2.24 with dladdr missing
Solution: try to find dladdr function on Linux - glibc systems provides
dlopen/dladdr in libdl and not in libc itseld.
2016-11-06 11:18:55 +01:00
Constantin Rack
ef3c2591fc Merge pull request #2197 from bluca/install_keygen_rpm
Problem: curve_keygen not packaged by RPM spec
2016-11-06 09:40:18 +01:00
Luca Boccassi
b73809c380 Problem: curve_keygen not packaged by RPM spec
Solution: add new libzmq-tools package to ship it
2016-11-06 08:20:02 +00:00
Constantin Rack
d9ff34891b Merge pull request #2196 from bluca/kfreebsd
Problem: some errors on Debian + kFreeBSD
2016-11-05 23:23:01 +01:00
Luca Boccassi
43f3cc5c78 Problem: kFreeBSD does not implement pthread_setschedparam
Solution: do not fail on kFreeBSD if this feature is not available
at runtime.
Thanks Steven Chamberlain <steven@pyro.eu.org> for the patch!
2016-11-05 18:14:22 +00:00
Luca Boccassi
361e99a906 Problem: kFreeBSD might return ECONNRESET under load when destroying engine
Solution: ignore it on kFreeBSD, as it is not an error
Thanks Steven Chamberlain <steven@pyro.eu.org> for the patch!
2016-11-05 18:13:01 +00:00
Luca Boccassi
6585aeaba2 Merge pull request #2195 from vyskocilm/master
Problem: curve_keygen not build unless --enable-curve is passed
2016-11-05 17:13:00 +01:00
Michal Vyskocil
213a7efe86 Problem: curve_keygen not build unless --enable-curve is passed
Solution: test ENABLE_CURVE_KEYGEN and enable it only if
zmq_enable_curve_keygen=yes nad enable_curve=yes. Additionally set
enable_curve=yes for libsodium and tweetnacl, so it is enabled
implicitly and fixes the problem.
2016-11-05 10:51:10 +01:00
Luca Boccassi
8f577248b7 Merge pull request #2193 from warriorkitty/patch-1
Fix small typo
2016-11-04 13:30:38 +00:00
Davor Lozic
a5ad378893 Fix small typo 2016-11-04 14:21:33 +01:00
Doron Somech
42d3ef5e06 Merge pull request #2192 from bluca/udp_news
Problem: NEWS says scatter/gather support UDP but they don't
2016-11-04 13:57:38 +02:00
Luca Boccassi
7ff6d57d47 Problem: NEWS says scatter/gather support UDP but they don't
Solution: fix NEWS
2016-11-04 11:55:50 +00:00
Doron Somech
18bd4d171a Merge pull request #2191 from bluca/news_multicast
Problem: NEWS does not mention UDP multicast transport
2016-11-04 13:34:30 +02:00
Luca Boccassi
127ca8b3f3 Problem: NEWS does not mention UDP multicast transport
Solution: add mention and point to doc/zmq_udp.txt
2016-11-04 11:29:55 +00:00
Luca Boccassi
097bf26e8d Finalize NEWS for 4.2.0 v4.2.0 2016-11-04 10:20:02 +00:00
Lukas Geiger
785d9b5494 Merge pull request #2189 from bluca/changelog
Problem: NEWS out of date
2016-11-04 10:58:54 +01:00
Luca Boccassi
9e52806724 Problem: no NEWS for 4.2.0
Solution: add an overview of the new socket options, new APIs,
DRAFT mechanism (and DRAFT APIs). And a dedication.
2016-11-04 09:48:34 +00:00
Luca Boccassi
932cc8295b Problem: NEWS does not include previouos stable releases
Solution: add release notes from 4.0.x and 4.1.x releases to
capture all important solved bugs.
2016-11-02 17:33:24 +00:00
Doron Somech
7000e84aed Merge pull request #2187 from Dmitriy-GH/master
Add WinXP compatibility
2016-11-02 14:07:47 +02:00
Dmitriy-GH
488cb5a022 MSVC 2015 project for compile libzmq.dll in WinXP compatible mode 2016-11-02 15:51:58 +05:00