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

3121 Commits

Author SHA1 Message Date
Pieter Hintjens
a6e05ad5a3 Merge pull request #891 from lalebarde/master
Reverse zmq_proxy_chain and zmq_proxy_hook
2014-02-13 19:12:46 +01:00
Laurent Alebarde
3fb800c100 fix revert 2014-02-13 18:52:15 +01:00
Laurent Alebarde
abf9d8b74e Revert "add a proxy hook"
This reverts commit 9ae6a91fadb96fd48038fde04cc3d4b61b49a8a1.
2014-02-13 18:35:09 +01:00
Laurent Alebarde
bc25366f7c Revert "add proxy_chain, a multi proxies chaining in the same thread feature"
This reverts commit bc7441f5176589ad9a34dc2bde6b91d78a44e3e0.
2014-02-13 18:35:09 +01:00
Bruno Bigras
e8a13c44b0 Fix a strict-aliasing with type-punning
Fixes #880
2014-02-13 12:06:10 -05:00
Olaf Mandel
5815b768b9 Add ZMQ_MAX_SOCKETS_MAX to zmq_ctx_get()
The new options allows querying the maximum allowed number of sockets.
This is system dependent and cannot be encoded in the include file as a
preprocessor macro: for ZMQ_USE_SELECT, this depends on the FD_SETSIZE
macro at time of library compilation, not at time of include file use.
2014-02-13 15:54:06 +01:00
Pieter Hintjens
b54a168d41 Merge pull request #884 from guruofquality/cmake_fixes
fix libzmq.pc generation under cmake
2014-02-13 11:36:51 +01:00
Pieter Hintjens
c7ffef37bc Merge pull request #886 from guruofquality/auto_fixes
fix autotools out of tree build link issue on linux
2014-02-13 10:03:55 +01:00
Pieter Hintjens
1737520c67 Merge pull request #887 from ricnewton/master
Fix hang on terminate when inproc is connected but never bound.
2014-02-13 09:31:43 +01:00
Richard Newton
12442a3d65 Bind pending connections on terminate outside lock. 2014-02-12 23:45:39 +00:00
Richard Newton
668c42fc26 Fix hang on term when inproc is connected but never bound. 2014-02-12 23:10:23 +00:00
Josh Blum
a5741ea2f5 fix autotools out of tree build link issue on linux
added srcdir to --version-script=$(srcdir)/libzmq.vers
2014-02-12 11:22:37 -08:00
Josh Blum
b1471da5ac fix libzmq.pc generation under cmake
The ${libdir} was getting replaced/removed by configure_file() making pkg-config give bad flags: -L -lzmq
My fix was to add @ONLY to configure_file() so ${} style pkg-config substitutions are left alone.
In addition, I put the other typical ${} substitutions back into the libzmq.pc, since its now safe.
2014-02-11 15:46:38 -08:00
Ian Barber
6150812ff1 Merge pull request #881 from hintjens/master
Revert "Fix potential memory leak"
2014-02-11 17:38:23 +00:00
Pieter Hintjens
ab9349d3fe Revert "Fix potential memory leak"
This reverts commit 50d34e5653ade4f3f1623c86f1426aeb746ae564.
2014-02-11 18:30:08 +01:00
Pieter Hintjens
e376ad2787 Merge pull request #876 from hurtonm/master
Fix identity handling for inproc transport
2014-02-09 21:57:49 +01:00
Martin Hurton
a09407829e Fix identity handling for inproc transport
Fixes #872
2014-02-09 21:02:00 +01:00
Pieter Hintjens
8cda54c52b Merge pull request #874 from gyulalaszlo/cmake-switchable-tests
Added ZMQ_BUILD_TESTS to CMakeLists.txt to allow turning off tests.
2014-02-07 23:53:57 +01:00
Gyula Laszlo
7a86b39d63 Added ZMQ_BUILD_TESTS to CMakeLists.txt to allow turning off tests. Useful when building ZMQ as a git submodule. 2014-02-07 17:50:45 +01:00
Pieter Hintjens
5a47fc4f08 Merge pull request #871 from apyrgio/develop
Fix potential segfault/memleak
2014-02-04 08:27:02 -08:00
Alex Pyrgiotis
50d34e5653 Fix potential memory leak
Delete the socket if the initialization part of the socket creation
fails.
2014-02-03 18:03:25 +02:00
Alex Pyrgiotis
e6ef16d005 Fix potential segmentation fault
Call the allocation assertion macro before dereferencing the socket
pointer.
2014-02-03 17:35:53 +02:00
Richard Newton
0ac223c746 Merge pull request #870 from hintjens/master
Fixed issue #868
2014-02-03 03:25:29 -08:00
Pieter Hintjens
4f56631f78 Fixed issue #868 2014-02-03 11:16:49 +01:00
Pieter Hintjens
45b593e7ed Whitespace fix 2014-02-03 11:03:59 +01:00
Pieter Hintjens
40d7ca6a60 Whitespace cleanups 2014-02-03 11:03:59 +01:00
Richard Newton
1fe82ae0a4 Merge pull request #866 from hintjens/master
Fixed issue #865 - validation on ZMQ_TCP_KEEPALIVE
2014-01-31 03:14:08 -08:00
Pieter Hintjens
bb81b1e3d9 Fixed issue #865 - validation on ZMQ_TCP_KEEPALIVE 2014-01-31 12:03:15 +01:00
Pieter Hintjens
365b7b8d20 Merge pull request #864 from ricnewton/master
Fix cmake build
2014-01-31 02:26:16 -08:00
Richard Newton
0b9a9f7671 Fix cmake build 2014-01-30 13:21:20 +00:00
Richard Newton
6cd86932c5 Merge pull request #863 from hintjens/master
Test for 127.0.0.1 at tests startup
2014-01-30 05:00:53 -08:00
Pieter Hintjens
046e37e907 Test for 127.0.0.1 at tests startup 2014-01-29 20:16:58 +01:00
Martin Hurton
de96d65f15 Merge pull request #862 from hintjens/master
Fixed man page for zmq_proxy_hook
2014-01-29 06:34:13 -08:00
Pieter Hintjens
fa318400dc Fixed man page for zmq_proxy_hook
- spaces instead of tabs for indentation
- fixed levels under EXAMPLE USAGE
- added to Makefile.am
2014-01-29 15:15:29 +01:00
Martin Hurton
e45fddc2bc Merge pull request #861 from pavel-pimenov/master
[libzmq] const string p -> const string& p (#860)
2014-01-29 05:59:52 -08:00
Pavel Pimenov
5dd82a6fa6 [libzmq] const string p -> const string& p (#860) 2014-01-29 15:58:53 +04:00
Pieter Hintjens
e436073b37 Merge pull request #858 from lalebarde/master
add proxy_chain, a multi proxies chaining in the same thread feature
2014-01-28 11:30:42 -08:00
Laurent Alebarde
bc7441f517 add proxy_chain, a multi proxies chaining in the same thread feature 2014-01-28 18:15:01 +01:00
Ian Barber
fcd9b9506a Merge pull request #855 from hintjens/master
Man page fixes
2014-01-26 06:22:10 -08:00
Pieter Hintjens
b1aba5dc30 Fixed example for zmq_msg_copy 2014-01-24 12:07:46 -06:00
Pieter Hintjens
62ac5bb77f Fixed type for ZMQ_RCVMORE getsockopt example 2014-01-24 12:07:46 -06:00
Pieter Hintjens
188e99c0d4 Merge pull request #854 from lalebarde/master
add a proxy hook
2014-01-24 09:57:46 -08:00
Laurent Alebarde
9ae6a91fad add a proxy hook 2014-01-24 16:52:30 +01:00
Martin Hurton
a7065519df Merge pull request #852 from hintjens/master
Fixes to test cases
2014-01-23 08:23:23 -08:00
Pieter Hintjens
9c228e9374 Fixes to test cases
- renamed test_stream_disconnect_notifications (too long!)
- removed print statements in that test case
- fixed Makefile.am for test_zap_ipc_creds (was not building)
2014-01-23 09:23:46 -06:00
Pieter Hintjens
8fea78b130 Merge pull request #849 from pijyoi/master
typo fix: RECVHWM -> RCVHWM
2014-01-22 05:24:34 -08:00
KIU Shueng Chuan
e71dfd13d7 typo fix: RECVHWM -> RCVHWM 2014-01-22 08:40:35 +08:00
Pieter Hintjens
9c6aa1e9e0 Merge pull request #848 from Prarrot/master
Changed fail behavior of CONNECT_RID to an assert failure instead of silent failure.
2014-01-21 12:08:00 -08:00
Tim M
188e76a73f Added asserts on socket close in test_conenct_rid. 2014-01-21 11:49:41 -08:00
Tim M
515af9b147 Added assert on duplicate id in ROUTER and STREAM sockets. Updated man to reflect this change. Modified test case to match. 2014-01-21 11:43:34 -08:00
Tim M
141e1b5966 Cleaned up formatting of test_connect_rid. Set LINGER to 0 on sockets. This may address the test failing on some devices. 2014-01-21 11:24:39 -08:00
Pieter Hintjens
14c6cba2a5 Merge pull request #846 from lalebarde/master
factorize code in proxy
2014-01-21 02:14:34 -08:00
Pieter Hintjens
660247066f Merge pull request #847 from Prarrot/master
Added test_connect_rid
2014-01-21 02:12:30 -08:00
Tim M
2d6d8af0b8 added space at end of file 2014-01-20 12:26:26 -08:00
Tim M
2b0fe6d181 Updated AUTHORS 2014-01-20 12:23:48 -08:00
Tim M
7279429cf1 tabs to spaces 2014-01-20 12:21:07 -08:00
Tim M
de1164255a added test_connect_rid file and added to CMakeLists again. 2014-01-20 12:18:04 -08:00
Laurent Alebarde
5bc6737039 factorize code in proxy 2014-01-20 17:00:02 +01:00
Pieter Hintjens
0e94ddf377 Merge pull request #842 from ipechorin/master
Fix compilation of tests on MSVC 2008
2014-01-20 03:40:46 -08:00
Ivan Pechorin
ebb51d7922 Fix CMake tests - delete non-existing test_connect_rid 2014-01-20 21:03:45 +13:00
Ivan Pechorin
1d7a07d919 Fix compilation of tests on MSVC 2008 2014-01-20 20:55:32 +13:00
Pieter Hintjens
aaeae8deb3 Merge pull request #841 from Prarrot/master
ZMQ_CONNECT_RID tests and man
2014-01-19 19:37:13 -08:00
Tim M
3fbc10eba7 Updated man entries, and added behavior in case the user duplicates peer ids. In this case the socket reverts to default behavior. 2014-01-19 17:28:13 -08:00
Tim M
1d9b76c860 Added test for ZMQ_CONNECT_RID 2014-01-19 15:59:43 -08:00
Tim M
2f36f65f8f Fixed duplicate variable declaration. 2014-01-19 15:05:20 -08:00
Ian Barber
2f85447273 Merge pull request #839 from hintjens/master
Cleaned up option to force identity on outgoing connection
2014-01-19 01:38:05 -08:00
Pieter Hintjens
50bd28c037 Cleaned up option to force identity on outgoing connection
- renamed to ZMQ_CONNECT_RID
- fixed whitespace malformating around previous patch
- renamamed next_peer_id to next_rid in preparation for
  larger rename of IDENTITY to ROUTING_ID

Note: ZMQ_CONNECT_RID has no test case and no entry in the man
page, as yet.
2014-01-19 09:27:57 +01:00
Pieter Hintjens
5f07d103a7 Merge pull request #838 from Prarrot/master
Fixed compile issue with missing member of socket_base.  Changed ZMQ_NEX...
2014-01-19 00:09:15 -08:00
Pieter Hintjens
cedca84196 Merge pull request #837 from arsenm/master
Fix cmake build and warnings
2014-01-19 00:08:05 -08:00
Tim M
b1920bdf90 Fixed compile issue with missing member of socket_base. Changed ZMQ_NEXT_IDENTITY to ZMQ_NEXT_CONNECT_PEER_ID.
Fixed case where ZMQ_NEXT_CONNECT_PEER_ID is used in ROUTER, and ROUTER does not read the identity message from the connected pipe.
2014-01-18 17:49:54 -08:00
Matt Arsenault
00aeaddf94 Fix unused parameter and variable warnings. 2014-01-18 13:17:29 -08:00
Matt Arsenault
5a230f7d9e Fix cmake configure error from deleted test. 2014-01-18 12:59:12 -08:00
Pieter Hintjens
d82389a788 Merge pull request #834 from Prarrot/master
Updated STREAM and ROUTER sockets to allow for pre-naming of outbound connections
2014-01-17 23:13:07 -08:00
Pieter Hintjens
a66c47f995 Merge pull request #833 from mrvn/pull_store-fd-on-connect
Store socket FD after connect
2014-01-17 23:11:45 -08:00
Pieter Hintjens
d13b74e955 Merge pull request #832 from mrvn/pull_stream-connect-notification
Add STREAM connect notification.
2014-01-17 23:11:27 -08:00
Tim M
f13512a926 fixed define value in header 2014-01-17 14:41:45 -08:00
Tim M
5d4860ea12 Both STREAM and ROUTER sockets suffer from a naming problem on outbound connections. While these connections can be created, they can't be immediately used. Traffic must be received before it can be sent. This prevents practical, minimal usage of STREAM or ROUTER as a true N fan in/out socket.
This change simply provides the user with a socket option that sets a user defined name of the next outbound connection:

zmq_setsockopt(routerSock,ZMQ_NEXT_IDENTITY,"myname",6);
if(0 > zmq_connect(routerSock,"tcp://127.0.0.1:1234")) return 1;
ret = zmq_send(routerSock,"myname",6,ZMQ_SNDMORE);
zmq_send(routerSock,b.mem,b.used,0);

In this example, the socket is immediately given the name "myname", and is capable of immediately sending traffic.

This approach is more effective in three ways:
1) It prevents all sorts of malicious peer naming attacks that can cause undefined behavior in existing ROUTER connections. (Two connections are made that both transmit the same name to the ROUTER, the ROUTER behavior is undefined)
2) It allows immediate control of connections made to external parties for STREAM sockets. Something that is not possible right now. Before an outbound connection had no name for STREAM or ROUTER sockets because outbound connections cannot be sent to without first receiving traffic.
3) It is simpler and more general than expecting two ROUTER sockets to handshake on assigned connection names. Plus it allows inline sending to new connections on ROUTER.
2014-01-17 14:34:39 -08:00
Goswin von Brederlow
afb24b53e6 Add STREAM connect notification.
Adjust test cases to connection notification.
Increase error checking in test cases.
2014-01-17 23:31:51 +01:00
Goswin von Brederlow
92f8f244e2 Store socket FD after connect 2014-01-17 23:30:17 +01:00
Richard Newton
53d0199e50 Merge pull request #828 from snikulov/cmake_rc_merge_fix
fixed cmake merge related to version.rc.in handling
2014-01-16 05:25:58 -08:00
Sergei Nikulov
f4a67b2520 fixed cmake merge related to version.rc.in handling 2014-01-16 16:29:12 +04:00
Pieter Hintjens
22655d05c7 Merge pull request #827 from EricMCornelius/master
Corrects ypipe initialization when conflate is NOT enabled.
2014-01-15 22:08:19 -08:00
Eric Cornelius
88a8be8231 Update pipe.cpp 2014-01-15 18:11:13 -05:00
Eric Cornelius
589fa57afa Corrects ypipe initialization when conflate is NOT enabled.
Fixes LIBZMQ-584
2014-01-15 18:08:45 -05:00
Pieter Hintjens
526847b73b Merge pull request #825 from AndreLouisCaron/disconnect-notifications
Adds support for detecting ZMQ_STREAM disconnections.
2014-01-14 22:25:01 -08:00
Pieter Hintjens
f8300d183a Merge pull request #824 from AndreLouisCaron/fix-cmake-build
Fixes CMake build after ZAP test file was deleted.
2014-01-14 22:24:30 -08:00
Andre Caron
21011541e0 Fixes CMake build after ZAP test file was deleted.
File was removed in 5bf96f64b07ff74548495fdf38198a9cc8edb662 a few days ago.
2014-01-14 17:22:52 -08:00
Andre Caron
17651b9276 Adds support for detecting ZMQ_STREAM disconnections.
When a ZMQ_STREAM socket connection is broken (intentionally, via `shutdown()`
or accidentally via client crash or network failure), there is no way for the
application to dertermine that it should drop per-connection data (such as
buffers).

This contribution makes sure the application receives a 0-length message to
notify it that the connection has been broken.  This is symmetric with the
process of closing the connection from within the application (where the
application sends a 0-length message to tell ZeroMQ to close the connection).

Conflicts:
	CMakeLists.txt
2014-01-14 17:20:46 -08:00
Pieter Hintjens
f253fe5f42 Merge pull request #823 from ricnewton/master
Define NOMINMAN to fix windows build.
2014-01-14 03:29:16 -08:00
Richard Newton
bf06f3bb27 Define NOMINMAN to fix windows build. 2014-01-14 10:27:40 +00:00
Pieter Hintjens
d981d01655 Merge pull request #821 from davipt/master
use version-script only for ELF linux
2014-01-13 09:38:43 -08:00
Bruno D. Rodrigues
d38a0c43b6 use version-script only for ELF linux 2014-01-13 17:31:56 +00:00
Pieter Hintjens
d765a0e7d4 Merge pull request #820 from jtanx/win32
Fix compilation on Windows (MinGW-w64)
2014-01-13 03:40:04 -08:00
Jeremy Tan
5efee6e0d5 Fix compilation on MinGW-w64 2014-01-13 18:38:59 +08:00
Pieter Hintjens
676dada8f6 Merge pull request #819 from hurtonm/master
Implement socket_base_t::get_credential member function
2014-01-12 15:51:56 -08:00
Martin Hurton
e46ec31209 Implement socket_base_t::get_credential member function
The get_credential () member function returns
credential for the last peer we received message for.
The idea is that this function is used to implement user-level API.
2014-01-13 00:40:27 +01:00
Ian Barber
5c4f3cc603 Merge pull request #817 from Debian/symbols
Only export zmq_* symbols
2014-01-12 08:35:05 -08:00
Ian Barber
ea54669b6f Merge pull request #818 from Debian/s390x
Fix timestamp counter on s390/s390x
2014-01-12 08:33:21 -08:00
Alessandro Ghedini
245c75aad6 Fix timestamp counter on s390/s390x
Fixes #811
2014-01-12 12:31:40 +01:00
Alessandro Ghedini
27c050845c Only export zmq_* symbols 2014-01-12 12:30:45 +01:00