1. 03 Jun, 2016 19 commits
    • Philip Withnall's avatar
      agent: Port PseudoTcpSocket to GDatagramBased · 39c481ea
      Philip Withnall authored
      Including porting the tests.
      
      WIP: Still needs testing and documenting.
      
      tests: Port test-pseudotcp to GTest and add additional tests
      
      WIP work to rebase PseudoTcpSocket from GCommunicable to GIOStream
      
      WIP update for GDatagramBased API changes
      39c481ea
    • Olivier Crête's avatar
      SPECIFIC: Allow creating a GIOStream with a non-reliable agent · 418bfbcb
      Olivier Crête authored
      Only usable with the patches from
      https://bugzilla.gnome.org/show_bug.cgi?id=697907
      
      SPECIFIC: agent: Fix GSource dispatches for UDP NiceOutputStreams
      
      The GSource created by g_pollable_output_stream_create_source() on a
      NiceOutputStream would never have been dispatched, due to not having any
      poll events (or anything else); it only works for TCP streams because of
      a GCancellable child source which is triggered by the TCP code.
      
      Fix that by making ComponentSource suitable for G_IO_IN and G_IO_OUT
      again, and adding that as a child source for UDP output stream GSources.
      
      agent: SPECIFIC: Drop support for reliable streams
      
      libnice should not be implementing pseudo-TCP support internally — it
      should provide the PseudoTcpSocket as a separate API which user code can
      use if it needs. If this were to be upstreamed, a deprecation path would
      have to be written, continuing to support the old API. However, that
      would take too long, so this commit just rips it all out.
      
      This commit *must not* be upstreamed.
      
      https://phabricator.collabora.co.uk/T447
      
      agent: Add nice_agent_get_socket() to return a GDatagramBased
      
      TODO: Needs documentation and testing.
      
      This bumps the GLib dependency to 2.46 for GDatagramBased.
      
      agent: Remove nice_agent_get_io_stream()
      
      It has been replaced by nice_agent_get_socket().
      
      TODO: This needs documenting and testing.
      
      TODO: This should *not* go upstream without turning it into a
      deprecation-fest.
      418bfbcb
    • Philip Withnall's avatar
      SPECIFIC: pseudotcp: Disable the Nagle algorithm by default · 02c10031
      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.
      02c10031
    • Olivier Crête's avatar
      pseudotcp: it's still a GObject · fad72879
      Olivier Crête authored
      fad72879
    • Olivier Crête's avatar
      pseudotcp: Make sure duplicate ack representing losses have no data · f645ea6b
      Olivier Crête authored
      If they have data in them, they won't be recognized as duplicate acks by
      the sender.
      f645ea6b
    • Olivier Crête's avatar
      pseudotcp: Implement NewReno timestamp heuristic · adba0d4a
      Olivier Crête authored
      This allows the sender to enter fast retransmit after a timeout because
      it can now detect that three duplicate acks are caused by a packet loss.
      
      As specific in RFC 6582 section 4.2.
      adba0d4a
    • Olivier Crête's avatar
      pseudotcp: Set min RTO to 1 second · 1f532aeb
      Olivier Crête authored
      This is recommended by RFC 6298
      1f532aeb
    • Olivier Crête's avatar
      pseudotcp: Implement full NewReno · b5952012
      Olivier Crête authored
      b5952012
    • Olivier Crête's avatar
      pseudotcp: Make debug more useful · e31932bd
      Olivier Crête authored
      e31932bd
    • Olivier Crête's avatar
      pseudotcp: Separate default and maximum MTU · 8ccb2c17
      Olivier Crête authored
      Accept packets much beyond the default MTU, but
      set a reasonable default MTU for sending of 1400
      8ccb2c17
    • Olivier Crête's avatar
      pseudotcp: close local socket on initial transmission error · cb644b2b
      Olivier Crête authored
      This is required as no retransmissions will happen
      cb644b2b
    • Olivier Crête's avatar
      23331ff2
    • Olivier Crête's avatar
      026c15a8
    • Philip Withnall's avatar
      pseudotcp: Correct behaviour of buffer size methods when part-closed · 11d4bb97
      Philip Withnall authored
      Correct the behaviour of pseudo_tcp_socket_get_available_bytes() and
      pseudo_tcp_get_available_send_space() when the socket is not in
      TCP_ESTABLISHED state. It’s still permissible to send and receive up
      until the local side calls pseudo_tcp_socket_close(), which means we
      may be in state TCP_ESTABLISHED *or TCP_CLOSE_WAIT*.
      11d4bb97
    • Philip Withnall's avatar
      pseudotcp: Fix EOS checks in high packet loss situations · a9a149f5
      Philip Withnall authored
      The state tracking previously assumed that if a FIN packet was sent, the
      other side received it and the preceding packets, and hence it was
      correct to sent an RST if an unexpected packet (such as a delayed
      SYN-ACK) was received.
      
      In cases where there is high packet loss, this won’t work. For example,
      peer A sends a SYN, it is received and peer B replies with a SYN-ACK
      which is also received; then peer A sends its data and a FIN, which are
      both dropped. Since it hasn’t received anything since the original SYN,
      peer B resends its SYN-ACK. If that is received, peer A was incorrectly
      treating it as an erroneous packet, and would then send a RST. In actual
      fact, it should take this as a signal that the data and FIN packets were
      dropped, and should resend them.
      
      TODO: Add unit tests
      a9a149f5
    • Philip Withnall's avatar
      pseudotcp: Propagate error codes from transmit() to callers · 4dc2b5d9
      Philip Withnall authored
      Otherwise we can’t easily differentiate between different transmission
      failures; for example: underlying socket failures, versus retransmission
      timeouts.
      4dc2b5d9
    • Philip Withnall's avatar
    • Philip Withnall's avatar
      pseudotcp: Fix pseudo_tcp_socket_recv() in state TCP_CLOSE_WAIT · a72a93e5
      Philip Withnall authored
      Previously, pseudo_tcp_socket_recv() would start returning 0 (EOS) as
      soon as a FIN segment was received from the peer, even if there was
      unread data already in the receive buffer.
      
      Instead, the unread data should all be accessible before
      pseudo_tcp_socket_recv() starts returning 0.
      a72a93e5
    • Philip Withnall's avatar
      pseudotcp: Fix retransmission of segments before handling a FIN · 02699917
      Philip Withnall authored
      Previously, if peer A transmitted one or more data segments (1),
      followed by a FIN segment (2) to peer B, and segments 1 were
      dropped, peer B would not request retransmission of them and would
      instead continue with the FIN handshake. This effectively meant
      segments 1 were lost without peer B realising.
      
      Fix this by only handling the FIN segment once its sequence number is
      acknowledged in the receive window.
      02699917
  2. 02 Jun, 2016 4 commits
  3. 01 Jun, 2016 2 commits
  4. 31 May, 2016 3 commits
  5. 30 May, 2016 6 commits
  6. 27 May, 2016 6 commits