Skip to content
Snippets Groups Projects
Unverified Commit ff5ed9d3 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

filetransfer: fix add_header detection before the first on_return

Change-Id: I59414f3d0c55f13aa8a91e498ee8c694fa73ffe3
parent 33059729
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ on behalf of Savoir-faire Linux. ...@@ -28,7 +28,7 @@ on behalf of Savoir-faire Linux.
pjnath/src/pjnath-test/sess_auth.c | 14 +- pjnath/src/pjnath-test/sess_auth.c | 14 +-
pjnath/src/pjnath-test/stun_sock_test.c | 7 +- pjnath/src/pjnath-test/stun_sock_test.c | 7 +-
pjnath/src/pjnath/ice_session.c | 515 ++++++++++- pjnath/src/pjnath/ice_session.c | 515 ++++++++++-
pjnath/src/pjnath/ice_strans.c | 771 +++++++++++++--- pjnath/src/pjnath/ice_strans.c | 773 +++++++++++++---
pjnath/src/pjnath/nat_detect.c | 7 +- pjnath/src/pjnath/nat_detect.c | 7 +-
pjnath/src/pjnath/stun_session.c | 15 +- pjnath/src/pjnath/stun_session.c | 15 +-
pjnath/src/pjnath/stun_sock.c | 1075 +++++++++++++++++++---- pjnath/src/pjnath/stun_sock.c | 1075 +++++++++++++++++++----
...@@ -40,7 +40,7 @@ on behalf of Savoir-faire Linux. ...@@ -40,7 +40,7 @@ on behalf of Savoir-faire Linux.
pjnath/src/pjturn-srv/server.c | 2 +- pjnath/src/pjturn-srv/server.c | 2 +-
pjsip-apps/src/samples/icedemo.c | 116 ++- pjsip-apps/src/samples/icedemo.c | 116 ++-
pjsip/src/pjsua-lib/pjsua_core.c | 2 +- pjsip/src/pjsua-lib/pjsua_core.c | 2 +-
21 files changed, 2509 insertions(+), 402 deletions(-) 21 files changed, 2510 insertions(+), 403 deletions(-)
diff --git a/pjnath/include/pjnath/ice_session.h b/pjnath/include/pjnath/ice_session.h diff --git a/pjnath/include/pjnath/ice_session.h b/pjnath/include/pjnath/ice_session.h
index 8971220f0..39c197c29 100644 index 8971220f0..39c197c29 100644
...@@ -1387,7 +1387,7 @@ index 2a4125bc5..85d3234c9 100644 ...@@ -1387,7 +1387,7 @@ index 2a4125bc5..85d3234c9 100644
} }
} }
diff --git a/pjnath/src/pjnath/ice_strans.c b/pjnath/src/pjnath/ice_strans.c diff --git a/pjnath/src/pjnath/ice_strans.c b/pjnath/src/pjnath/ice_strans.c
index 3cb350c2a..69df9f40a 100644 index 3cb350c2a..bf7f98096 100644
--- a/pjnath/src/pjnath/ice_strans.c --- a/pjnath/src/pjnath/ice_strans.c
+++ b/pjnath/src/pjnath/ice_strans.c +++ b/pjnath/src/pjnath/ice_strans.c
@@ -69,6 +69,7 @@ enum tp_type @@ -69,6 +69,7 @@ enum tp_type
...@@ -1465,7 +1465,7 @@ index 3cb350c2a..69df9f40a 100644 ...@@ -1465,7 +1465,7 @@ index 3cb350c2a..69df9f40a 100644
+ pj_uint16_t rx_buffer_size; + pj_uint16_t rx_buffer_size;
+ pj_uint16_t rx_wanted_size; + pj_uint16_t rx_wanted_size;
+ +
+ unsigned last_data_len; /**< What the application is waiting. */ + pj_ssize_t last_data_len; /**< What the application is waiting. */
}; };
...@@ -1907,7 +1907,17 @@ index 3cb350c2a..69df9f40a 100644 ...@@ -1907,7 +1907,17 @@ index 3cb350c2a..69df9f40a 100644
ice_st->is_pending = PJ_TRUE; ice_st->is_pending = PJ_TRUE;
ice_st->buf_idx = idx; ice_st->buf_idx = idx;
@@ -1659,16 +1772,40 @@ static pj_status_t send_data(pj_ice_strans *ice_st, @@ -1651,6 +1764,9 @@ static pj_status_t send_data(pj_ice_strans *ice_st,
}
}
+ def_cand = &comp->cand_list[comp->default_cand];
+ pj_bool_t add_header = def_cand->transport != PJ_CAND_UDP;
+
/* If ICE is available, send data with ICE, otherwise send with the
* default candidate selected during initialization.
*
@@ -1659,16 +1775,37 @@ static pj_status_t send_data(pj_ice_strans *ice_st,
*/ */
if (ice_st->ice && ice_st->state == PJ_ICE_STRANS_STATE_RUNNING) { if (ice_st->ice && ice_st->state == PJ_ICE_STRANS_STATE_RUNNING) {
status = pj_ice_sess_send_data(ice_st->ice, comp_id, buf, data_len); status = pj_ice_sess_send_data(ice_st->ice, comp_id, buf, data_len);
...@@ -1922,10 +1932,8 @@ index 3cb350c2a..69df9f40a 100644 ...@@ -1922,10 +1932,8 @@ index 3cb350c2a..69df9f40a 100644
pj_grp_lock_release(ice_st->grp_lock); pj_grp_lock_release(ice_st->grp_lock);
def_cand = &comp->cand_list[comp->default_cand]; - def_cand = &comp->cand_list[comp->default_cand];
- -
+
+ pj_bool_t add_header = def_cand->transport != PJ_CAND_UDP;
+ /* TCP, add header */ + /* TCP, add header */
+ if (add_header) { + if (add_header) {
+ /* + /*
...@@ -4157,4 +4165,4 @@ index 474a8d07c..9257f07a4 100644 ...@@ -4157,4 +4165,4 @@ index 474a8d07c..9257f07a4 100644
if (status != PJ_SUCCESS) { if (status != PJ_SUCCESS) {
char errmsg[PJ_ERR_MSG_SIZE]; char errmsg[PJ_ERR_MSG_SIZE];
-- --
2.25.2 2.26.2
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment