1. 09 Aug, 2018 4 commits
  2. 23 Jun, 2018 1 commit
  3. 28 May, 2018 1 commit
  4. 27 May, 2018 1 commit
  5. 26 May, 2018 2 commits
  6. 22 May, 2018 1 commit
  7. 18 May, 2018 1 commit
  8. 14 May, 2018 2 commits
    • Luca Boccassi's avatar
      Problem: ZMTP 3.1 PING Context not implemented · b331caad
      Luca Boccassi authored
      Solution: if a PING message contains a context, echo it back in the
      PONG message. In order to do so, create the PONG message when PING
      is received and store it in the engine.
      After the PING the engine goes straight to encoding and sending, so
      there can always be at most one pending PING.
      Add tests for various contexts.
      b331caad
    • Luca Boccassi's avatar
      Problem: heartbeat command parsing does not check command name size · 5482b1ca
      Luca Boccassi authored
      Solution: treat the first byte of the command body as the size of the
      command name, rather than as an id, to comply with ZMTP 3.1.
      This was not an actual problem at runtime since both heartbeat
      commands have a size of 4, which was treated like an id.
      But once SUBSCRIBE/UNSUBSCRIBE get implemented it needs to be checked.
      5482b1ca
  9. 13 May, 2018 1 commit
  10. 12 Mar, 2018 1 commit
    • Sergey Kachanovskiy's avatar
      Partial fix for issue 2963, removed invalid casts from fd_t to int (#2984) · 9c748f1b
      Sergey Kachanovskiy authored
      * Fixes issue 2963, ref stream_engine.cpp:981
      
      * Fixes issue 2963, ref socks_connecter.cpp:158
      
      * Fixes issue 2963, ref tcp_listener.cpp:144
      
      * Fixes issue 2963, ref tcp_connecter.cpp:423
      
      * Fixes issue 2963, ref socks_connecter.cpp:436
      
      * Fixes issue 2963, ref tcp_listener.cpp:179
      
      * Fixes issue 2963, ref tcp_listener.cpp:268
      
      * Fixes issue 2963, ref tcp_connecter.cpp:160
      9c748f1b
  11. 05 Mar, 2018 1 commit
    • Stefan Kaes's avatar
      Problem: enormous memory increase due to zero copy decoding · fcbd2a57
      Stefan Kaes authored
      The zero copy decoding strategy implemented for 4.2.0 can lead to a large
      increase of main memory usage in some cases (I have seen one program go up to
      40G from 10G after upgrading from 4.1.4). This commit adds a new option to
      contexts, called ZMQ_ZERO_COPY_RECV, which allows one to switch to the old
      decoding strategy.
      fcbd2a57
  12. 02 Feb, 2018 1 commit
  13. 22 Oct, 2017 1 commit
  14. 21 Oct, 2017 1 commit
  15. 03 Oct, 2017 1 commit
    • Christopher Hall's avatar
      add __FreeBSD__ to ifdefs · 997825bd
      Christopher Hall authored
      On FreeBSD the sysmbol __FreeBSD_kernel__ is only defines if a
      specific param.h file is included, unlike Debian/kFreeBSD where this
      symbol is always defined.  So also compile the FreeBSD specific code
      if __FreeBSD__ is defined for FreeBSD 11 & 12 compatibility.
      Signed-off-by: 's avatarChristopher Hall <hsw@ms2.hinet.net>
      997825bd
  16. 19 Sep, 2017 2 commits
  17. 07 Sep, 2017 2 commits
  18. 06 Sep, 2017 1 commit
  19. 18 Aug, 2017 4 commits
  20. 08 Aug, 2017 1 commit
    • Simon Giesecke's avatar
      Problem: ZAP status codes != 200 do not result in an appropriate monitor event (#2665) · a6cef4ef
      Simon Giesecke authored
      * Problem: missing test for status code 300, inadequate assertion for status code 500
      
      Solution: add test, change assertion (currently test fails)
      
      * Problem: gcc compiler error deprecated conversion from string constant
      
      Solution: declare variable as const
      
      * Problem: in case of ZAP handler returning a status code other than 200, no appropriate event is emitted
      
      Solution: immediately emit event after receiving reply from ZAP handler
      
      * Problem: endpoint address is not included in zap-reply monitor event
      
      Solution: added functions to retrieve endpoint address in zmq::i_engine and zmq::session_base_t
      removed unused code block in zmq::stream_engine_t::next_handshake_command
      
      * Problem: wrong formatting
      
      Solution: fix formatting
      
      * Problem: test fails because of EPIPE
      
      Solution: add EPIPE/ECONNRESET/ECONNAGAIN handling for more test cases
      a6cef4ef
  21. 04 Aug, 2017 1 commit
  22. 03 Aug, 2017 1 commit
    • Simon Giesecke's avatar
      Replace console output by monitoring events for curve security issues (#2645) · 5d4e30eb
      Simon Giesecke authored
      * Fixing #2002 one way of doing it
      
       * Mechanisms can implement a new method `error_detail()`
       * This error detail have three values for the moment: no_detail
       (default), protocol, encryption.
          + generic enough to make sense for all mechanisms.
          - low granularity level on information.
      
      * Fixing #2002: implementation of the error details
      
      The ZMQ_EVENT_HANDSHAKE_FAILED event carries the error details
      as value.
      
      * Removed Microsoft extenstion for enum member access
      
      This was leading to compilation error under linux.
      
      * Adaptation of CURVE test cases
      
      * Monitoring event: changed API for detailed events
      
      Removed ZMQ_EVENT_HANDSHAKE_FAILED and replaced it by:
      - ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL,
      - ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL,
      - ZMQ_EVENT_HANDSHAKE_FAILED_ENCRYPTION
      
      Adaptation of text case `security_curve`
      
      * Removed event value comparison
      
      This was introduced for the previous API model adaptation
      
      * Removed the prints in std output and added missing details
      
      `current_error_detail` was not set in every protocol error cases
      
      * Fixed initialization of current_error_detail
      
      * Fixed error in greeting test case
      
      The handshake failure due to mechanism mismatch in greeting is actually
      a protocol error. The error handling method consider it like so and
      send a protocol handshake failure monitoring event instead of no_detail.
      
      Fixed the test_security_curve expectation as well.
      
      * Upgraded tests of monitoring events
      
      The tests check the number of monitoring events received
      
      * Problem: does not build under Linux or without ZMQ_DRAFT_API
      
      Solution:
      - properly use ZMQ_DRAFT_API conditional compilation
      - use receive timeouts instead of Sleep
      
      * Problem: duplicate definition of variable 'timeout'
      
      Solution: merged definitions
      
      * Problem: inconsistent timing dependencies
      
      Solution: reduce timing dependency by using timeouts at more places
      
      * Problem: assertion failure under Linux due to unexpected monitor event
      
      Solution: output event type to aid debugging
      
      * Problem: erroneous assertion code
      
      * Problem: assertion failure with a garbage server key due to an extra third event
      
      Solution: changed assertion to expect three events (needs to be checked)
      
      * Problem: extra include directive to non-existent file
      
      Solution: removed include directive
      
      * Problem: assertion failure on appveyor for unknown reason
      
      Solution: improve debug output
      
      * Problem: no build with libsodium and draft api
      
      Solution: add build configurations with libsodium and draft api
      
      * Problem: assertion failure on CI
      
      Solution: change assertion to reflect actual behaviour on CI (at least temporarily)
      
      * Problem: error in condition in assertion code
      
      * Problem: assertion failure on CI
      
      Solution: generalize assertion to match behavior on CI
      
      * Problem: assertion failures on CI
      
      Solution: removed inconsistent assertion on no monitor events before flushing
      improved debuggability by converting function into macro
      
      * Problem: diverging test code for three analogous test cases with garbage key
      
      Solution: extract common code into function
      
      * Problem: does not build without ZMQ_BUILD_DRAFT_API
      
      Solution: introduce dummy variable
      
      * Attempt to remove workaround regarding ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL again
      
      * Problem: EAGAIN error after handshake complete if there is no more data in inbuffer
      
      Solution: Skip tcp_read attempt in that case
      
      * Problem: handshaking event emitted after handshaking failed
      
      Solution: use stream_engine_t::handshaking instead of mechanism_t::status() to determine whether still handshaking
      
      * Include error code in debug output
      
      * Improve debugging output: output flushed events
      
      * Split up ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL into ZMQ_EVENT_HANDSHAKE_FAILED_ZMTP and ZMQ_EVENT_HANDSHAKE_FAILED_ZAP
      
      * Fixed compilation without ZMQ_BUILD_DRAFT_API
      
      * Renamed ZMQ_EVENT_HANDSHAKE_SUCCEED to ZMQ_EVENT_HANDSHAKE_SUCCEEDED for language consistency
      
      * Renamed ZMQ_EVENT_HANDSHAKE_SUCCEED to ZMQ_EVENT_HANDSHAKE_SUCCEEDED for language consistency
      
      * Renamed ZMQ_EVENT_HANDSHAKE_SUCCEED to ZMQ_EVENT_HANDSHAKE_SUCCEEDED for language consistency
      
      * Fixed assert_monitor_event (require event instead of allowing no event)
      Reverted erroneous change to handshaking condition
      Renamed test_wrong_key to test_garbage_key
      Generalized assumption in test_garbage_key to allow for ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL with error == EPIPE
      
      * Better isolate test cases from each other by providing a fresh context & server for each
      
      * Added diagnostic output
      
      * Changed assertion to reflect actual behavior on CI
      
      * Fixed formatting, observe maximum line length
      
      * Fixed formatting, observe maximum line length
      
      * Increase timeout to check if this fixes valgrind run
      
      * Close server with close_zero_linger
      
      * Increase timeout to check if this fixes valgrind run
      
      * Increase timeout to check if this fixes valgrind run
      
      * Generalize assertion to also work with valgrind
      
      * Fixed formatting
      
      * Add more diagnostic output
      
      * Generalize assertion to also work with valgrind
      5d4e30eb
  23. 27 Mar, 2017 1 commit
  24. 04 Jan, 2017 1 commit
    • Luca Boccassi's avatar
      Problem: peer can close connection before SO_NOSIGPIPE is set · 31a3a068
      Luca Boccassi authored
      Solution: setsockopt returns EINVAL if the connection was closed by
      the peer after the accept returned a valid socket. This is a valid
      network error and should not cause an assert.
      To handle this we have to extract the setsockopt from the stream
      engine, as there's no clean way to return an error from the
      constructor. Instead, try to set this option before creating the
      engine in the callers, and return immediately as if the accept
      had failed to avoid churn. Do the same for the connect calls by
      setting the option in open_socket, so that the option for that
      case is set even before connecting, so there's no possible race
      condition.
      Since this has to be done in 4 places (tcp/ipc listener, socks
      connecter and open_socket) add an utility function in ip.cpp.
      Fixes #1442
      31a3a068
  25. 01 Jan, 2017 2 commits
    • Vincent Tellier's avatar
      Handshake events null pointer fix · 7e36db07
      Vincent Tellier authored
      The mechanism is instanciated during the handshake itself, when and
      error happen before this, the error method shall work anyway.
      An error handling with a NULL mechanism means the handshake fail, so the
      handshake failure event is also raised in this case.
      7e36db07
    • Vincent Tellier's avatar
      Fixed issue #2227 second part · ffb31dca
      Vincent Tellier authored
       - removed the previously added encryption_error, less changes less bug
       - handshake fail is now signaled when an error happen while the
         mechanism is still hanshaking
      ffb31dca
  26. 30 Dec, 2016 3 commits
    • Luca Boccassi's avatar
      Problem: new DRAFT monitor events returned even without --enable-draft · c0e2bc4e
      Luca Boccassi authored
      Solution: wrap the event triggering in the DRAFT ifdef as well as the
      defines. This ensures that the event are returned only if the
      library was built with DRAFTs enabled.
      
      Also update the test case to expect the new events since it uses
      the catch-all mask. Although the sequence of event is different and
      this might be considered as an API breakage, using the catch-all
      ZMQ_EVENT_ALL mask implies that, well, all events are monitored so
      it's normal that new ones will be added.
      Users that don't want this kind of behaviour to change can simply
      monitor only the event that they care about.
      c0e2bc4e
    • Vincent Tellier's avatar
      Code formatting + reverted hard error handshake fail · 48bc75e8
      Vincent Tellier authored
       - Moved new events in draft section + added to zmq_draft.h
       - Removed the remainning tabs
       - Reverted the hard error (back to soft error) in curve_server.cpp
      
      => The feature doesn't works anymore
      48bc75e8
    • Vincent Tellier's avatar
      Fixed issue #2227 · b6e9e0c2
      Vincent Tellier authored
      Added two new monitoring events:
       - ZMQ_EVENT_HANDSHAKE_SUCCEED is raised once the encryption handshake succeed
       - ZMQ_EVENT_HANDSHAKE_FAILED is raised when it failed
      Both events are raised on server and client side.
      b6e9e0c2
  27. 15 Dec, 2016 1 commit