Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
8bca6c3a
Commit
8bca6c3a
authored
4 years ago
by
Sébastien Blin
Committed by
Andreas Traczyk
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
pjproject: handle WSAECONNRESET for stun message
Change-Id: I06b505620ec980af97a5ee5b8526b5a1efdd4bee
parent
c9670a0e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/src/pjproject/0001-rfc6544.patch
+28
-13
28 additions, 13 deletions
contrib/src/pjproject/0001-rfc6544.patch
with
28 additions
and
13 deletions
contrib/src/pjproject/0001-rfc6544.patch
+
28
−
13
View file @
8bca6c3a
...
...
@@ -28,7 +28,7 @@ on behalf of Savoir-faire Linux.
pjnath/src/pjnath-test/concur_test.c | 5 +-
pjnath/src/pjnath-test/sess_auth.c | 14 +-
pjnath/src/pjnath-test/stun_sock_test.c | 7 +-
pjnath/src/pjnath/ice_session.c |
490
+++++++++--
pjnath/src/pjnath/ice_session.c |
505
+++++++++--
pjnath/src/pjnath/ice_strans.c | 745 +++++++++++++---
pjnath/src/pjnath/nat_detect.c | 7 +-
pjnath/src/pjnath/stun_session.c | 15 +-
...
...
@@ -41,7 +41,7 @@ on behalf of Savoir-faire Linux.
pjnath/src/pjturn-srv/server.c | 2 +-
pjsip-apps/src/samples/icedemo.c | 116 ++-
pjsip/src/pjsua-lib/pjsua_core.c | 2 +-
21 files changed, 24
29
insertions(+), 409 deletions(-)
21 files changed, 24
44
insertions(+), 409 deletions(-)
diff --git a/pjnath/include/pjnath/ice_session.h b/pjnath/include/pjnath/ice_session.h
index 8971220f0..4cccd7c64 100644
...
...
@@ -648,7 +648,7 @@ index fff4fad26..e7f8b84eb 100644
if (status != PJ_SUCCESS && status != PJ_EPENDING) {
app_perror(" error: server sending data", status);
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c
index 2a4125bc5..
3f8c03cd2
100644
index 2a4125bc5..
d4e20a508
100644
--- a/pjnath/src/pjnath/ice_session.c
+++ b/pjnath/src/pjnath/ice_session.c
@@ -18,6 +18,7 @@
...
...
@@ -1129,7 +1129,7 @@ index 2a4125bc5..3f8c03cd2 100644
}
pj_grp_lock_release(ice->grp_lock);
@@ -2181,6 +2393,1
78
@@
static pj_status_t on_stun_send_msg(pj_stun_session *sess,
@@ -2181,6 +2393,1
93
@@
static pj_status_t on_stun_send_msg(pj_stun_session *sess,
return status;
}
...
...
@@ -1231,13 +1231,28 @@ index 2a4125bc5..3f8c03cd2 100644
+ PJ_FALSE, PJ_FALSE, &rcand->addr,
+ pj_sockaddr_get_len(&rcand->addr),
+ check->tdata);
+ if (status_send_msg == PJ_EBUSY /* EBUSY */) {
+
+ if ((status_send_msg == 120104 || status_send_msg == 130054)/* CONNECTION RESET BY PEER */
+ && rcand->type == PJ_ICE_CAND_TYPE_RELAYED) {
+ /**
+ * This part of the code is triggered when using ICE over TCP via TURN
+ * In fact, the other peer has to authorize this peer to connect to
+ * the relayed candidate. This is done by set_perm from the other case.
+ * But from this side, we can't know if the peer has authorized us. If it's
+ * not the case, the connection will got a CONNECTION RESET BY PEER status.
+ * In this case, we can try to reconnect a bit after and this until the check
+ * reached its timeout.
+ */
+ check->state = PJ_ICE_SESS_CHECK_STATE_NEEDS_RETRY;
+ check_set_state(ice, check,PJ_ICE_SESS_CHECK_STATE_NEEDS_RETRY,
+ status_send_msg);
+ return;
+ } else if (status_send_msg == PJ_EBUSY /* EBUSY */) {
+ check->state = PJ_ICE_SESS_CHECK_STATE_NEEDS_FIRST_PACKET;
+ check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_NEEDS_FIRST_PACKET,
+ status_send_msg);
+ return;
+ }
+ if (status_send_msg == 120032 /* BROKEN PIPE */) {
+ } else if (status_send_msg == 120032 /* BROKEN PIPE */) {
+ check->state = PJ_ICE_SESS_CHECK_STATE_NEEDS_RETRY;
+ check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_NEEDS_RETRY,
+ status_send_msg);
...
...
@@ -1308,7 +1323,7 @@ index 2a4125bc5..3f8c03cd2 100644
/* This callback is called when outgoing STUN request completed */
static void on_stun_request_complete(pj_stun_session *stun_sess,
@@ -2411,7 +2
795
,9 @@
static void on_stun_request_complete(pj_stun_session *stun_sess,
@@ -2411,7 +2
810
,9 @@
static void on_stun_request_complete(pj_stun_session *stun_sess,
&check->lcand->base_addr,
&check->lcand->base_addr,
pj_sockaddr_get_len(&xaddr->sockaddr),
...
...
@@ -1319,7 +1334,7 @@ index 2a4125bc5..3f8c03cd2 100644
if (status != PJ_SUCCESS) {
check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_FAILED,
status);
@@ -2474,11 +28
60
,7 @@
static void on_stun_request_complete(pj_stun_session *stun_sess,
@@ -2474,11 +28
75
,7 @@
static void on_stun_request_complete(pj_stun_session *stun_sess,
/* Perform 7.1.2.2.2. Updating Pair States.
* This may terminate ICE processing.
*/
...
...
@@ -1332,7 +1347,7 @@ index 2a4125bc5..3f8c03cd2 100644
pj_grp_lock_release(ice->grp_lock);
}
@@ -2673,7 +30
55
,9 @@
static pj_status_t on_stun_rx_request(pj_stun_session *sess,
@@ -2673,7 +30
70
,9 @@
static pj_status_t on_stun_rx_request(pj_stun_session *sess,
msg_data->has_req_data = PJ_FALSE;
/* Send the response */
...
...
@@ -1343,7 +1358,7 @@ index 2a4125bc5..3f8c03cd2 100644
src_addr, src_addr_len, tdata);
@@ -2794,12 +31
78
,12 @@
static void handle_incoming_check(pj_ice_sess *ice,
@@ -2794,12 +31
93
,12 @@
static void handle_incoming_check(pj_ice_sess *ice,
/* Just get candidate with the highest priority and same transport ID
* for the specified component ID in the checklist.
*/
...
...
@@ -2514,7 +2529,7 @@ index f2b4f7058..ed17b904f 100644
+ return sess ? sess->conn_type : PJ_STUN_TP_UDP;
+}
diff --git a/pjnath/src/pjnath/stun_sock.c b/pjnath/src/pjnath/stun_sock.c
index 5fe825cf5..
05461676e
100644
index 5fe825cf5..
eee81f268
100644
--- a/pjnath/src/pjnath/stun_sock.c
+++ b/pjnath/src/pjnath/stun_sock.c
@@ -40,6 +40,36 @@
...
...
@@ -4112,5 +4127,5 @@ index 474a8d07c..9257f07a4 100644
if (status != PJ_SUCCESS) {
char errmsg[PJ_ERR_MSG_SIZE];
--
2.2
5.4
2.2
6.2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment