| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The same code to get and validate local and remote candidates from an
incoming stun is shared between regular inbound stun, early checks
replay, and partially in the local peer-reflexive discovery function.
The selection of the matching local and remote candidate from an
incoming stun sometimes requires more information than just the local
socket, and the sender address and port. It happens more frequently when
the port range is reduced, and when the conncheck handles both tcp and
udp candidates.
To help to disambiguate such situations, we add supplementary checks
when two candidates in the list have the same address and and port
number:
* the type of the socket must compatible with the candidate transport.
A socket for a tcp candidate may be active of passive, but also
of type "tcp-bsd" when the parent active or passive socket is
replaced after a bind() or accept(). It gives several cases.
* the remote candidate transport and the local candidate transport must
be compatible
|
| |
|
|
|
|
| |
Tested inside Cerbero with VS 2017
|
|
|
|
|
|
|
| |
If this isn't done, then there may be invalid points left inside the
passive socket which could be used and cause a crash.
Fixes #33
|
|
|
|
|
|
|
|
| |
Avoids race between socket_send_more() and socket_close() leading either
to crash on use of freed NiceSocket, or abort upon attempting to
g_mutex_clear() a locked mutex.
Akin to what d1611c0c0ba6c5bce500b96a8f61de4fe5f144e9 did to udp-turn.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Work on libnice's bug #1 in Gitlab. This work is composed of multiple
merged parts:
- "Global lock contention removed"
Phabricator D1900: https://phabricator.freedesktop.org/D1900
By @nifigase
Opened in GitLab as Merge Request !12
- "agent: properly handle NiceAgent ref in callbacks from timeout
sources"
Phabricator D1898: https://phabricator.freedesktop.org/D1898
By @mparis
This patch was itself based upon a previous version of the work done in
D1900. After the switch of hosting, it got lost.
On top of these, additions to follow some review comments from @ocrete:
- https://phabricator.freedesktop.org/D1900#40412
- https://phabricator.freedesktop.org/D1898#39332
|
|
|
|
|
|
| |
This is new warning introduced with GCC 8. This is being fixed by using appropriate function, like g_queue_free_full/g_list_free_full or by casting to GCallback before casting to the target function signature.
Closes: #46
|
|
|
|
|
| |
Cleanly returnign makes no sense and may hide
worse problems.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Disable Nagling for underlying TCP sockets used by libnice, because they
are typically used for streaming applications, or for pseudo-TCP; the
bandwidth in both cases is harmed by Nagling.
Based on a patch by Vadim Genkin.
Maniphest Tasks: T3317
Reviewers: pwithnall
Projects: #libnice
Subscribers: pwithnall, vadimgenkin
Differential Revision: https://phabricator.freedesktop.org/D230
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
At that point, (len > 0), since there are conditions above handling the
(len == 0) and (len < 0) cases, both of which break from the loop.
Coverity issue: #29325
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
part-way
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
| |
Use GSocket for better Windows compatibility
|
| |
|
|
|
|
|
|
| |
As glib documentation suggests (http://developer.gnome.org/glib/2.28/glib-IO-Channels.html),
g_io_channel_unix_new should be avoided on WIN32 platform.
Replaced with g_io_channel_win32_new_socket function
|
|\
| |
| |
| |
| | |
Conflicts:
configure.ac
|
| | |
|
| | |
|
|/ |
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
agent/agent.c
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
to. Fixes coverity check when dereferencing addr
|
|
|
|
| |
avoid the race condition of a source being destroyed while we wait for the mutex
|
|
|
|
| |
for the data output. The queue now has a limit of 20 packets and the tcp-turn now has to call send in a single shot to avoid dropping parts of the packet (dropping the length but send the data, or dropping only the padding at the end, etc..)
|