Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
44173747
Commit
44173747
authored
Jun 06, 2016
by
Simon Morlat
Browse files
fix bug with turn/ice
parent
f6e55b27
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
src/voip/ice.c
src/voip/ice.c
+10
-7
src/voip/stun.c
src/voip/stun.c
+4
-2
No files found.
src/voip/ice.c
View file @
44173747
...
...
@@ -2300,11 +2300,13 @@ static bool_t ice_handle_received_turn_allocate_success_response(IceCheckList *c
candidate
=
ice_add_local_candidate
(
cl
,
"srflx"
,
ms_stun_family_to_af
(
srflx_addr
.
family
),
srflx_addr_str
,
srflx_port
,
componentID
,
candidate
);
ms_stun_address_to_printable_ip_address
(
&
srflx_addr
,
srflx_addr_str
,
sizeof
(
srflx_addr_str
));
ms_message
(
"ice: Add candidate obtained by STUN/TURN: %s:srflx"
,
srflx_addr_str
);
ms_stun_address_to_ip_address
(
&
relay_addr
,
relay_addr_str
,
sizeof
(
relay_addr_str
),
&
relay_port
);
if
(
cl
->
session
->
turn_enabled
)
{
request
->
turn_context
->
stats
.
nb_successful_allocate
++
;
ice_schedule_turn_allocation_refresh
(
cl
,
componentID
,
ms_stun_message_get_lifetime
(
msg
));
}
if
(
relay_addr
.
family
!=
0
){
ms_stun_address_to_ip_address
(
&
relay_addr
,
relay_addr_str
,
sizeof
(
relay_addr_str
),
&
relay_port
);
if
(
relay_port
!=
0
)
{
if
(
cl
->
session
->
turn_enabled
)
{
ms_turn_context_set_allocated_relay_addr
(
request
->
turn_context
,
relay_addr
);
...
...
@@ -2315,6 +2317,7 @@ static bool_t ice_handle_received_turn_allocate_success_response(IceCheckList *c
}
}
}
}
request
->
responded
=
TRUE
;
if
(
cl
->
session
->
turn_enabled
)
{
ms_turn_context_set_state
(
request
->
turn_context
,
MS_TURN_CONTEXT_STATE_ALLOCATION_CREATED
);
...
...
src/voip/stun.c
View file @
44173747
...
...
@@ -585,8 +585,10 @@ MSStunAddress ms_ip_address_to_stun_address(int ai_family, int socktype, const c
MSStunAddress
stun_addr
;
struct
addrinfo
*
res
=
bctbx_ip_address_to_addrinfo
(
ai_family
,
socktype
,
hostname
,
port
);
memset
(
&
stun_addr
,
0
,
sizeof
(
stun_addr
));
if
(
res
){
ms_sockaddr_to_stun_address
(
res
->
ai_addr
,
&
stun_addr
);
bctbx_freeaddrinfo
(
res
);
}
return
stun_addr
;
}
...
...
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