1. 31 Jan, 2014 8 commits
    • Olivier Crête's avatar
      Remove the "to" parameter from NiceOutputMessage · 5c235a86
      Olivier Crête authored
      We never send multiple messages to separate targets in practice, so
      this will simplify the code
      5c235a86
    • Olivier Crête's avatar
    • Philip Withnall's avatar
      socket: Add vectored I/O support for sending on sockets · 515481e6
      Philip Withnall authored
      Replace the send() API with a send_messages() API, which supports
      sending multiple messages, each with multiple buffers rather than a
      single monolithic buffer.
      
      This doesn’t break API, as the socket API is not exposed outside
      libnice. It does introduce a new struct: NiceOutputMessage, which is
      analogous to struct mmsghdr and NiceInputMessage.
      
      This includes updates to the test-bsd test to cover the changed API.
      
      The existing nice_socket_send() API has been retained as a thin wrapper
      around nice_socket_send_messages(), for convenience only. It’s hoped
      that internal usage of this API will decline to the point where it can
      be removed.
      515481e6
    • 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
    • Philip Withnall's avatar
      socket: Fix the formal parameter types of nice_turn_socket_parse_recv() · 89903349
      Philip Withnall authored
      gsize and guint8 are more obviously for binary data than gint and gchar.
      
      Note the signedness of the return type has changed: the function never
      returns negative values.
      89903349
    • Philip Withnall's avatar
      socket: Add vectored I/O support for receiving on sockets · dfab04cd
      Philip Withnall authored
      Replace the recv() API with a recv_messages() API, which supports
      receiving multiple messages, each with multiple buffers rather than a
      single monolithic buffer.
      
      This doesn’t break API, as the socket API is not exposed outside
      libnice. It does introduce a new struct: NiceInputMessage, which is
      analogous to struct mmsghdr.
      
      This includes updates to the test-bsd test to cover the changed API.
      dfab04cd
    • Philip Withnall's avatar
      socket: Ensure variables are nullified correctly in UDP sockets · bdc72e78
      Philip Withnall authored
      When closing a socket, ensure its private data structure is set to NULL.
      When sending a message fails to construct a new socket address, ensure
      the pointer to the old address (which has just been unreffed) is removed.
      
      This makes debugging problems with sockets being freed early much
      easier.
      bdc72e78
    • Philip Withnall's avatar
      socket: Add missing switch cases · 56c5dced
      Philip Withnall authored
      This appeases GCC’s -Wswitch-enum warning, and makes it more obvious
      that those enum cases have been explicitly considered, rather than just
      forgotten about.
      
      This introduces no functional changes.
      56c5dced
  2. 27 Dec, 2013 1 commit
  3. 24 Dec, 2013 2 commits
  4. 18 Dec, 2013 3 commits
  5. 27 Jun, 2013 1 commit
  6. 19 Nov, 2012 1 commit
  7. 03 Aug, 2012 1 commit
  8. 29 May, 2012 1 commit
  9. 02 Mar, 2012 5 commits
  10. 24 Feb, 2012 1 commit
  11. 15 Feb, 2012 1 commit
  12. 14 Feb, 2012 1 commit
  13. 13 Feb, 2012 2 commits
  14. 09 Feb, 2012 1 commit
  15. 30 Nov, 2011 1 commit
  16. 21 Sep, 2011 2 commits
  17. 31 Mar, 2011 1 commit
  18. 24 Mar, 2011 1 commit
  19. 18 Jan, 2011 1 commit
  20. 14 Jan, 2011 2 commits
  21. 24 Dec, 2010 2 commits
  22. 22 Dec, 2010 1 commit