Add a nice_socket_send_reliable API for internal use.
authorYouness Alaoui <youness.alaoui@collabora.co.uk>
Sat, 5 Apr 2014 04:29:54 +0000 (00:29 -0400)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Thu, 15 May 2014 13:39:34 +0000 (09:39 -0400)
commit535701b0094218d162ac26820d1613ccb6ee1727
treef6a85508778be838c09e27f4031fd0808d1a2e61
parent06cb5a12ff02a5a857b2c0ebd007bd35f80b5f55
Add a nice_socket_send_reliable API for internal use.

One issue with tcp-bsd is that it will queue messages when the tcp socket
is not writable, but it will also drop messages when the queue is full.
If we want to do proper reliable ice-tcp, we need to make sure that
messages don't get dropped, also, this would affect http/socks5/pseudossl
if their messages get dropped. For ice-tcp, when the socket is not writable
we want to return 0, not queue the message.
The change here is to allow connchecks and other important protocol messages
to be sent as 'reliable' on tcp transports by queuing them and in the various
socket layers and to never drop them, but all user messages will be dropped.

if the tcp socket is not writable.
13 files changed:
agent/agent-priv.h
agent/agent.c
agent/conncheck.c
agent/discovery.c
socket/http.c
socket/pseudossl.c
socket/socket.c
socket/socket.h
socket/socks5.c
socket/tcp-bsd.c
socket/tcp-turn.c
socket/turn.c
socket/udp-bsd.c