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
282e8dae
Commit
282e8dae
authored
Nov 12, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
free candidates returned by nice_agent_get_local_candidates
parent
580afc6c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
6 deletions
+38
-6
agent/test-fallback.c
agent/test-fallback.c
+2
-0
agent/test-fullmode.c
agent/test-fullmode.c
+20
-2
agent/test-mainloop.c
agent/test-mainloop.c
+3
-1
agent/test-restart.c
agent/test-restart.c
+2
-0
agent/test-thread.c
agent/test-thread.c
+8
-2
agent/test.c
agent/test.c
+3
-1
No files found.
agent/test-fallback.c
View file @
282e8dae
...
@@ -202,6 +202,8 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
...
@@ -202,6 +202,8 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
break
;
break
;
}
}
}
}
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
}
}
...
...
agent/test-fullmode.c
View file @
282e8dae
...
@@ -263,6 +263,8 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
...
@@ -263,6 +263,8 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
*
dstaddr
=
cand
->
addr
;
*
dstaddr
=
cand
->
addr
;
}
}
}
}
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
}
}
...
@@ -279,8 +281,11 @@ static GSList *priv_get_local_candidate (NiceAgent *agent, guint stream_id, guin
...
@@ -279,8 +281,11 @@ static GSList *priv_get_local_candidate (NiceAgent *agent, guint stream_id, guin
out_cand
=
cand
;
out_cand
=
cand
;
}
}
}
}
result
=
g_slist_append
(
result
,
nice_candidate_copy
(
out_cand
));
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
result
=
g_slist_append
(
result
,
out_cand
);
return
result
;
return
result
;
}
}
...
@@ -300,7 +305,7 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
...
@@ -300,7 +305,7 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
{
{
// NiceAddress laddr, raddr, laddr_rtcp, raddr_rtcp;
// NiceAddress laddr, raddr, laddr_rtcp, raddr_rtcp;
NiceCandidate
cdes
;
NiceCandidate
cdes
;
GSList
*
cands
;
GSList
*
cands
,
*
i
;
guint
ls_id
,
rs_id
;
guint
ls_id
,
rs_id
;
init_candidate
(
&
cdes
);
init_candidate
(
&
cdes
);
...
@@ -407,15 +412,23 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
...
@@ -407,15 +412,23 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
g_slist_free (cands);*/
g_slist_free (cands);*/
cands
=
priv_get_local_candidate
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTP
);
cands
=
priv_get_local_candidate
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTP
);
nice_agent_set_remote_candidates
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTP
,
cands
);
nice_agent_set_remote_candidates
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTP
,
cands
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
cands
=
priv_get_local_candidate
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTCP
);
cands
=
priv_get_local_candidate
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTCP
);
nice_agent_set_remote_candidates
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTCP
,
cands
);
nice_agent_set_remote_candidates
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTCP
,
cands
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
cands
=
priv_get_local_candidate
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTP
);
cands
=
priv_get_local_candidate
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTP
);
nice_agent_set_remote_candidates
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTP
,
cands
);
nice_agent_set_remote_candidates
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTP
,
cands
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
cands
=
priv_get_local_candidate
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTCP
);
cands
=
priv_get_local_candidate
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTCP
);
nice_agent_set_remote_candidates
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTCP
,
cands
);
nice_agent_set_remote_candidates
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTCP
,
cands
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
g_debug
(
"test-fullmode: Set properties, next running mainloop until connectivity checks succeed..."
);
g_debug
(
"test-fullmode: Set properties, next running mainloop until connectivity checks succeed..."
);
...
@@ -672,6 +685,8 @@ static int run_full_test_wrong_password (NiceAgent *lagent, NiceAgent *ragent, N
...
@@ -672,6 +685,8 @@ static int run_full_test_wrong_password (NiceAgent *lagent, NiceAgent *ragent, N
laddr
=
cand
->
addr
;
laddr
=
cand
->
addr
;
}
}
}
}
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
cands
=
nice_agent_get_local_candidates
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTP
);
cands
=
nice_agent_get_local_candidates
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTP
);
...
@@ -791,6 +806,8 @@ static int run_full_test_control_conflict (NiceAgent *lagent, NiceAgent *ragent,
...
@@ -791,6 +806,8 @@ static int run_full_test_control_conflict (NiceAgent *lagent, NiceAgent *ragent,
laddr
=
cand
->
addr
;
laddr
=
cand
->
addr
;
}
}
}
}
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
cands
=
nice_agent_get_local_candidates
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTP
);
cands
=
nice_agent_get_local_candidates
(
ragent
,
rs_id
,
NICE_COMPONENT_TYPE_RTP
);
...
@@ -971,6 +988,7 @@ int main (void)
...
@@ -971,6 +988,7 @@ int main (void)
g_assert
(
global_lagent_cands
==
2
);
g_assert
(
global_lagent_cands
==
2
);
g_assert
(
global_ragent_cands
==
2
);
g_assert
(
global_ragent_cands
==
2
);
/* run test with incorrect credentials (make sure process fails) */
/* run test with incorrect credentials (make sure process fails) */
g_debug
(
"test-fullmode: TEST STARTS / incorrect credentials"
);
g_debug
(
"test-fullmode: TEST STARTS / incorrect credentials"
);
result
=
run_full_test_wrong_password
(
lagent
,
ragent
,
&
baseaddr
);
result
=
run_full_test_wrong_password
(
lagent
,
ragent
,
&
baseaddr
);
...
...
agent/test-mainloop.c
View file @
282e8dae
...
@@ -87,12 +87,14 @@ main (void)
...
@@ -87,12 +87,14 @@ main (void)
{
{
NiceCandidate
*
candidate
;
NiceCandidate
*
candidate
;
GSList
*
candidates
;
GSList
*
candidates
,
*
i
;
candidates
=
nice_agent_get_local_candidates
(
agent
,
1
,
1
);
candidates
=
nice_agent_get_local_candidates
(
agent
,
1
,
1
);
candidate
=
candidates
->
data
;
candidate
=
candidates
->
data
;
nice_socket_send
(
candidate
->
sockptr
,
&
(
candidate
->
addr
),
6
,
"
\x80
hello"
);
nice_socket_send
(
candidate
->
sockptr
,
&
(
candidate
->
addr
),
6
,
"
\x80
hello"
);
for
(
i
=
candidates
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
candidates
);
g_slist_free
(
candidates
);
}
}
...
...
agent/test-restart.c
View file @
282e8dae
...
@@ -188,6 +188,8 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
...
@@ -188,6 +188,8 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
*
dstaddr
=
cand
->
addr
;
*
dstaddr
=
cand
->
addr
;
}
}
}
}
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
}
}
...
...
agent/test-thread.c
View file @
282e8dae
...
@@ -94,8 +94,8 @@ cb_new_selected_pair(NiceAgent *agent,
...
@@ -94,8 +94,8 @@ cb_new_selected_pair(NiceAgent *agent,
static
void
cb_candidate_gathering_done
(
NiceAgent
*
agent
,
guint
stream_id
,
gpointer
data
)
static
void
cb_candidate_gathering_done
(
NiceAgent
*
agent
,
guint
stream_id
,
gpointer
data
)
{
{
NiceAgent
*
other
=
g_object_get_data
(
G_OBJECT
(
agent
),
"other-agent"
);
NiceAgent
*
other
=
g_object_get_data
(
G_OBJECT
(
agent
),
"other-agent"
);
const
gchar
*
ufrag
=
NULL
,
*
password
=
NULL
;
gchar
*
ufrag
=
NULL
,
*
password
=
NULL
;
GSList
*
cands
;
GSList
*
cands
,
*
i
;
guint
id
,
other_id
;
guint
id
,
other_id
;
gpointer
tmp
;
gpointer
tmp
;
...
@@ -109,11 +109,17 @@ static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpoin
...
@@ -109,11 +109,17 @@ static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpoin
nice_agent_get_local_credentials
(
agent
,
id
,
&
ufrag
,
&
password
);
nice_agent_get_local_credentials
(
agent
,
id
,
&
ufrag
,
&
password
);
nice_agent_set_remote_credentials
(
other
,
nice_agent_set_remote_credentials
(
other
,
other_id
,
ufrag
,
password
);
other_id
,
ufrag
,
password
);
g_free
(
ufrag
);
g_free
(
password
);
cands
=
nice_agent_get_local_candidates
(
agent
,
id
,
1
);
cands
=
nice_agent_get_local_candidates
(
agent
,
id
,
1
);
g_assert
(
cands
!=
NULL
);
g_assert
(
cands
!=
NULL
);
nice_agent_set_remote_candidates
(
other
,
other_id
,
1
,
cands
);
nice_agent_set_remote_candidates
(
other
,
other_id
,
1
,
cands
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
}
}
...
...
agent/test.c
View file @
282e8dae
...
@@ -49,7 +49,7 @@ main (void)
...
@@ -49,7 +49,7 @@ main (void)
NiceAgent
*
agent
;
NiceAgent
*
agent
;
NiceAddress
addr_local
,
addr_remote
;
NiceAddress
addr_local
,
addr_remote
;
NiceCandidate
*
candidate
;
NiceCandidate
*
candidate
;
GSList
*
candidates
;
GSList
*
candidates
,
*
i
;
guint
stream_id
;
guint
stream_id
;
nice_address_init
(
&
addr_local
);
nice_address_init
(
&
addr_local
);
...
@@ -86,6 +86,8 @@ main (void)
...
@@ -86,6 +86,8 @@ main (void)
nice_address_set_port
(
&
(
candidate
->
addr
),
1
);
nice_address_set_port
(
&
(
candidate
->
addr
),
1
);
g_assert
(
nice_address_equal
(
&
(
candidate
->
addr
),
&
addr_local
));
g_assert
(
nice_address_equal
(
&
(
candidate
->
addr
),
&
addr_local
));
g_assert
(
strncmp
(
candidate
->
foundation
,
"1"
,
1
)
==
0
);
g_assert
(
strncmp
(
candidate
->
foundation
,
"1"
,
1
)
==
0
);
for
(
i
=
candidates
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
candidates
);
g_slist_free
(
candidates
);
/* clean up */
/* clean up */
...
...
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