Instead of letting the TURN session destroy itself when finished, the current
code is overriding the user_data attached to the session. This is not needed
because the turn session will be stopped when the timer will complete and
this can cause some crashes in pj_turn_session_on_rx_pkt2 because the data
is erased while not protected via turn_sock->grp_lock() (mostly in turn_sock.c,
on_data_read)
Change-Id: Ia4a12917711b5534b372cb3a26e9141e5393c569
Gitlab: #299
The relay candidate was declared as suceeded even if not in the valid list.
Because of this, some negotiations were successful but no valid candidates
were given to the app.
Moreover, the connection timeout checks were using the wrong timer. This
avoids to cancel successful negotiations to check a connection timeout.
Finally, some clean is done with this patch
Change-Id: Iacfbf3b9f5faafe1bd05f66157485226761c30bf
Gitlab: #256
TCP_KEEPALIVE are not enough to detect that TCP connections are dead or not.
Some routers doesn't seems to support TCP_KEEPALIVE and moreover, sometimes
the settings is just not enough as described in this article:
https://blog.cloudflare.com/when-tcp-sockets-refuse-to-die/
RFC 5482 describe a new option for sockets: TCP_USER_TIMEOUT which must be used
with keep alives to detect closed connection in a better way.
In this patch we set TCP_USER_TIMEOUT to 30 seconds (like the keep alive). This is
a TCP level socket option used to specify the max time in ms that transmitted data
can be unacknowledged before a force close.
Change-Id: I217616b9b9e08adfa5a044a451fbbc97faf1939e
Gitlab: #243
fix preferences set in first plugin loading
small logic changes in libraries loading
related to: https://review.jami.net/c/ring-project/+/14433
Change-Id: I4730f279ee38d337e3ef94dd9562a5dfc1a63c32
This aims to fix the some negotiation failure when:
UserA (TURN ipv4) calls UserB (ipv4 only)
In fact, the first user will take some time to know the userB
addresses to allow on the TURN. So, during this time, the TURN will
give some EPIPE errors. EPIPE is code 32 defined by 120032 in pjsip
(PJ_STATUS_FROM_OS(EPIPE)).
So previous code was a mistake
Change-Id: If38c5d36dc38bfe89e3b2ccfbf1b64c934639adb
In the case whare two packets like this were received:
P1
+----------------+-------------+---------------+
| data (X bytes) | header (2b) | data (1 byte) |
+----------------+-------------+---------------+
P2
+----------------+
| data (X bytes) |
+----------------+
The RTP loop used the last byte of p1 and the first
byte of P2 as the header. Leading to malformed packets
Change-Id: Ie714fcf0bab1e372f7433342ed60ed4e6d20aff3
With these changes, Jami only got on_data_sent for data that Jami
send. In previous state, some on_data_sent comes from TURN refresh
because it's managed by the ice_session in pjsip.
Change-Id: I76109f9662aeca01ffccd884dac2a5aab7ab2503
The timer is triggered through a passive candidate, so it should
be done only if the timer is none.
Change-Id: I89a16467667393949ad38b4184b4edfb0a452675
The fix in current master branch doesn't make any sense. pkt_len
contains incorrect data and is also used for incoming packets.
Just return the size sent is enough
Change-Id: I4c1ced40086b6418946ab1d384c93cc697304749
also remove what has been upstreamed.
also, logic of how upstream has implements dealing with pending packets
on the socket is different now and therefore needs testing.
minor change:
- patches are now done in order.
- all configs are moved to config_site.h; TODO: also move HOSTVARS to use.mak
- enable epoll on linux
Change-Id: I87b9389a845d4c4a41fc9e70c3a94a0a990ca83d