1. 21 Sep, 2012 1 commit
  2. 07 Sep, 2012 3 commits
  3. 06 Sep, 2012 2 commits
    • Arthur O'Dwyer's avatar
      Add "#undef NDEBUG" to all tests. · cf20932d
      Arthur O'Dwyer authored
      This change makes sure that even if the tests are built in a
      "release" configuration (with optimizations and NDEBUG turned on),
      the assertions won't get compiled out of the tests themselves.
      
      The C standard guarantees that the most recent inclusion of
      <assert.h> is the one that counts, so it's important that the
      "#undef NDEBUG/#include <assert.h>" come as the last thing in
      the block of header files.
      
      "testutil.hpp" includes <assert.h>, so I've left <assert.h> out
      of any test that #includes "testutil.hpp", just for the sake of
      brevity.
      cf20932d
    • Pieter Hintjens's avatar
      Code cleanups · aaac4b84
      Pieter Hintjens authored
      aaac4b84
  4. 05 Sep, 2012 4 commits
  5. 04 Sep, 2012 2 commits
  6. 03 Sep, 2012 3 commits
  7. 02 Sep, 2012 4 commits
    • Ian Barber's avatar
      Merge pull request #418 from hurtonm/versioned_ztp · 9143ac51
      Ian Barber authored
      Introduce versioning into ZTP
      9143ac51
    • Martin Hurton's avatar
      Make ZMQ interoperate with ZMQ 2.x SUB sockets · d9307c9f
      Martin Hurton authored
      Since ZMQ 2.x does not support subscription forwarding, it's not
      possible to use ZMQ 2.x SUB socket to receive messages from a PUB
      socket.
      
      This patch adds some compatibility layer so that ZMQ 2.x SUB socket
      receives messages from PUB socket.
      d9307c9f
    • Martin Hurton's avatar
      Decouple encoder_t and decoder_t from session_base_t · dfc0222e
      Martin Hurton authored
      This patch introduces i_msg_sink and i_msg_source interfaces. This
      allows us to make message encoder and decoder more general.
      dfc0222e
    • Martin Hurton's avatar
      Extend ZTP/1.0 protocol · 1bca4f6f
      Martin Hurton authored
      The new protocol adds support for protocol version and  exchanges the
      socket type, so that the library can reject a connection when the
      sockets do not match.
      
      The protocol was designed so that it's possible to detect and fully
      support ZTP/1.0 peers.
      
      When a new connection is set up, peers exchange greeting messages. The
      greeting message encodes both the protocol verion and the socket type.
      The format of the greeting message is as follows:
      
          greeting    = tag1, adaptation, tag2, version, length, socket_type
          tag1        = BYTE / 0xff
          adaptation  = 8 BYTES
          tag2        = BYTE / 0x7f
          version     = BYTE / 1
          length      = BYTE / 1
          socket_type = BYTE
      
      The protocol does not define the value of adaptation field.
      
      When interoperability with ZTP/1.0 peers is required, the adaptaion
      encodes, in network byte order, the length of identity message increased
      by 1. When adaptaion consists of eight zeros, the current
      implementatatio of 0MQ 2.x closes the connection.
      
      This patch supports both ZTP/1.0 and new protocol.
      1bca4f6f
  8. 28 Aug, 2012 2 commits
  9. 27 Aug, 2012 6 commits
  10. 26 Aug, 2012 6 commits
  11. 25 Aug, 2012 1 commit
  12. 24 Aug, 2012 5 commits
    • Arthur O'Dwyer's avatar
      Fix monitor_event() to work at all. · 7fadd708
      Arthur O'Dwyer authored
      There are three versions of monitor_event(), all taking
      variadic arguments. The original code just has the first one
      creating a va_list and passing that va_list variadically to
      the second one... which creates a new va_list and passes it
      variadically to the third one... and of course everything
      blows up when we try to pull a non-va_list argument off the
      stack.
      
      The correct approach matches the C standard library's use
      of printf/vprintf, scanf/vscanf, and so on. Once you make
      a va_list, you must pass it only to functions which expect
      a va_list parameter.
      7fadd708
    • Arthur O'Dwyer's avatar
      Add a missing null-check, turning a segfault into an assertion. · 537a8027
      Arthur O'Dwyer authored
      Static analysis says:
      src\tcp_address.cpp(297): error V595: The 'res' pointer was utilized before it was verified against nullptr. Check lines: 297, 301.
      src\tcp_address.cpp(603): error V106: Implicit type conversion third argument 'full_bytes' of function 'memcmp' to memsize type.
      src\tcp_address.cpp(603): error V526: The 'memcmp' function returns 0 if corresponding buffers are equal. Consider examining the condition for mistakes.
      
      In fact the use of "memcmp" is correct, but the enclosing "if" isn't
      necessary, and the compiler is happier if "full_bytes" is a size_t.
      537a8027
    • Arthur O'Dwyer's avatar
      Fix a bug in pipe_t::flush(). · 6347d392
      Arthur O'Dwyer authored
      Static analysis says:
      src\pipe.cpp(193): error V547: Expression is always false. Probably the '||' operator should be used here.
      
      If flush() is called on a pipe whose state was
      "terminated" or "double_terminated", the programmer's
      intent was to return immediately. But in fact the
      two conditions can never be true simultaneously, so
      the early return never happens, and we may try to flush
      a terminated pipe anyway.
      6347d392
    • Arthur O'Dwyer's avatar
      Silence a compiler warning. · 0886b7a2
      Arthur O'Dwyer authored
      Static analysis says:
      src\fd.hpp(38): error V103: Implicit type conversion from memsize to 32-bit type.
      
      Adding the explicit cast should shut it up.
      0886b7a2
    • Arthur O'Dwyer's avatar
      The "count_" out-parameter is doubled instead of unchanged. · a48751b3
      Arthur O'Dwyer authored
      Static analysis says:
      src\zmq.cpp(489): error V220: Suspicious sequence of types castings: memsize -> 32-bit integer -> memsize. The value being casted: '* count_'.
      src\zmq.cpp(510): error V127: An overflow of the 32-bit 'nread' variable is possible inside a long cycle which utilizes a memsize-type loop counter.
      
      I've silenced the warning on line 489 and ignored the other.
      But also, it looks to me like there's a serious bug here: The
      out-parameter "count_" is never set to zero before we start
      incrementing it. So its final value will always be between
      1 and 2 times its initial value. The fix seems obvious.
      a48751b3
  13. 23 Aug, 2012 1 commit