1. 03 May, 2012 1 commit
    • Ian Barber's avatar
      Patch from Mato that fixes a subtle connect bug: EAGAIN was being used as a… · 1075005b
      Ian Barber authored
      Patch from Mato that fixes a subtle connect bug: EAGAIN was being used as a translation value for EINPROGRESS, thus
      shadowing a real EAGAIN return value from the OS.  This caused later
      assertions of "Invalid argument" in stream_engine.cpp when it attempted to
      use a socket which was not connected.
      
      I also add EINTR to mean EINPROGRESS, as per the POSIX and FreeBSD
      documentation which specifies that a connect() call interrupted due to a
      signal will complete asynchronously.
      Signed-off-by: 's avatarMartin Lucina <martin@lucina.net>
      1075005b
  2. 30 Apr, 2012 4 commits
  3. 29 Apr, 2012 3 commits
    • Martin Hurton's avatar
      Do not crash when multiple peers connect to PAIR socket · d8470949
      Martin Hurton authored
      When more then one peer connected to a ZMQ_PAIR socket,
      an application aborted due to assertion failure.
      This patch changes the ZMQ_PAIR socket behaviour so that
      it rejects any further connection requests.
      d8470949
    • Martin Hurton's avatar
      Fix decoder to properly handle large messages · 5227f676
      Martin Hurton authored
      The decoder did not properly decode large messages
      on systems where sizeof (size_t) < sizeof (uint64_t).
      5227f676
    • Martin Hurton's avatar
      Fix issue #264 · 776563fc
      Martin Hurton authored
      Before this patch, the stream engine terminated itself
      whenever it had detected an IO error. If this happened
      when sending a message, the engine lost all
      in-flight messages, messages waiting to be decoded,
      and the last decoded message that had not been accepted,
      if there was one.
      
      The new behaviour is to terminate the engine only after
      the input error has been detected and the last decoded
      776563fc
  4. 28 Apr, 2012 1 commit
  5. 27 Apr, 2012 4 commits
  6. 26 Apr, 2012 4 commits
  7. 25 Apr, 2012 4 commits
  8. 24 Apr, 2012 4 commits
    • Martin Hurton's avatar
      Rename XREP/XREQ to ROUTER/DEALER in tests · 873abdd2
      Martin Hurton authored
      873abdd2
    • Martin Hurton's avatar
      xsub: fix memory leak · df5344bb
      Martin Hurton authored
      The implementation of the send call for XSUB socket failed
      to release and initialise empty message when duplicate
      subscription was detected.
      df5344bb
    • Ian Barber's avatar
      Merge pull request #322 from tranthamp/master · 016df8e8
      Ian Barber authored
      Atomic operations for armv7a
      016df8e8
    • Patrick Trantham's avatar
      Implement atomic operations for armv7a · 135fdab0
      Patrick Trantham authored
      This commit implements atomic operations for the armv7a architecture
      using gcc inline assembly.  This offers higher performance compared to
      pthread mutexes.
      
      Tested on an am3517 evm, clocked at 600MHz:
      
      ./inproc_thr 200 1000000
      ------------------------
      53-60K messages / sec, pthread mutexes
      73-90K messages / sec, assembly atomic ops
      
      ./inproc_lat 200 1000000
      ------------------------
      average latency: 42.234 [us], pthread mutexes
      average latency: 35.496 [us], assembly atomic ops
      135fdab0
  9. 21 Apr, 2012 9 commits
    • Pieter Hintjens's avatar
      Merge pull request #321 from shripchenko/master · c120f02d
      Pieter Hintjens authored
      add process_commands() to the beginning of zmq_connect() and zmq_bind()
      c120f02d
    • Sergey KHripchenko's avatar
      add process_commands() to the beginning of zmq_connect() and zmq_bind() · f858321c
      Sergey KHripchenko authored
      I believe there was a conception that zmq_connect() and zmq_bind() will be called
      only at the socket creation time and therefore don't need it.
      Now it is not true anymore.
      f858321c
    • Pieter Hintjens's avatar
      Merge pull request #320 from shripchenko/master · b9fb9198
      Pieter Hintjens authored
      ZMQ BUG FOUND + fixes for zmq_unbind() / zmq_disconnect() usage corner cases
      b9fb9198
    • Sergey KHripchenko's avatar
      fixes for zmq_unbind() / zmq_disconnect() usage corner cases · 057fab09
      Sergey KHripchenko authored
      1. when we call zmq_bind()/zmq_connect() to create endpoint
      we send ourselfs(through launch_child()) command to process_own(endpoint)
      (and add it to own_t::owned)
      in the application thread we could call zmq_unbind() / zmq_disconnect() _BEFORE_
      we run process_own() in ZMQ thread and in this situation we will be unable to find it in
      own_t::owned. in other words own_t::owned.find(endpoint) will not be deleted but it will be deleted from
      socket_base_t::endpoints.
      
      2. when you zmq_unbind() the lisnening TCP/IPC socket was terminated only in destructor...
      so the whole ZMQ_LINGER time listening TCP/IPC socket was able to accept() new connections
      but unable to handle them.
      
      this all geting even worse since unfortunately zmq has a bug and '*_listener_t' object not terminated
      untill the socket's zmq_close().
      AT LEAST FOR PUSH SOCKETS.
      Everything is ok for SUB sockets.
      
      Easy to reproduce without my fix:
      
      zmq_socket(PUSH)
      zmq_bind(tcp);
      // connect to  it from PULL socket
      zmq_unbind(tcp);
      
      sleep(forever)
      
      // netstat -anp | grep 'tcp listening socket'
      
      With my fix you could see that after zmq_unbind(tcp) all previously connected tcp sessions
      will not be finished untill the zmq_close(socket) regardless of ZMQ_LINGER value.
      
      (*_listener_t terminates all owned session_base_t(connect=false) and they call pipe_t::terminate()
      which in turn should call session_base_t::terminated() but this never happens)
      057fab09
    • Sergey KHripchenko's avatar
      added zmq_unbind() / zmq_disconnect() test script. · 4f668ad6
      Sergey KHripchenko authored
      it works but rises very serious questions.
      
      Please add license header by your choice.
      This file for 99% resemble crossroads-io/tests/shutdown.cpp
      4f668ad6
    • Sergey KHripchenko's avatar
      spaces deleted · 74ae19ac
      Sergey KHripchenko authored
      74ae19ac
    • Pieter Hintjens's avatar
      Merge pull request #319 from shripchenko/master · 952127df
      Pieter Hintjens authored
      fix for: [zeromq-dev] head builds again but two failing tests
      952127df
    • Sergey KHripchenko's avatar
      small wording change · 06b2eae8
      Sergey KHripchenko authored
      06b2eae8
    • Sergey KHripchenko's avatar
      stupid bug. I feel ashamed ^) · 2faa4c48
      Sergey KHripchenko authored
      2faa4c48
  10. 20 Apr, 2012 3 commits
  11. 19 Apr, 2012 1 commit
  12. 18 Apr, 2012 2 commits