Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mediastreamer2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
mediastreamer2
Commits
3a0c909d
Commit
3a0c909d
authored
Sep 26, 2012
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround for unknown local relay candidate when adding losing ICE pair.
parent
6104d426
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
ice.c
src/ice.c
+25
-3
No files found.
src/ice.c
View file @
3a0c909d
...
...
@@ -121,6 +121,7 @@ static int ice_compare_pair_priorities(const IceCandidatePair *p1, const IceCand
static
int
ice_compare_pairs
(
const
IceCandidatePair
*
p1
,
const
IceCandidatePair
*
p2
);
static
int
ice_compare_candidates
(
const
IceCandidate
*
c1
,
const
IceCandidate
*
c2
);
static
int
ice_find_host_candidate
(
const
IceCandidate
*
candidate
,
const
uint16_t
*
componentID
);
static
int
ice_find_candidate_from_type_and_componentID
(
const
IceCandidate
*
candidate
,
const
Type_ComponentID
*
tc
);
static
int
ice_find_use_candidate_valid_pair_from_componentID
(
const
IceValidCandidatePair
*
valid_pair
,
const
uint16_t
*
componentID
);
static
int
ice_find_nominated_valid_pair_from_componentID
(
const
IceValidCandidatePair
*
valid_pair
,
const
uint16_t
*
componentID
);
static
int
ice_find_selected_valid_pair_from_componentID
(
const
IceValidCandidatePair
*
valid_pair
,
const
uint16_t
*
componentID
);
...
...
@@ -1214,6 +1215,11 @@ static int ice_find_candidate_from_transport_address(const IceCandidate *candida
return
ice_compare_transport_addresses
(
&
candidate
->
taddr
,
taddr
);
}
static
int
ice_find_candidate_from_ip_address
(
const
IceCandidate
*
candidate
,
const
char
*
ipaddr
)
{
return
strcmp
(
candidate
->
taddr
.
ip
,
ipaddr
);
}
/* Check that the mandatory attributes of a connectivity check binding request are present. */
static
int
ice_check_received_binding_request_attributes
(
const
RtpSession
*
rtp_session
,
const
OrtpEventData
*
evt_data
,
const
StunMessage
*
msg
,
const
StunAddress4
*
remote_addr
)
{
...
...
@@ -1965,7 +1971,9 @@ static void ice_check_if_losing_pair_should_cause_restart(const IceCandidatePair
void
ice_add_losing_pair
(
IceCheckList
*
cl
,
uint16_t
componentID
,
const
char
*
local_addr
,
int
local_port
,
const
char
*
remote_addr
,
int
remote_port
)
{
IceTransportAddress
taddr
;
Type_ComponentID
tc
;
MSList
*
elem
;
MSList
*
srflx_elem
=
NULL
;
LocalCandidate_RemoteCandidate
lr
;
IceCandidatePair
*
pair
;
IceValidCandidatePair
*
valid_pair
;
...
...
@@ -1974,10 +1982,24 @@ void ice_add_losing_pair(IceCheckList *cl, uint16_t componentID, const char *loc
taddr
.
port
=
local_port
;
elem
=
ms_list_find_custom
(
cl
->
local_candidates
,
(
MSCompareFunc
)
ice_find_candidate_from_transport_address
,
&
taddr
);
if
(
elem
==
NULL
)
{
ms_warning
(
"ice: Local candidate %s:%u should have been found"
,
local_addr
,
local_port
);
return
;
/* Workaround to detect if the local candidate that has not been found has been added by the proxy server.
If that is the case, add it to the local candidates now. */
elem
=
ms_list_find_custom
(
cl
->
remote_candidates
,
(
MSCompareFunc
)
ice_find_candidate_from_ip_address
,
local_addr
);
if
(
elem
!=
NULL
)
{
tc
.
componentID
=
componentID
;
tc
.
type
=
ICT_ServerReflexiveCandidate
;
srflx_elem
=
ms_list_find_custom
(
cl
->
remote_candidates
,
(
MSCompareFunc
)
ice_find_candidate_from_type_and_componentID
,
&
tc
);
}
if
(
srflx_elem
!=
NULL
)
{
lr
.
local
=
ice_add_local_candidate
(
cl
,
"relay"
,
local_addr
,
local_port
,
componentID
,
srflx_elem
->
data
);
ice_compute_candidate_foundation
(
lr
.
local
,
cl
);
}
else
{
ms_warning
(
"ice: Local candidate %s:%u should have been found"
,
local_addr
,
local_port
);
return
;
}
}
else
{
lr
.
local
=
(
IceCandidate
*
)
elem
->
data
;
}
lr
.
local
=
(
IceCandidate
*
)
elem
->
data
;
snprintf
(
taddr
.
ip
,
sizeof
(
taddr
.
ip
),
"%s"
,
remote_addr
);
taddr
.
port
=
remote_port
;
elem
=
ms_list_find_custom
(
cl
->
remote_candidates
,
(
MSCompareFunc
)
ice_find_candidate_from_transport_address
,
&
taddr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment