1. 25 Sep, 2014 3 commits
  2. 24 Sep, 2014 1 commit
  3. 23 Sep, 2014 5 commits
  4. 22 Sep, 2014 6 commits
  5. 19 Sep, 2014 2 commits
    • Philip Withnall's avatar
      agent: Clear existing GSource timeouts before adding new ones · 5ed865fb
      Philip Withnall authored
      Modify agent_timeout_add_with_context() to force destroying and freeing
      of an existing GSource before overwriting it with a new one (probably
      with an updated timeout period).
      This fixes a case in priv_map_reply_to_relay_refresh() where the TURN
      candidate refresh timer was being overwritten with a new one, without
      the old one being destroyed. This lead to two timeouts existing, only
      one of which would be destroyed when the CandidateRefresh struct was
      freed, leaking the other one (in the main context) and allowing it to be
      later dispatched with a dangling CandidateRefresh pointer.
      The modification to agent_timeout_add_with_context() should prevent this
      happening in new code in future.
    • Philip Withnall's avatar
      agent: Add names to timer GSources · e5fbdbe6
      Philip Withnall authored
      Modify the agent_timeout_add_with_context() utility function to
      automatically add names to the timer GSources it creates. This makes
      them a little easier to identify when debugging.
  6. 02 Sep, 2014 2 commits
  7. 01 Sep, 2014 4 commits
  8. 27 Aug, 2014 2 commits
    • Philip Withnall's avatar
      agent: Fix locking when calling component_free() · 754596c8
      Philip Withnall authored
      As mentioned in the previous commit message, component_free() requires
      the agent lock to be released, but component_close() requires it to be
      held. Fix the locking in nice_agent_remove_stream() to do that.
    • Philip Withnall's avatar
      agent: Split component_free() into component_[close|free]() · 56e04b56
      Philip Withnall authored
      Closing a component and freeing it are slightly conceptually different.
      As it happens, freeing it can result in the disposal of the component's
      NiceIOStream, which requires the agent lock to be released — but closing
      the rest of the Component requires the agent lock to be held. Splitting
      the function up simplifies locking handling in other parts of the code
      (see next commit).
  9. 25 Aug, 2014 3 commits
  10. 23 Aug, 2014 2 commits
    • Philip Withnall's avatar
      agent: Add missing stream-closed checks for pseudo-TCP · 67179ffd
      Philip Withnall authored
      This got lost in rebasing the FIN–ACK work. component->tcp is now only
      NULL before the pseudo-TCP stream is initially created — afterwards, it
      is always non-NULL, but pseudo_tcp_stream_is_closed() returns TRUE if
      the stream has closed (gracefully or on errors). This allows
      differentiation between the states: TCP support was never initialised;
      and TCP support was initialised but is now closed.
    • Philip Withnall's avatar
      agent: Return 0 on EOS from nice_input_stream_read() · 7b6935c6
      Philip Withnall authored
      We should return 0 instead of G_IO_ERROR_CLOSED for consistency with
      recv() and read().
  11. 21 Aug, 2014 10 commits
    • Philip Withnall's avatar
      pseudotcp: Ensure shutdown member is not overwritten · 61e1cfbe
      Philip Withnall authored
      Add a few safeguards to ensure that once priv->shutdown is set, it is
      not overwritten with a different value.
    • Philip Withnall's avatar
      pseudotcp: Fix EOS return from recv() in non-FIN–ACK mode · 0cd0729d
      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.
    • Philip Withnall's avatar
      pseudotcp: Ensure socket is closed after shutdown in non-FIN–ACK mode · f75a8a43
      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.
    • Philip Withnall's avatar
      pseudotcp: Add a PseudoTcpSocket:support-fin-ack property · 239394af
      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.
    • Philip Withnall's avatar
      tests: Fix race conditions in test-thread · 111301a0
      Philip Withnall authored
      As found by tsan.
    • Philip Withnall's avatar
      agent: Close pseudo-TCP streams when closing G[IO|Input|Output]Streams · 859fcb9e
      Philip Withnall authored
      This means that users of the Nice[Input|Output|IO]Stream API can easily
      close TCP connections without having to hack around with libnice
    • Philip Withnall's avatar
    • Philip Withnall's avatar
      pseudotcp: Add pseudo_tcp_socket_shutdown() support · f3440d33
      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.
    • Philip Withnall's avatar
      pseudotcp: Shorten the TIME-WAIT state timeout dramatically · 78ec8485
      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.
    • Philip Withnall's avatar
      tests: Add a new segment-by-segment test framework for pseudo-TCP · 0bd5acca
      Philip Withnall authored
      This explicitly removes all timers and main loop considerations from the
      pseudo-TCP testing, which considerably simplifies arranging packet swaps
      and mistimings for testing purposes.
      This test suite includes a few tests for the FIN–ACK support.