| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
| |
https://gitlab.freedesktop.org/libnice/libnice/commit/da41258a21102f63ec5d5b2dc20d303f772eb195. Fix #64.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The underlying GSocket implementation on Windows returns an error when
the user-provided buffer isn't large enough to fit the whole datagram
received on a message-oriented socket.
When this occurs, in order to preserve identical behavior of udp-bsd
NiceSocket across platforms, we have to mute the error and set the
received message length to the size of the provided NiceInputMessage.
Any excess portion of the message gets discarded.
Fixed udp-bsd test on Windows.
GLib 2.48 is required in order to use G_IO_ERROR_MESSAGE_TOO_LARGE.
|
|
|
|
| |
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.
|
|
|
|
| |
To be able to call it from a context that is already locked.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There might be multiple RFC4571-framed messages (or fragments thereof)
within a single TCP-TURN message. Make sure each NiceInputMessage
passed by the user into socket_recv_messages() gets exactly one RFC4571
frame, or remains empty if there aren't any messages to receive.
We should keep any data that doesn't fit into the user buffers for
the next time socket_recv_messages() gets called with the socket.
|
|
|
|
|
|
|
|
|
|
|
|
| |
After being parsed, a TURN control message turns into a NiceInputMessage
with zero length. Such message doesn't increment the iteration counter i
and so is re-processed in the next iteration, which detects right away
that message->length == 0 and continues to the next element in
recv_messages.
Thus, n_valid_messages variable serves no real purpose and to achieve
the same result we can simply increment the iteration counter after each
message.
|
| |
|
|
|
|
|
| |
The socket abstraction not being reference counted, we need a global
lock for them in the short term.
|
|
|
|
| |
It's not locked in any way.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
There was two cases where instead of freeing the queue, we actually
clear the queue so it's ready for reused. Notably in
nice_socket_free_send_queue(), a missed name function and nicesrc
element state change.
This regression was introduced by: fa783b1dd727a6ee2b99a111ca24790ae850c2f7
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Various little things, none of which should make a functional difference.
|
| |
|
|
|
|
| |
This makes clang happy.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This should reduce the overhead a bit.
|
| |
|
|
|
|
|
|
|
| |
UDP turn sockets should never be read frm directly.
Because they may share the same socket with the non-relay,
so the incoming data may not be relayed and then the NiceSocket
API doesn't allow returning the base socket as the source.
|
|
|
|
|
| |
Instead of re-discovering the nonce and realm for every request, cache them
in th socket.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
• 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have to call is_base_of "virtual function pointer" of 'other'
object, not 'sock', since 'other' is the structure whose base
NiceSocket we need to get from its private data.
For instance calling nice_socket_is_base_of() with 'sock' and 'other'
being respectively pseudo-SSL and UDP-TURN-over-TCP invoked is_base_of
variant for pseudo-SSL, casting other->priv into PseudoSSLPriv *, but
other->priv is actually TurnTcpPriv *. It must be called the other way
around.
https://phabricator.freedesktop.org/T7335
https://phabricator.freedesktop.org/T7336
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com>
Reviewed-by: Philip Withnall <philip@tecnocode.co.uk>
Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D785
|
|
|
|
|
|
|
|
|
| |
Add a more debug details, specifically in some places, it is interesting
to have the src and dst IP addresses of the pairs being checked, and
also to make the difference between log related to different stream ids.
Reviewed-by: Philip Withnall <philip@tecnocode.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D803
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As per [MS-TURN] Section 2.2.1, TURN message type 0x0104 "Send request
response" isn't supported and the TURN server MUST NOT send them. Thus,
libnice should not remember Send requests in agent->sent_ids because
without replies coming, the number of allowed pending transaction gets
quickly exhausted, causing our data packets to be dropped until a
request timeout frees some space in the queue.
This behavior resulted in choppy reception of our audio on a Lync client
when connected via Lync Edge (TURN) Server.
Maniphest Tasks: T126
Reviewers: pwithnall
Projects: #libnice
Reviewed By: pwithnall
Subscribers: pwithnall
Differential Revision: https://phabricator.freedesktop.org/D223
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Summary:
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
Maniphest Tasks: T121
Reviewers: ocrete
Projects: #libnice
Reviewed By: ocrete
Subscribers: stwiname, felixSchl
Differential Revision: https://phabricator.freedesktop.org/D227
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
| |
Otherwise the base socket will leak. Spotted by Vadim Genkin.
https://phabricator.freedesktop.org/T125
|
|
|
|
| |
This way, the regular log will only contain connection-time information.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|