| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Cleanly returnign makes no sense and may hide
worse problems.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
• rename to nice_socket_is_based_on() and swap the order of arguments
accordingly; the implementation doesn't have to use the confusing
'return other->is_base_of()' pattern anymore
• fix potential NULL dereferences
The argument order in agent_recv_message_unlocked() was already wrongly
swapped in 1732c7d6 and thus this commit isn't changing it back because
that order has become the correct one.
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D866
|
|
|
|
|
|
|
|
| |
This will be used in the next commit.
Maniphest Tasks: T114
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D240
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The return value is the number of messages sent, or -1 on error — not a
boolean.
|
| |
|
|
|
|
|
|
| |
The add_to_be_sent was duplicated in http/socks5/pseudossl/tcp-bsd and
had some small differences. It's better to factor it out so bug fixes
get applied to all of them and code is cleaner.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
is_reliable on other sockets
|
| |
|
|
|
|
| |
It was used correctly only half the time anyway
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
If using a proxy, the 'from' of all packets were of the proxy server
instead of the turn server, causing the check for turn to fail.
Thanks to Madaro Livio.
|
| |
|
|
|
|
| |
coverity
|
|
|
|
| |
send, if we're in an error
|
|
|