1. 08 Dec, 2014 1 commit
  2. 07 Oct, 2014 2 commits
  3. 12 Sep, 2014 1 commit
    • Philip Withnall's avatar
      SPECIFIC: pseudotcp: Disable the Nagle algorithm by default · e836cd3a
      Philip Withnall authored
      For the specific case of osn-tunnel, having the Nagle algorithm enabled
      for pseudo-TCP does not make any sense, due to the (well studied)
      adverse combination of Nagling and delayed ACKs. osn-tunnel supports
      segment concatenation within pseudo-TCP, so Nagling would not have a
      large impact anyway.
      
      This patch is a temporary solution: ideally the PseudoTcpSocket:no-delay
      property should be propagated as a property (or some kind of
      setsockopt()-like interface) on NiceIOStream, so that applications can
      set it directly.
      e836cd3a
  4. 31 Aug, 2014 6 commits
    • Philip Withnall's avatar
      pseudotcp: Ensure shutdown member is not overwritten · 9527700b
      Philip Withnall authored
      Add a few safeguards to ensure that once priv->shutdown is set, it is
      not overwritten with a different value.
      9527700b
    • Philip Withnall's avatar
      pseudotcp: Fix EOS return from recv() in non-FIN–ACK mode · c8093821
      Philip Withnall authored
      Change pseudo_tcp_socket_recv() to return 0 if in non-FIN–ACK mode and
      the socket has been shut down. This makes the behaviour of FIN–ACK and
      non-FIN–ACK modes consistent.
      
      This is a behaviour change from before the introduction of FIN–ACK mode
      — previously, pseudo_tcp_socket_recv() would return -1 and set the
      ENOTCONN error if called after the socket had been shut down (i.e. after
      pseudo_tcp_socket_get_next_clock() had returned FALSE). The new
      behaviour will hopefully not break anything.
      c8093821
    • Philip Withnall's avatar
      pseudotcp: Ensure socket is closed after shutdown in non-FIN–ACK mode · 31c8c088
      Philip Withnall authored
      If the socket is closed (with pseudo_tcp_socket_close()) with FIN–ACK
      unsupported, it should transition to the CLOSED state when
      pseudo_tcp_socket_get_next_clock() returns FALSE (as that’s the
      old-style indication that the socket has closed).
      
      This is a behaviour change from before the introduction of FIN–ACK:
      previously, the socket would stay in the ESTABLISHED state. However,
      this should not have been easily detectable by consumers of the API,
      as pseudo_tcp_socket_is_closed() did not exist then.
      31c8c088
    • Philip Withnall's avatar
      pseudotcp: Add a PseudoTcpSocket:support-fin-ack property · 6f189b81
      Philip Withnall authored
      This allows FIN–ACK support to be disabled entirely. This is mostly for
      testing purposes, since TCP_OPT_FIN_ACK is negotiated when establishing
      the connection, and is disabled if the other side doesn’t support it.
      
      This includes an interoperability test.
      6f189b81
    • Philip Withnall's avatar
      pseudotcp: Add pseudo_tcp_socket_shutdown() support · 5c53b50e
      Philip Withnall authored
      This is analogous to the UNIX shutdown() function, allowing either or
      both sides of a pseudo-TCP connection to be shut down.
      5c53b50e
    • Philip Withnall's avatar
      pseudotcp: Shorten the TIME-WAIT state timeout dramatically · 0c7fac6c
      Philip Withnall authored
      The TIME-WAIT timeout is typically 2×MSL (on the order of 60 seconds),
      which is needed to be able to reject delayed segments from closed
      conversations. However, the underlying socket layer for pseudo-TCP takes
      care of channel numbering so that segments don’t end up being sent to
      closed conversations. Therefore, the TIME-WAIT state can be eliminated
      (by shortening the timeout). The code for the state is kept around so
      that the pseudo-TCP implementation matches the TCP specification
      correctly, which will simplify maintenance.
      0c7fac6c
  5. 22 Aug, 2014 13 commits
  6. 23 Jul, 2014 1 commit
  7. 17 Apr, 2014 2 commits
  8. 09 Apr, 2014 1 commit
  9. 02 Apr, 2014 1 commit
  10. 31 Mar, 2014 2 commits
  11. 27 Mar, 2014 1 commit
  12. 31 Jan, 2014 9 commits
    • Olivier Crête's avatar
    • Olivier Crête's avatar
      pseudotcp: Add list of unsent segment · 011e3c29
      Olivier Crête authored
      Looping through the list of send segment was the only thing from libnice
      showing up in my profiler. Keeping a list of segment that were never sent
      has made it disappear.
      011e3c29
    • Olivier Crête's avatar
    • Olivier Crête's avatar
    • Philip Withnall's avatar
      agent: Add support for vectored I/O for sends · f7b15f14
      Philip Withnall authored
      Add one new public function, nice_agent_send_messages_nonblocking(),
      which replaces nice_agent_send_full(). This isn’t an API break, because
      nice_agent_send_full() hasn’t been in a release yet. The new API allows
      sending multiple messages in a single call, and supports vectors of
      buffers to transmit the messages from.
      
      The existing nice_agent_send() API has been left untouched, although
      it’s a bit of a bugbear because it’s non-blocking and doesn’t fit with
      the new *_nonblocking() naming scheme. Oh well.
      
      This doesn’t bring any notable changes to the number of memcpy()s on the
      critical path: it remains at zero for the common cases and common socket
      types. It introduces the possibility for future work to eliminate some
      memcpy()s in more complex socket types, like tcp-turn and tcp-bsd, but
      these optimisations have not been made yet. FIXME comments have been
      added.
      
      This includes modifications to the test-send-recv unit test to cover the
      new API.
      f7b15f14
    • Philip Withnall's avatar
      agent: Add support for vectored I/O for receives · 253be348
      Philip Withnall authored
      Add two new public functions:
       • nice_agent_recv_messages()
       • nice_agent_recv_messages_nonblocking()
      which allow receiving multiple messages in a single call, and support
      vectors of buffers to receive the messages into.
      
      The existing nice_agent_recv[_nonblocking]() APIs have been left
      untouched.
      
      This tidies up a lot of the message handling code internally, and
      eliminates a couple of memcpy()s. There are still a few more memcpy()s
      on the critical path, which could be eliminated with further work.
      
      In the reliable agent case, every message is memcpy()ed twice: once into
      the pseudo-TCP receive buffer, and once out of it. The copy on input
      could be eliminated (in the case of in-order delivery of packets) by
      receiving directly into the receive buffer. The copy on output can’t be
      eliminated except in the I/O callback case (when
      nice_agent_attach_recv() has been used), in which case the callback
      could be invoked with a pointer directly into the pseudo-TCP receive
      buffer.
      
      In the non-reliable agent case, zero memcpy()s are used.
      
      A couple of the more complex socket implementations (TURN and HTTP) have
      slow paths during setup, and partially also during normal use. These
      could be optimised further, and FIXME comments have been added.
      253be348
    • Olivier Crête's avatar
      pseudotcp: Don't fail when sending over 4GiB of data · a3abccdd
      Olivier Crête authored
      Integer comparisons need to take care of rollovers
      a3abccdd
    • Olivier Crête's avatar
      agent: Only change pseudotcp clock if the new timeout is sooner · 83bcf954
      Olivier Crête authored
      Destroying and creating GSources is expensive, so also don't destroy and
      re-create if possible, instead lets use the new g_source_set_ready_time()
      83bcf954
    • Olivier Crête's avatar
      pseudotcp: Switch to using monotonic time · eb150a03
      Olivier Crête authored
      eb150a03