Age | Commit message (Collapse) | Author | Files | Lines |
|
If n_messages ≠ n_valid_messages.
|
|
|
|
To be used with `make check-valgrind`.
|
|
The theory being that if we can get check-valgrind to pass, we could
acutally use it to find more memory leaks and other errors in the agent.
|
|
There is no need for this to be heap-allocated.
|
|
From commit 7b6935c66738d855c84fba291d47ece6ce1c43e2.
|
|
This allows FIN–ACK support to be disabled entirely. This is mostly for
testing purposes, since TCP_OPT_FIN_ACK is negotiated when establishing
the connection, and is disabled if the other side doesn’t support it.
This includes an interoperability test.
|
|
As found by tsan.
|
|
This explicitly removes all timers and main loop considerations from the
pseudo-TCP testing, which considerably simplifies arranging packet swaps
and mistimings for testing purposes.
This test suite includes a few tests for the FIN–ACK support.
|
|
In order to detect cases where the peer closes its connection without an
explicit in-band close message (e.g. in protocols such as Telnet where
there is none), pseudo-TCP needs to grow support for a shutdown
handshake, following the TCP FIN–ACK specification. Arguably it should
have had this all along, but Jingle apparently doesn’t need it.
This adds support for FIN–ACK to the pseudo-TCP implementation. It is
backwards-compatible, only being used if the TCP_OPT_FIN_ACK option is
specified in the SYN segment.
If enabled, full-duplex closes are supported, and the standard method
for notifying a peer of the other end closing its connection (returning
0 from recv()) is used.
Also allow rapidly tearing down a connection, discarding unsent and
unreceived data, by sending an RST segment. This preserves the ability to
do a forced socket closure with pseudo_tcp_socket_close(sock, TRUE).
It also permits graceful socket shutdown in the case where the final ACK
is lost, and one peer gets stuck in the LAST-ACK state: that peer will
eventually re-transmit its FIN segment. The other peer, in the CLOSED
state, will respond with a RST segment, and the first peer will then
reach CLOSED.
References (most useful first):
• http://tools.ietf.org/html/rfc793#section-3.5
• http://tools.ietf.org/html/rfc1122#page-87
• http://vincent.bernat.im/en/blog/2014-tcp-time-wait-state-linux.html
• http://tools.ietf.org/html/rfc675
Diagram:
•
http://en.wikipedia.org/wiki/Transmission_Control_Protocol#mediaviewer/File:TCP_CLOSE.svg
|
|
|
|
This ensures UTF-8 output is printed correctly.
|
|
This clarifies the log output a little.
|
|
|
|
This reverts commit 18e5dff4f25b12522e857c13d3ef3bdb40212246.
|
|
changes
|
|
We want ICE-TCP to not have reliable behavior unless the agent
is reliable otherwise it will confuse existing VoIP applications.
|
|
This is a massive commit that can't be split. We add ice-tcp support
into the agent by creating local host tcp-active/tcp-passive candidates.
We also need to find the local and remote candidates whenever we discover
a peer-reflexive because their data is important to setup the peer-reflexive
so a few changes were added to look for the local or remote candidate.
For TCP-ACTIVE remote peer-reflexive candidates, we can't add conncheck
pairs normally because TCP-PASSIVE (local) do not generate candidate pairs,
and we also can't have a connection from any local host, so we can only create
a single candidatepair with the local/remote that are connected.
The pair->socket of a candidate check pair will hold the connected tcp socket
(through connect for ACT or accept for PASS) and we will either have a
remote or a local peer-reflexive which will create a new candidate pair,
we cannot trigger checks on the initial candidate pair, we must only do it
on the new check pairs. but in the case of a tcp-passive, we don't get a new
local peer-reflexive candidate, so there is no new candidate with a new NiceSocket, so
when we get a triggered check, we need to match it to the candidate check pair
or when we select a pair, it will still use the original TCP-PASS socket.
We must store the new connected tcp socket in the peer reflexive candidates
since they represent that unique peer-reflx candidate's connection
|
|
|
|
|
|
accept data reception on connected state
|
|
|
|
Now we will always give a handicap to UDP candidates, but still give
relays the lower priority. We have the following priorities now :
In reliable mode :
TCP Host : 120
TCP peer-refl : 110
TCP nat-assist : 105
TCP srv-refl : 100
UDP Host : 60
UDP peer-refl : 55
UDP nat-assist : 52
UDP srv-refl : 50
TCP relay : 10
UDP relay : 5
In unreliable mode :
UDP Host : 120
UDP peer-refl : 110
UDP nat-assist : 105
UDP srv-refl : 100
TCP Host : 60
TCP peer-refl : 55
TCP nat-assist : 52
TCP srv-refl : 50
UDP relay : 10
TCP relay : 5
|
|
|
|
|
|
The farstream unit tests were using it.
|
|
|
|
As documented at the top of the file, this creates two PseudoTcpSockets
in a loopback configuration, and mutates the raw packets which are sent
between them, hoping to cause assertion failures and illegal memory
accesses in the pseudotcp code.
Best run under Valgrind or GDB.
|
|
|
|
Some platforms have a larger alignment requirement for struct sockaddr_* than
for plain struct sockaddr, in that case, we need to make sure that the incoming pointer
has the right alignement before taking it in.
|
|
So use guint64 everywhere, this is never supposed to be negative.
|
|
There are more than one callback that could stop it
|
|
|
|
|
|
|
|
its unreliable
|
|
|
|
|
|
We wan't to make sure not to have a race where a thread blocks in a blocking
receive or send while nice_agent_remove_stream() is called
|
|
Also, keep a pointer to the other structure for tests to use
|
|
Also made the GIOStream into a singleton, it always returns the same one.
Also make it impossible to create a GIOStream for a non-existing stream/component
|
|
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
|
|
Previously, there was a race between receiving the data packets and
changing state to READY, which would cause one of the final assertions
to fail.
|
|
Add one new public function, nice_agent_send_messages_nonblocking(),
which replaces nice_agent_send_full(). This isn’t an API break, because
nice_agent_send_full() hasn’t been in a release yet. The new API allows
sending multiple messages in a single call, and supports vectors of
buffers to transmit the messages from.
The existing nice_agent_send() API has been left untouched, although
it’s a bit of a bugbear because it’s non-blocking and doesn’t fit with
the new *_nonblocking() naming scheme. Oh well.
This doesn’t bring any notable changes to the number of memcpy()s on the
critical path: it remains at zero for the common cases and common socket
types. It introduces the possibility for future work to eliminate some
memcpy()s in more complex socket types, like tcp-turn and tcp-bsd, but
these optimisations have not been made yet. FIXME comments have been
added.
This includes modifications to the test-send-recv unit test to cover the
new API.
|
|
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.
|
|
|
|
The write() function already exists; we can’t re-define it as a
callback.
|
|
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.
|
|
Destroying and creating GSources is expensive, so also don't destroy and
re-create if possible, instead lets use the new g_source_set_ready_time()
|