Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
4212b49a
Commit
4212b49a
authored
Sep 01, 2014
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conncheck: Fetch stream once instead of twice
parent
dcf3d71e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
agent/conncheck.c
agent/conncheck.c
+16
-11
No files found.
agent/conncheck.c
View file @
4212b49a
...
@@ -1742,19 +1742,24 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1742,19 +1742,24 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
guint32
priority
;
guint32
priority
;
uint8_t
uname
[
NICE_STREAM_MAX_UNAME
];
uint8_t
uname
[
NICE_STREAM_MAX_UNAME
];
gsize
uname_len
=
Stream
*
stream
;
priv_create_username
(
agent
,
agent_find_stream
(
agent
,
pair
->
stream_id
),
gsize
uname_len
;
pair
->
component_id
,
pair
->
remote
,
pair
->
local
,
uname
,
sizeof
(
uname
),
FALSE
);
uint8_t
*
password
=
NULL
;
uint8_t
*
password
=
NULL
;
gsize
password_len
=
priv_get_password
(
agent
,
gsize
password_len
;
agent_find_stream
(
agent
,
pair
->
stream_id
),
pair
->
remote
,
&
password
);
bool
controlling
=
agent
->
controlling_mode
;
bool
controlling
=
agent
->
controlling_mode
;
/* XXX: add API to support different nomination modes: */
/* XXX: add API to support different nomination modes: */
bool
cand_use
=
controlling
;
bool
cand_use
=
controlling
;
size_t
buffer_len
;
size_t
buffer_len
;
unsigned
int
timeout
;
unsigned
int
timeout
;
if
(
!
agent_find_component
(
agent
,
pair
->
stream_id
,
pair
->
component_id
,
&
stream
,
NULL
))
return
-
1
;
uname_len
=
priv_create_username
(
agent
,
stream
,
pair
->
component_id
,
pair
->
remote
,
pair
->
local
,
uname
,
sizeof
(
uname
),
FALSE
);
password_len
=
priv_get_password
(
agent
,
stream
,
pair
->
remote
,
&
password
);
priority
=
peer_reflexive_candidate_priority
(
agent
,
pair
->
local
);
priority
=
peer_reflexive_candidate_priority
(
agent
,
pair
->
local
);
if
(
password
!=
NULL
&&
if
(
password
!=
NULL
&&
...
@@ -1814,18 +1819,18 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1814,18 +1819,18 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
* check pair, until we discover a new local peer reflexive */
* check pair, until we discover a new local peer reflexive */
if
(
pair
->
sockptr
->
fileno
==
NULL
&&
if
(
pair
->
sockptr
->
fileno
==
NULL
&&
pair
->
local
->
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
)
{
pair
->
local
->
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
)
{
Stream
*
stream
=
NULL
;
Stream
*
stream
2
=
NULL
;
Component
*
component
=
NULL
;
Component
*
component
2
=
NULL
;
NiceSocket
*
new_socket
;
NiceSocket
*
new_socket
;
if
(
agent_find_component
(
agent
,
pair
->
stream_id
,
pair
->
component_id
,
if
(
agent_find_component
(
agent
,
pair
->
stream_id
,
pair
->
component_id
,
&
stream
,
&
component
))
{
&
stream
2
,
&
component2
))
{
new_socket
=
nice_tcp_active_socket_connect
(
pair
->
sockptr
,
new_socket
=
nice_tcp_active_socket_connect
(
pair
->
sockptr
,
&
pair
->
remote
->
addr
);
&
pair
->
remote
->
addr
);
if
(
new_socket
)
{
if
(
new_socket
)
{
pair
->
sockptr
=
new_socket
;
pair
->
sockptr
=
new_socket
;
_priv_set_socket_tos
(
agent
,
pair
->
sockptr
,
stream
->
tos
);
_priv_set_socket_tos
(
agent
,
pair
->
sockptr
,
stream
2
->
tos
);
component_attach_socket
(
component
,
new_socket
);
component_attach_socket
(
component
2
,
new_socket
);
}
}
}
}
}
}
...
...
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