| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Those may have previously been silently ignored.
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D1708
|
|
|
|
|
| |
Cleanly returnign makes no sense and may hide
worse problems.
|
|
|
|
|
|
|
|
|
| |
Some versions of Windows can return ECONNRESET for UDP recvmsg() calls
if they would otherwise block. Hence, handle the two equivalently; this
should not affect behaviour on Linux, which apparently does not return
ECONNRESET for UDP recvmsg() calls at all.
https://phabricator.freedesktop.org/T121
|
|
|
|
|
|
|
|
| |
Explicitly check whether the socket is closed (universally represented
as sock->priv == NULL) before doing anything else in the socket methods.
This should safely return from unusual situations where the socket has
been closed and part-destroyed but still ends up having send() or recv()
called on it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
part-way
|
| |
|
|
|
|
|
| |
We never send multiple messages to separate targets in practice, so
this will simplify the code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Casting from one struct sockaddr type to another breaks C’s strict
aliasing rules (variables of different types cannot alias). Fix this
cleanly by using unions of struct sockaddrs to convert between the
types (i.e. type-punning).
I wish sockaddr didn’t have to be this painful.
See:
http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Optimize-Options.html#Type_002dpunning
|
| |
|
|
|
|
|
| |
Creating a GSocketAddress takes a measurable amount of time, so let's cache it
as it doesn't change once a socket is created.
|
| |
|
| |
|
| |
|
|
|
|
| |
Use GSocket for better Windows compatibility
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
I have a use case where len < 0 but the socket is still working.
It is when the stun server is not listening and the client receives
ICMP messages. I think it is a Windows specific problem.
Calling WSAGetLastError() returns WSAECONNRESET.
The MSDN documentation sais:
"On a UDP-datagram socket, this error would indicate that a previous
send operation resulted in an ICMP "Port Unreachable" message."
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740121(v=vs.85).aspx
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
agent/agent.c
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
Apparently recvfrom can return EAGAIN on udp sockets if for example there's a bad checksum in the packet or some other similar error
|
|
|
|
| |
tcp stuff from tcp-turn and made udp-turn into turn since it's generic
|
|
|
|
| |
yet set
|
|
|
|
| |
x. Also use some cleaner code
|
| |
|
| |
|
|
|
|
| |
mingw and as an uint on linux systems
|
|
|
|
| |
included before stdlib.h because it redefines atexit
|
| |
|
| |
|
| |
|
| |
|
|
|