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

2498 Commits

Author SHA1 Message Date
Guido Goldstein
455739f942 Fixed markup so documentation can be built. 2013-08-29 09:35:17 +02:00
Pieter Hintjens
83e547f09f Merge pull request #633 from eburkitt/vs2012-clean-compile
get to clean compile under vs2012
2013-08-24 14:31:16 -07:00
Evan Burkitt
eaf227d4de get to clean compile under vs2012
Added some missing (but existing in branch) files to libzmq11 project needed
to compile as static library by VS2012 (at least), and fixed some warnings.
One warning remains in raw_decoder.cpp, which I'm leaving for now because I'm
not sure how project owners would like to fix it.
2013-08-23 17:14:03 -07:00
Pieter Hintjens
2e9385ac02 Merge pull request #631 from jrossi/master
Add the Socket Identity info to the ZAP Messages
2013-08-21 01:35:43 -07:00
Ian Barber
d485404aab Merge pull request #626 from dkrikun/master
Add ZMQ_CONFLATE socket option
2013-08-20 14:37:52 -07:00
Jeremy Rossi
19ca8a0fc0 Add the Socket Identity info to the ZAP Messages
This change adds the socket identity infomartion from the socket to the
zap frames.  In doing this the ZAP is able preform different operations
based on different sockets.  This is not compaitable with the current ZAP
RFC, but that can be updated.  As the ZAP rfc is currently draft for I
did not change the version number.

Tests also modified and passing.
2013-08-20 13:48:05 -04:00
Ian Barber
cb6b5a65fc Merge pull request #629 from ulikoehler/init_data_assert
Minor doc & assert fixes
2013-08-19 05:55:07 -07:00
Uli Köhler
fd8b0fec07 Re-add comment line from cmsg branch 2013-08-19 14:49:29 +02:00
Uli Köhler
a28c38efa5 Fix spaces before comments 2013-08-19 14:45:29 +02:00
danielkr
3f3777d05b Add test for ZMQ_CONFLATE option 2013-08-19 15:34:11 +03:00
Uli Köhler
9c2740d9fa Minor fixes to doc ; added zmq_msg_init_data() assert preventing deferred segfault 2013-08-19 14:28:28 +02:00
Ian Barber
bcfe863fd4 Merge pull request #630 from ulikoehler/cmsg
Optimized zmq::msg_t for constant messages
2013-08-19 01:11:07 -07:00
danielkr
da4a70d59d Fix indentation 2013-08-19 08:18:20 +03:00
Uli Köhler
121a838a0c Added message type for constant messages 2013-08-18 23:40:38 +02:00
Pieter Hintjens
b3ca7fd425 Merge pull request #627 from ianbarber/master
Attempt to fix disconnect not respecting linger
2013-08-18 00:58:03 -07:00
Pieter Hintjens
1011e8ad20 Merge pull request #624 from ricnewton/master
Port tests to windows and add to cmake build.
2013-08-18 00:51:39 -07:00
Ian Barber
cb35fd7bfe Attempt to fix disconnect not respecting linger
Looks like linger is honoured properly, but shutting down the session
causes the pipe termination to come from that side - because the local
pipe then shuts down right away it seems to trigger a terminated on the
other end instead of waiting. This way we trigger the termination from
the local end and then terminate the session.
2013-08-18 07:50:53 +01:00
Ian Barber
ed272fe56d Merge pull request #625 from ulikoehler/zmq_send_const
Add zmq_send_const for constant data
2013-08-17 23:27:17 -07:00
danielkr
f59c1a5c5a Update doc for ZMQ_CONFLATE socket option 2013-08-17 23:55:00 +03:00
danielkr
daa7a8021f Plug in dbuffer to serve the ZMQ_CONFLATE option
ZMQ_CONFLATE option is passed to pipepair() which creates a usual
ypipe_t or ypipe_conflate_t and plugs it into pipe_t under a common
abstract base.
2013-08-17 23:27:25 +03:00
danielkr
4c35b88acb Implement double buffer for conflate option
Add simple double buffer implementation tailored to handle msg_t,
i.e invoke msg_t::close instead of destructor and so on.
Seems to me mutex is good enough at this point.
2013-08-17 23:22:34 +03:00
danielkr
d020dd677f Declare ZMQ_CONFLATE option 2013-08-17 23:22:34 +03:00
danielkr
4eac7e3e4f Add scoped_lock_t syntactic sugar 2013-08-17 23:15:16 +03:00
danielkr
87c84a252a Add try_lock() to mutex_t 2013-08-17 23:15:16 +03:00
danielkr
503da83fce Add #include to string.h in blob.hpp
Required for memmove(), memcpy()
2013-08-17 23:15:15 +03:00
Uli Köhler
e23d3963d3 Fix doc typo 2013-08-17 20:39:10 +02:00
Uli Köhler
10becae7eb Added zmq_send_const test 2013-08-17 20:37:07 +02:00
Uli Köhler
e2c322cf80 Implemented zmq_send_const 2013-08-17 20:22:50 +02:00
Richard Newton
70a1fbee7a Fix running tests from cmake on linux. 2013-08-17 14:39:38 +01:00
Richard Newton
e1b2b649fb Merge branch 'master' of https://github.com/zeromq/libzmq 2013-08-17 14:23:42 +01:00
Richard Newton
a83baa9b0b Fix up threading code from port tests to windows. 2013-08-17 14:23:22 +01:00
Richard Newton
7f74fc7c99 Port tests to windows and add to cmake build. 2013-08-17 13:43:45 +01:00
Ian Barber
eccfede10d Merge pull request #623 from ricnewton/master
Fix compile error on windows.
2013-08-08 11:42:53 -07:00
Richard Newton
e16a6af0c7 Fix compile error on windows. 2013-08-08 17:27:49 +01:00
Ian Barber
749c391b34 Merge pull request #622 from ckamm/req-strict
Rename ZMQ_REQ_SEND_RESETS -> ZMQ_REQ_STRICT.
2013-08-03 12:42:53 -07:00
Christian Kamm
423ca36b17 Rename ZMQ_REQ_SEND_RESETS -> ZMQ_REQ_STRICT.
It defaults to enabled. Switch it off to be able to send a new message
before the previous reply has been received.
2013-08-03 14:35:18 +02:00
Pieter Hintjens
fe30cc6d99 Merge pull request #619 from ckamm/req-send-resets
Add ZMQ_REQ_SEND_RESETS option.
2013-08-03 02:44:53 -07:00
Martin Hurton
9f4526f59a Merge pull request #621 from hintjens/master
Added note to clarify policy for embedded apps
2013-07-29 06:11:03 -07:00
Pieter Hintjens
39ddc695bc Added note about tivotisation 2013-07-29 10:42:15 +02:00
Christian Kamm
f5c59556bd REQ: Unset reply_pipe if it terminates.
* Fixes a terminate() call on a dangling pointer in the SEND_RESETS
  case.
* Fixes recv_reply_pipe() never receiving a message once the pipe it is
  waiting on is terminated.
2013-07-29 09:35:15 +02:00
Christian Kamm
a0cc87a9d9 Add ZMQ_REQ_SEND_RESETS option.
This allows making a new request on a REQ socket by sending a new
message. Without the option set, calling send() after the first message
is done will continue to return an EFSM error.

It's useful for when a REQ is not getting a response. Previously that
meant creating a new socket or switching to DEALER.
2013-07-28 11:43:38 +02:00
Ian Barber
637f794193 Merge pull request #620 from ckamm/req-id
Add ZMQ_REQ_REQUEST_IDS option.
2013-07-26 15:41:29 -07:00
Christian Kamm
b9646f2aac Add ZMQ_REQ_REQUEST_IDS option.
* Documentation:
The default behavior of REQ sockets is to rely on the ordering of messages
to match requests and responses and that is usually sufficient. When this option
is set to 1, the REQ socket will prefix outgoing messages with an extra frame
containing a request id. That means the full message is (request id, 0,
user frames...). The REQ socket will discard all incoming messages that don't
begin with these two frames.

* Behavior change: When a REQ socket gets an invalid reply, it used to
  discard the message and return EAGAIN. REQ sockets still discard
  invalid messages, but keep looking at the next one automatically
  until a good one is found or there are no more messages.
* Add test_req_request_ids.
2013-07-26 21:38:21 +02:00
Ian Barber
6473dfd8f4 Merge pull request #617 from hurtonm/zap_updates
Zap updates
2013-07-18 03:26:21 -07:00
Martin Hurton
4a5358f4d0 Implement ZAP for NULL mechanism 2013-07-18 10:59:39 +02:00
Martin Hurton
53bc53da04 Update PLAIN mechanism to the latest ZAP revision 2013-07-18 10:59:34 +02:00
Martin Hurton
d65231be1c Update CURVE mechanism to the latest ZAP revision 2013-07-18 10:59:31 +02:00
Martin Hurton
7541debe6d Add get_peer_ip_address utility function
The functon returns string representation of peer's
IP address. We will need this to update ZAP implementation.
2013-07-18 10:41:31 +02:00
Ian Barber
4944095262 Merge pull request #615 from hintjens/master
Last step in test_spec_req is still failing; disabled it.
2013-07-15 00:15:55 -07:00
Pieter Hintjens
1068bc0795 Merge pull request #616 from steve-o/master
Add static libraries to CMake, minor housekeeping.
2013-07-14 14:48:17 -07:00
Steven McCoy
409721b9d2 Add CMake support for static libraries. 2013-07-14 13:58:46 -04:00
Steven McCoy
21fe600848 Move CMake dependencies together. 2013-07-14 13:36:30 -04:00
Steven McCoy
ae86c56d74 README file moved to GitHub format and extension, drop from packaging and default to NEWS file for popup. 2013-07-14 13:26:55 -04:00
Pieter Hintjens
d46c2ee2fc Disabled last step in test_spec_req so build can complete 2013-07-14 13:04:31 +02:00
Pieter Hintjens
4fb004f59b Merge pull request #614 from ckamm/fix-spec-req-fail
Fix intermittent failure in test_spec_req.
2013-07-14 03:00:06 -07:00
Christian Kamm
7de23c0c8d Fix intermittent failure in test_spec_req.
There still is a problem when a stale peer's message
arrives at the REQ just after a request was sent to that peer.
2013-07-14 11:57:15 +02:00
Pieter Hintjens
bccf3d6126 Merge pull request #613 from ckamm/coding-style-spec-tests
Fix coding style in spec tests.
2013-07-14 02:32:20 -07:00
Pieter Hintjens
93b9f9021c Merge pull request #608 from ckamm/req-drops-unwanted
REQ sockets drop replies from unasked peers.
2013-07-14 02:30:21 -07:00
Christian Kamm
bbc9a61197 Fix coding style in spec tests. 2013-07-14 08:33:33 +02:00
Christian Kamm
c56d797bf9 REQ sockets drop replies from unasked peers.
* Add lb_t::sendpipe() that returns the pipe that was used for sending,
  similar to fq_t::recvpipe().
* Add forwarder functions to dealer_t to access these two.
* Add logic to req_t to ignore replies on pipes that are not the one
  where the request was sent.
* Enable test in test_spec_req.
2013-07-14 07:55:47 +02:00
Pieter Hintjens
524bd7ac76 Merge pull request #612 from ulikoehler/markdown
Converted README to markdown
2013-07-13 16:27:41 -07:00
Uli Köhler
6bf4ffe727 Converted README to markdown + added travis build img 2013-07-14 00:55:40 +02:00
Pieter Hintjens
7560910f50 Merge pull request #611 from pijyoi/master
update Makefile to include new files
2013-07-13 10:39:06 -07:00
KIU Shueng Chuan
0f28b72914 update to include stream.cpp and curve related 2013-07-13 14:31:46 +08:00
Ian Barber
5ac19647d9 Merge pull request #610 from hintjens/master
Problem: new spec test cases don't all work
2013-07-08 04:12:06 -07:00
Pieter Hintjens
9ca6898f24 Got new test cases working with libzmq
* disabled the specific tests that do not work (yet) on libzmq
* cleaned up one source (test_spec_rep.c) but the others need similar work
* added sleep in test_spec_rep to allow connects time to happen; this would
  not be needed if we connected out to the REP peers instead in from them,
  but I didn't want to change the logic of the test code.
2013-07-07 12:49:24 +02:00
Pieter Hintjens
08622a7788 Merge pull request #609 from ckamm/tests
Make pipeline/reqrep tests try tcp:// endpoints.
2013-07-05 15:36:14 -07:00
Christian Kamm
dfba19c4b6 Make pipeline/reqrep tests try tcp:// endpoints.
The inproc:// endpoints sometimes use different code paths so
testing with regular tcp:// endpoints as well can show different
issues.
2013-07-05 17:58:01 +02:00
Pieter Hintjens
5038ef74b5 Merge pull request #606 from ckamm/master
Add tests for Request-Reply and Pipeline pattern sockets.
2013-07-05 08:18:41 -07:00
Christian Kamm
8fd163cf5c Add tests for PUSH/PULL sockets. 2013-07-05 15:20:42 +02:00
Pieter Hintjens
e093bd9923 Merge pull request #607 from cjuniet/master
[LIBZMQ-544] Fix compilation errors with Clang
2013-07-03 15:43:09 -07:00
Christophe Juniet
7b7f7e4ebd Fix compilation warnings on unsigned comparisons.
Fix two unsigned comparisons to zero or more being always true. Clang
won't compile this with -Werror.
2013-07-03 22:30:48 +02:00
Christian Kamm
798b394087 Add tests for Request-Reply pattern sockets.
* See http://rfc.zeromq.org/spec:28/REQREP
* Not all testable statements are covered.
* At this point, there are several failures:
  - test_spec_req: The REQ socket does not correctly discard messages
    from peers that are not currently being talked to.
  - test_spec_dealer/router: On disconnect, the queues seem to not be
    emptied. The DEALER can still receive a message the disconnected
    peer sent, the ROUTER can still send to the identity of the dis-
    connected peer.
2013-07-02 15:04:31 +02:00
Pieter Hintjens
78e47912d2 Merge pull request #605 from ricnewton/master
Fix tab/space formatting issue
2013-07-01 04:41:46 -07:00
Richard Newton
998610602e Fix tab/space formatting issue 2013-07-01 12:10:57 +01:00
Ian Barber
5a30022045 Merge pull request #603 from ricnewton/master
Add monitor event for when monitoring is stopped so we can unblock any sockets waiting on monitor socket.
2013-07-01 04:08:25 -07:00
Ian Barber
a3e16c18b1 Merge pull request #604 from ricnewton/cmake_fix
Fix cmake build
2013-07-01 04:07:44 -07:00
Richard Newton
01dd6eb110 Fix cmake build
Fix build on windows, uint isn't a standard type, unsigned int is.
2013-07-01 11:52:39 +01:00
Richard Newton
f6e972d546 Fix montior tests to handle the monitor stopped event correctly 2013-07-01 10:31:57 +00:00
Richard Newton
d4d23caf32 Add new socket monitor event for when socket monitoring is stopped. 2013-07-01 11:00:46 +01:00
Pieter Hintjens
1cfee8d1e7 Merge pull request #601 from leewoosung/hotfixes/patched
[LIBZMQ-541] pub socket sending fail issue
2013-07-01 02:14:07 -07:00
Pieter Hintjens
2a4aef9223 Merge pull request #602 from hurtonm/master
Implement socket type checking
2013-07-01 02:06:29 -07:00
Martin Hurton
783bb890a9 Check socket types during mechanism handshake 2013-07-01 10:12:08 +02:00
ganesh.vr
4671108e57 LIBZMQ-541 issue fix 2013-07-01 15:57:06 +09:00
Pieter Hintjens
58b1082467 Merge pull request #600 from hurtonm/master
Set socket buffers before establishing TCP connection
2013-06-29 23:56:04 -07:00
Martin Hurton
afe9afa2a5 Set socket buffers before establishing TCP connection
The window scale option carried in SYN segment is computed from socket's
receive buffer size. So we need to set this buffer size before calling
connect or bind.
2013-06-30 07:30:51 +02:00
Ian Barber
11947b1ccb Merge pull request #597 from hintjens/master
Problem: working with binary keys is painful
2013-06-29 09:36:50 -07:00
Ian Barber
a71d64ab95 Merge pull request #599 from hurtonm/master
Minor code refactoring
2013-06-29 09:34:47 -07:00
Martin Hurton
aef2171e83 Make last_endpoint attribute of socket object 2013-06-29 17:26:13 +02:00
Martin Hurton
c9bdb893f8 Use generic session class whenever possible 2013-06-29 12:24:36 +02:00
Pieter Hintjens
7460d00bac Merge pull request #598 from hurtonm/master
Use generic session class whenever possible
2013-06-29 02:36:30 -07:00
Martin Hurton
fd7e9b8c46 Use generic session class whenever possible 2013-06-29 11:27:03 +02:00
Pieter Hintjens
7041770108 Added Z85 support
The use of binary for CURVE keys is painful; you cannot easily copy
these in e.g. email, or use them directly in source code. There are
various encoding possibilities. Base16 and Base64 are not optimal.
Ascii85 is not safe for source (it generates quotes and escapes).

So, I've designed a new Base85 encoding, Z85, which is safe to use
in code and elsewhere, and I've modified libzmq to use this where
it also uses binary keys (in get/setsockopt).

Very simply, if you use a 32-byte value, it's Base256 (binary),
and if you use a 40-byte value, it's Base85 (Z85).

I've put the Z85 codec into z85_codec.hpp, it's not elegant C++
but it is minimal and it works. Feel free to rewrap as a real class
if this annoys you.
2013-06-28 22:10:22 +02:00
Martin Hurton
1beec5e960 Merge pull request #596 from hintjens/master
Problem: mechanisms are lagging behind specs
2013-06-28 05:05:54 -07:00
Pieter Hintjens
76df045950 Return EINVAL when trying to use CURVE without libsodium 2013-06-28 12:04:01 +02:00
Martin Hurton
357a9c45fb Simplify ZMQ_STREAM socket implementation, part II 2013-06-28 11:44:34 +02:00
Pieter Hintjens
7832addd20 Updated security mechanisms to use variable-length commands
RFC23, RFC24, RFC26 now use variable-length command names that
end in null octet (valid C strings) instead of fixed-length
space padded strings.
2013-06-28 11:42:54 +02:00
Pieter Hintjens
ba1ae7d639 Merge pull request #595 from hurtonm/master
Another ZMQ_STREAM simplification
2013-06-28 02:28:23 -07:00
Martin Hurton
7b27c125dc Simplify ZMQ_STREAM socket implementation, part II 2013-06-28 11:24:14 +02:00
Pieter Hintjens
dd14d4e01b Minor whitespace fixes in man page 2013-06-28 10:16:56 +02:00