summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-04-15Minor improvement to error reportingMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-15Report EMFILE/ENFILE from xs_socket()Martin Sustrik
This patch propoagates the error from signaler and mailbox initialisation up the stack. To achieve this signaler and mailbox classes were re-written is C-like syntax. Finally, shutdown_stress test now ignores EMFILE/ENFILE errors. Thus, the tests should pass even on OSX which sets the max number of file descriptors pretty low by default. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-14Separate subscription forwarding from SUB-side filteringMartin Sustrik
- subscription forwarding is handled by XSUB socket - filtering is handled by SUB sockets - subscriptions are decoupled from filter engines - filter doesn't have to be able to enumarate the subscriptions (no sf_enumerate function) Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-14Define _GNU_SOURCE in addition to the __BSD_VISIBLE on freebsd-like hostsAndrew W. Nosenko
Define _GNU_SOURCE in addition to the __BSD_VISIBLE on the freebsd-like hosts. It made in hope to cover cases and obtain the full power of underlying kernel on "hybrid" systems like Debian GNU/kFreeBSD, when GLibc (or derived) library lives on top of FreeBSD kernel. On the "real" FreeBSD it only enables getline(3), and therefore, should not hurt. * configure.ac: Define _GNU_SOURCE in addition to the __BSD_VISIBLE for cover GLibc (or derived) on top of FreeBSD kernel cases, as it is in Debian GNU/kFreeBSD case.
2012-04-14Check for SO_NOSIGPIPE availability instead of OS nameAndrew W. Nosenko
* src/stream_engine.cpp (stream_engine_t::stream_engine_t): Use #ifdef SO_NOSIGPIPE instead of #if defined XS_HAVE_OSX || defined XS_HAVE_FREEBSD
2012-04-14If available, use MSG_NOSIGNAL for send()Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-14Checking for correct timeout in the test suite improvedMartin Sustrik
This patch introduces 1/2 second tolerance for the timeouts in the tests. This will hopefully make tests not fail even on slow or heavily loaded machines. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-14Set options on new sockets in systematic mannerMartin Sustrik
This patch consolidates the up-to-now scattered code that sets different options on newly created sockets. There are open_socket and open_tcp_socket functions that do the tuning automatically. In case the socket is not created but got from elsewhere (such as accept() call) there are tune_socket and tune_tcp_socket functions that will do the tuning. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-12Memory allocation bug fixed in prefix filterMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-12Accumulated cruft removed from prefix_filter_tMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-11HANDLE_FLAG_INHERIT is set to 0 on internal socketsMartin Sustrik
On Windows, HANDLE_FLAG_INHERIT is equivalent to O_CLOEXEC on UNIX. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-11ETIMEDOUT is a valid error code here. Fixes intermittent assertion failure ↵Mikko Koppanen
on laggy networks
2012-04-10Fix a warning with SunStudio compilerMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-09Fix fd/handle conversion in /dev/poll poller codeGabriele Svelto
Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-04-09Fix /dev/poll detection on SolarisGabriele Svelto
The /dev/poll facility wasn't correctly recognized because of a missing header. The check was fixed and overhauled in the process. Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-04-08Set CLOEXEC flag on fds used by signalerMartin Sustrik
While TCP and IPC socket duplicates are correctly closed on fork+exec, file descriptors used for internal communication within libxs are not. This patch fixes the problem. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-08Handle insufficient resources on accept() decentlyMartin Sustrik
If accept() call fails due to insuffient OS resources the new connection is rejected. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-07Fix error handling in TCP and IPC connectersMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-07Fix identity exchange for inproc transportMartin Hurton
The socket connecting using the inproc transport never received the identity of the remote peer.
2012-04-06Flush identity message for inproc transportMartin Hurton
The scoket implementation for inproc transfer failed to flush identity message. The result was that the identity message was not delivered until after the user sent the first message. The identity message was never delivered if the user used the socket only to receive messages.
2012-04-06tcp_address: check address length before manipulating itMartin Hurton
2012-04-06EMTHREAD error code removedMartin Sustrik
libxs (as opposed to libzmq) requires at least one I/O thread per context. Thus, "no I/O thread available" error doesn't make sense anyome. This patch removes the code and the documentation. It keeps the definition of EMTHREAD itself for backward compatibility. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-06Verious warnings generated by SunStudio fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-06Andrew W. Nosenko added to AUTHORS fileMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-06Allow pipe_t::flush() to be called from pipe_t::terminate()Martin Sustrik
Previous patch have broken flushing a delimiter in pipe_t::terminate() function. This patch allows the flush to happen even if pipe state is set to 'terminated'. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-06Fix bogus typo in xs::pipe_t::flush()Andrew W. Nosenko
* src/pipe.cpp (flush): Fix bogus typo: '&&' was used instead of '||'
2012-04-06Changed project name in README references; ignore EXE files.Gonzalo Diethelm
2012-04-06Improved readability of README file.Gonzalo Diethelm
2012-04-05XS_PLUGIN and XS_FILTER implementationMartin Sustrik
This patch introduces following features: - XS_PLUGIN context option to add plugins to libxs - XS_FILTER option to switch between different filter types - Automatic loading of plug-ins is *not* implemented. From the implementation point of view: - standard prefix filter is implemented as a pluggable filter - trie_t and mtrie_t are joined into a single class - the code for 0MQ/3.1 compatibility is left in in the form of comments - new test for testing re-subscriptions is added Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-04Accept ECONNRESET from close()Martin Sustrik
Although not a POSIX behaviour, FreeBSD can fail with ECONNRESET. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-040MQ/2.1 wire format compatibility implementedMartin Sustrik
- XS_PROTOCOL option added - libxs ignores when unused flags are set to 1 (0MQ/2.1 bug) - compatibility tests added Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-04Define the XS_HAVE_* poller macros in a more robust wayGabriele Svelto
The existing code for definining the XS_HAVE_* macros for the polling mechanism may fail if the platform's `tr' command does not support the GNU syntax. Replacing the hand-made declaration with autoconf macros yields the same results on all platforms. Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-04-04Add README link for Github to render marked up versionMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-30Modified the configure.ac file according to autoconf best practicesGabriele Svelto
- Use consistent quoting in M4 macros - Use portable M4sh shell constructs where possible - More consistent indentation and line wrapping - Split lists of files or functions on multiple lines to simplify adding and removing elements from them Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-03-29Version and ABI bumped to 1.0.1v1.0.1Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-29Documentation updates for 1.0.1Martin Lucina
Signed-off-by: Martin Lucina <martin@lucina.net>
2012-03-28XS_KEEPALIVE options addedMartin Sustrik
This option allows to turn on TCP keepalives on the underlying connections. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-26Handle duplicate identities decentlyMartin Sustrik
When connection with duplicate identity arrives it is ignored. Till now it resulted in assertion. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-25Signaler's global event is now accessible by everyoneMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-25wireformat test addedPaul Colomiets
2012-03-24Fix race condition in find_endpointMartin Hurton
2012-03-24Fixed issue LIBZMQ-345 - race condition in ctx.socket/term allows segfaultPieter Hintjens
2012-03-24Fix command-line for running tests in READMEPaul Colomiets
Signed-off-by: Paul Colomiets <paul@colomiets.name>
2012-03-23Add long comment about security problem on Windows platformMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-23Ignore distorted timeouts on Windows in debug modeMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-23Error handling during connectMartin Sustrik
Error handling of asynchronous connect for IPC was incorrectly copied from TCP transport. This patch fixes the problem. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-20Make REQ session state machine aware of reconnectionsMartin Sustrik
On reconnections, state machine in req_session_t is reset to the initial state. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-20Send identities on reconnectMartin Sustrik
When reconnection happened, identity was not resent to the peer. Fixed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-20OpenVMS tests fixedMartin Sustrik
This patch takes into account that IPC transport is not supported on OpenVMS platform. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-20Reconnect test fixedMartin Sustrik
Reconnect test have run TCP reconnect test twice instead of doing one test for TCP and one for IPC. Fixed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>