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
a4b82ce4
Commit
a4b82ce4
authored
Oct 28, 2018
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
component: Replace agent pointer with weak reference
This should make it safer.
parent
d2cdf2e2
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
73 deletions
+126
-73
agent/agent.c
agent/agent.c
+54
-17
agent/component.c
agent/component.c
+59
-42
agent/component.h
agent/component.h
+5
-6
agent/conncheck.c
agent/conncheck.c
+5
-5
agent/stream.c
agent/stream.c
+2
-2
agent/stream.h
agent/stream.h
+1
-1
No files found.
agent/agent.c
View file @
a4b82ce4
...
@@ -1625,12 +1625,18 @@ static void
...
@@ -1625,12 +1625,18 @@ static void
pseudo_tcp_socket_opened
(
PseudoTcpSocket
*
sock
,
gpointer
user_data
)
pseudo_tcp_socket_opened
(
PseudoTcpSocket
*
sock
,
gpointer
user_data
)
{
{
NiceComponent
*
component
=
user_data
;
NiceComponent
*
component
=
user_data
;
NiceAgent
*
agent
=
component
->
agent
;
NiceAgent
*
agent
;
agent
=
g_weak_ref_get
(
&
component
->
agent_ref
);
if
(
agent
==
NULL
)
return
;
nice_debug
(
"Agent %p: s%d:%d pseudo Tcp socket Opened"
,
agent
,
nice_debug
(
"Agent %p: s%d:%d pseudo Tcp socket Opened"
,
agent
,
component
->
stream_id
,
component
->
id
);
component
->
stream_id
,
component
->
id
);
agent_signal_socket_writable
(
agent
,
component
);
agent_signal_socket_writable
(
agent
,
component
);
g_object_unref
(
agent
);
}
}
/* Will attempt to queue all @n_messages into the pseudo-TCP transmission
/* Will attempt to queue all @n_messages into the pseudo-TCP transmission
...
@@ -1784,17 +1790,18 @@ static void
...
@@ -1784,17 +1790,18 @@ static void
pseudo_tcp_socket_readable
(
PseudoTcpSocket
*
sock
,
gpointer
user_data
)
pseudo_tcp_socket_readable
(
PseudoTcpSocket
*
sock
,
gpointer
user_data
)
{
{
NiceComponent
*
component
=
user_data
;
NiceComponent
*
component
=
user_data
;
NiceAgent
*
agent
=
component
->
agent
;
NiceAgent
*
agent
;
gboolean
has_io_callback
;
gboolean
has_io_callback
;
NiceStream
*
stream
=
NULL
;
NiceStream
*
stream
=
NULL
;
guint
stream_id
=
component
->
stream_id
;
guint
stream_id
=
component
->
stream_id
;
guint
component_id
=
component
->
id
;
guint
component_id
=
component
->
id
;
g_object_ref
(
agent
);
agent
=
g_weak_ref_get
(
&
component
->
agent_ref
);
if
(
agent
==
NULL
)
return
;
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
&
stream
,
&
component
))
{
&
stream
,
&
component
))
{
g_object_unref
(
agent
);
goto
out
;
goto
out
;
}
}
...
@@ -1850,7 +1857,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
...
@@ -1850,7 +1857,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
break
;
break
;
}
}
nice_component_emit_io_callback
(
component
,
buf
,
len
);
nice_component_emit_io_callback
(
agent
,
component
,
buf
,
len
);
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
&
stream
,
&
component
))
{
&
stream
,
&
component
))
{
...
@@ -1915,12 +1922,18 @@ static void
...
@@ -1915,12 +1922,18 @@ static void
pseudo_tcp_socket_writable
(
PseudoTcpSocket
*
sock
,
gpointer
user_data
)
pseudo_tcp_socket_writable
(
PseudoTcpSocket
*
sock
,
gpointer
user_data
)
{
{
NiceComponent
*
component
=
user_data
;
NiceComponent
*
component
=
user_data
;
NiceAgent
*
agent
=
component
->
agent
;
NiceAgent
*
agent
;
agent
=
g_weak_ref_get
(
&
component
->
agent_ref
);
if
(
agent
==
NULL
)
return
;
nice_debug_verbose
(
"Agent %p: s%d:%d pseudo Tcp socket writable"
,
agent
,
nice_debug_verbose
(
"Agent %p: s%d:%d pseudo Tcp socket writable"
,
agent
,
component
->
stream_id
,
component
->
id
);
component
->
stream_id
,
component
->
id
);
agent_signal_socket_writable
(
agent
,
component
);
agent_signal_socket_writable
(
agent
,
component
);
g_object_unref
(
agent
);
}
}
static
void
static
void
...
@@ -1928,12 +1941,18 @@ pseudo_tcp_socket_closed (PseudoTcpSocket *sock, guint32 err,
...
@@ -1928,12 +1941,18 @@ pseudo_tcp_socket_closed (PseudoTcpSocket *sock, guint32 err,
gpointer
user_data
)
gpointer
user_data
)
{
{
NiceComponent
*
component
=
user_data
;
NiceComponent
*
component
=
user_data
;
NiceAgent
*
agent
=
component
->
agent
;
NiceAgent
*
agent
;
agent
=
g_weak_ref_get
(
&
component
->
agent_ref
);
if
(
agent
==
NULL
)
return
;
nice_debug
(
"Agent %p: s%d:%d pseudo Tcp socket closed. "
nice_debug
(
"Agent %p: s%d:%d pseudo Tcp socket closed. "
"Calling priv_pseudo_tcp_error()."
,
agent
,
component
->
stream_id
,
"Calling priv_pseudo_tcp_error()."
,
agent
,
component
->
stream_id
,
component
->
id
);
component
->
id
);
priv_pseudo_tcp_error
(
agent
,
component
);
priv_pseudo_tcp_error
(
agent
,
component
);
g_object_unref
(
agent
);
}
}
...
@@ -1942,6 +1961,11 @@ pseudo_tcp_socket_write_packet (PseudoTcpSocket *psocket,
...
@@ -1942,6 +1961,11 @@ pseudo_tcp_socket_write_packet (PseudoTcpSocket *psocket,
const
gchar
*
buffer
,
guint32
len
,
gpointer
user_data
)
const
gchar
*
buffer
,
guint32
len
,
gpointer
user_data
)
{
{
NiceComponent
*
component
=
user_data
;
NiceComponent
*
component
=
user_data
;
NiceAgent
*
agent
;
agent
=
g_weak_ref_get
(
&
component
->
agent_ref
);
if
(
agent
==
NULL
)
return
WR_FAIL
;
if
(
component
->
selected_pair
.
local
!=
NULL
)
{
if
(
component
->
selected_pair
.
local
!=
NULL
)
{
NiceSocket
*
sock
;
NiceSocket
*
sock
;
...
@@ -1956,7 +1980,7 @@ pseudo_tcp_socket_write_packet (PseudoTcpSocket *psocket,
...
@@ -1956,7 +1980,7 @@ pseudo_tcp_socket_write_packet (PseudoTcpSocket *psocket,
nice_debug_verbose
(
nice_debug_verbose
(
"Agent %p : s%d:%d: sending %d bytes on socket %p (FD %d) to [%s]:%d"
,
"Agent %p : s%d:%d: sending %d bytes on socket %p (FD %d) to [%s]:%d"
,
component
->
agent
,
component
->
stream_id
,
component
->
id
,
len
,
agent
,
component
->
stream_id
,
component
->
id
,
len
,
sock
->
fileno
,
g_socket_get_fd
(
sock
->
fileno
),
tmpbuf
,
sock
->
fileno
,
g_socket_get_fd
(
sock
->
fileno
),
tmpbuf
,
nice_address_get_port
(
addr
));
nice_address_get_port
(
addr
));
}
}
...
@@ -1968,13 +1992,16 @@ pseudo_tcp_socket_write_packet (PseudoTcpSocket *psocket,
...
@@ -1968,13 +1992,16 @@ pseudo_tcp_socket_write_packet (PseudoTcpSocket *psocket,
* its transmission rate and, hopefully, the usage of system resources
* its transmission rate and, hopefully, the usage of system resources
* which caused the EWOULDBLOCK in the first place. */
* which caused the EWOULDBLOCK in the first place. */
if
(
nice_socket_send
(
sock
,
addr
,
len
,
buffer
)
>=
0
)
{
if
(
nice_socket_send
(
sock
,
addr
,
len
,
buffer
)
>=
0
)
{
g_object_unref
(
agent
);
return
WR_SUCCESS
;
return
WR_SUCCESS
;
}
}
}
else
{
}
else
{
nice_debug
(
"%s: WARNING: Failed to send pseudo-TCP packet from agent %p "
nice_debug
(
"%s: WARNING: Failed to send pseudo-TCP packet from agent %p "
"as no pair has been selected yet."
,
G_STRFUNC
,
component
->
agent
);
"as no pair has been selected yet."
,
G_STRFUNC
,
agent
);
}
}
g_object_unref
(
agent
);
return
WR_FAIL
;
return
WR_FAIL
;
}
}
...
@@ -2032,7 +2059,11 @@ void
...
@@ -2032,7 +2059,11 @@ void
_tcp_sock_is_writable
(
NiceSocket
*
sock
,
gpointer
user_data
)
_tcp_sock_is_writable
(
NiceSocket
*
sock
,
gpointer
user_data
)
{
{
NiceComponent
*
component
=
user_data
;
NiceComponent
*
component
=
user_data
;
NiceAgent
*
agent
=
component
->
agent
;
NiceAgent
*
agent
;
agent
=
g_weak_ref_get
(
&
component
->
agent_ref
);
if
(
agent
==
NULL
)
return
;
agent_lock
(
agent
);
agent_lock
(
agent
);
...
@@ -2049,6 +2080,8 @@ _tcp_sock_is_writable (NiceSocket *sock, gpointer user_data)
...
@@ -2049,6 +2080,8 @@ _tcp_sock_is_writable (NiceSocket *sock, gpointer user_data)
agent_signal_socket_writable
(
agent
,
component
);
agent_signal_socket_writable
(
agent
,
component
);
agent_unlock_and_emit
(
agent
);
agent_unlock_and_emit
(
agent
);
g_object_unref
(
agent
);
}
}
static
const
gchar
*
static
const
gchar
*
...
@@ -3216,7 +3249,7 @@ nice_agent_remove_stream (
...
@@ -3216,7 +3249,7 @@ nice_agent_remove_stream (
/* Remove the stream and signal its removal. */
/* Remove the stream and signal its removal. */
agent
->
streams
=
g_slist_remove
(
agent
->
streams
,
stream
);
agent
->
streams
=
g_slist_remove
(
agent
->
streams
,
stream
);
nice_stream_close
(
stream
);
nice_stream_close
(
agent
,
stream
);
if
(
!
agent
->
streams
)
if
(
!
agent
->
streams
)
priv_remove_keepalive_timer
(
agent
);
priv_remove_keepalive_timer
(
agent
);
...
@@ -5073,7 +5106,7 @@ nice_agent_dispose (GObject *object)
...
@@ -5073,7 +5106,7 @@ nice_agent_dispose (GObject *object)
{
{
NiceStream
*
s
=
i
->
data
;
NiceStream
*
s
=
i
->
data
;
nice_stream_close
(
s
);
nice_stream_close
(
agent
,
s
);
g_object_unref
(
s
);
g_object_unref
(
s
);
}
}
...
@@ -5133,7 +5166,10 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
...
@@ -5133,7 +5166,10 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
gboolean
remove_source
=
FALSE
;
gboolean
remove_source
=
FALSE
;
component
=
socket_source
->
component
;
component
=
socket_source
->
component
;
agent
=
component
->
agent
;
agent
=
g_weak_ref_get
(
&
component
->
agent_ref
);
if
(
agent
==
NULL
)
return
G_SOURCE_REMOVE
;
agent_lock
(
agent
);
agent_lock
(
agent
);
...
@@ -5143,6 +5179,7 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
...
@@ -5143,6 +5179,7 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
nice_debug
(
"%s: stream %d destroyed"
,
G_STRFUNC
,
component
->
stream_id
);
nice_debug
(
"%s: stream %d destroyed"
,
G_STRFUNC
,
component
->
stream_id
);
agent_unlock
(
agent
);
agent_unlock
(
agent
);
g_object_unref
(
agent
);
return
G_SOURCE_REMOVE
;
return
G_SOURCE_REMOVE
;
}
}
...
@@ -5151,11 +5188,10 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
...
@@ -5151,11 +5188,10 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
nice_debug
(
"%s: source %p destroyed"
,
G_STRFUNC
,
g_main_current_source
());
nice_debug
(
"%s: source %p destroyed"
,
G_STRFUNC
,
g_main_current_source
());
agent_unlock
(
agent
);
agent_unlock
(
agent
);
g_object_unref
(
agent
);
return
G_SOURCE_REMOVE
;
return
G_SOURCE_REMOVE
;
}
}
g_object_ref
(
agent
);
/* Remove disconnected sockets when we get a HUP */
/* Remove disconnected sockets when we get a HUP */
if
(
condition
&
G_IO_HUP
)
{
if
(
condition
&
G_IO_HUP
)
{
nice_debug
(
"Agent %p: NiceSocket %p has received HUP"
,
agent
,
nice_debug
(
"Agent %p: NiceSocket %p has received HUP"
,
agent
,
...
@@ -5279,7 +5315,8 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
...
@@ -5279,7 +5315,8 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
" bytes"
,
G_STRFUNC
,
agent
,
local_message
.
length
);
" bytes"
,
G_STRFUNC
,
agent
,
local_message
.
length
);
if
(
local_message
.
length
>
0
)
{
if
(
local_message
.
length
>
0
)
{
nice_component_emit_io_callback
(
component
,
local_buf
,
local_message
.
length
);
nice_component_emit_io_callback
(
agent
,
component
,
local_buf
,
local_message
.
length
);
}
}
}
}
...
@@ -5466,7 +5503,7 @@ nice_agent_set_selected_pair (
...
@@ -5466,7 +5503,7 @@ nice_agent_set_selected_pair (
NICE_COMPONENT_STATE_READY
);
NICE_COMPONENT_STATE_READY
);
/* step: set the selected pair */
/* step: set the selected pair */
nice_component_update_selected_pair
(
component
,
&
pair
);
nice_component_update_selected_pair
(
agent
,
component
,
&
pair
);
agent_signal_new_selected_pair
(
agent
,
stream_id
,
component_id
,
agent_signal_new_selected_pair
(
agent
,
stream_id
,
component_id
,
pair
.
local
,
pair
.
remote
);
pair
.
local
,
pair
.
remote
);
...
...
agent/component.c
View file @
a4b82ce4
This diff is collapsed.
Click to expand it.
agent/component.h
View file @
a4b82ce4
...
@@ -199,8 +199,7 @@ struct _NiceComponent {
...
@@ -199,8 +199,7 @@ struct _NiceComponent {
recv_messages */
recv_messages */
GError
**
recv_buf_error
;
/* error information about failed reads */
GError
**
recv_buf_error
;
/* error information about failed reads */
NiceAgent
*
agent
;
/* unowned, immutable: can be accessed without holding the
GWeakRef
agent_ref
;
* agent lock */
guint
stream_id
;
guint
stream_id
;
StunAgent
stun_agent
;
/* This stun agent is used to validate all stun requests */
StunAgent
stun_agent
;
/* This stun agent is used to validate all stun requests */
...
@@ -236,7 +235,7 @@ NiceComponent *
...
@@ -236,7 +235,7 @@ NiceComponent *
nice_component_new
(
guint
component_id
,
NiceAgent
*
agent
,
NiceStream
*
stream
);
nice_component_new
(
guint
component_id
,
NiceAgent
*
agent
,
NiceStream
*
stream
);
void
void
nice_component_close
(
NiceComponent
*
component
);
nice_component_close
(
Nice
Agent
*
agent
,
Nice
Component
*
component
);
gboolean
gboolean
nice_component_find_pair
(
NiceComponent
*
component
,
NiceAgent
*
agent
,
nice_component_find_pair
(
NiceComponent
*
component
,
NiceAgent
*
agent
,
...
@@ -246,7 +245,7 @@ void
...
@@ -246,7 +245,7 @@ void
nice_component_restart
(
NiceComponent
*
component
);
nice_component_restart
(
NiceComponent
*
component
);
void
void
nice_component_update_selected_pair
(
NiceComponent
*
component
,
nice_component_update_selected_pair
(
Nice
Agent
*
agent
,
Nice
Component
*
component
,
const
CandidatePair
*
pair
);
const
CandidatePair
*
pair
);
NiceCandidate
*
NiceCandidate
*
...
@@ -284,7 +283,7 @@ nice_component_set_io_callback (NiceComponent *component,
...
@@ -284,7 +283,7 @@ nice_component_set_io_callback (NiceComponent *component,
NiceInputMessage
*
recv_messages
,
guint
n_recv_messages
,
NiceInputMessage
*
recv_messages
,
guint
n_recv_messages
,
GError
**
error
);
GError
**
error
);
void
void
nice_component_emit_io_callback
(
NiceComponent
*
component
,
nice_component_emit_io_callback
(
Nice
Agent
*
agent
,
Nice
Component
*
component
,
const
guint8
*
buf
,
gsize
buf_len
);
const
guint8
*
buf
,
gsize
buf_len
);
gboolean
gboolean
nice_component_has_io_callback
(
NiceComponent
*
component
);
nice_component_has_io_callback
(
NiceComponent
*
component
);
...
@@ -303,7 +302,7 @@ void
...
@@ -303,7 +302,7 @@ void
turn_server_unref
(
TurnServer
*
turn
);
turn_server_unref
(
TurnServer
*
turn
);
void
void
nice_component_add_valid_candidate
(
NiceComponent
*
component
,
nice_component_add_valid_candidate
(
Nice
Agent
*
agent
,
Nice
Component
*
component
,
const
NiceCandidate
*
candidate
);
const
NiceCandidate
*
candidate
);
gboolean
gboolean
...
...
agent/conncheck.c
View file @
a4b82ce4
...
@@ -1732,7 +1732,7 @@ static gboolean priv_update_selected_pair (NiceAgent *agent, NiceComponent *comp
...
@@ -1732,7 +1732,7 @@ static gboolean priv_update_selected_pair (NiceAgent *agent, NiceComponent *comp
cpair
.
priority
=
pair
->
priority
;
cpair
.
priority
=
pair
->
priority
;
/* cpair.keepalive is not used by nice_component_update_selected_pair() */
/* cpair.keepalive is not used by nice_component_update_selected_pair() */
nice_component_update_selected_pair
(
component
,
&
cpair
);
nice_component_update_selected_pair
(
agent
,
component
,
&
cpair
);
priv_conn_keepalive_tick_unlocked
(
agent
);
priv_conn_keepalive_tick_unlocked
(
agent
);
...
@@ -3041,7 +3041,7 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *
...
@@ -3041,7 +3041,7 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *
SET_PAIR_STATE
(
agent
,
p
,
NICE_CHECK_SUCCEEDED
);
SET_PAIR_STATE
(
agent
,
p
,
NICE_CHECK_SUCCEEDED
);
priv_remove_pair_from_triggered_check_queue
(
agent
,
p
);
priv_remove_pair_from_triggered_check_queue
(
agent
,
p
);
priv_free_all_stun_transactions
(
p
,
component
);
priv_free_all_stun_transactions
(
p
,
component
);
nice_component_add_valid_candidate
(
component
,
remote_candidate
);
nice_component_add_valid_candidate
(
agent
,
component
,
remote_candidate
);
}
}
else
{
else
{
if
(
!
local_cand
)
{
if
(
!
local_cand
)
{
...
@@ -3079,7 +3079,7 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *
...
@@ -3079,7 +3079,7 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *
}
}
if
(
new_pair
&&
new_pair
->
valid
)
if
(
new_pair
&&
new_pair
->
valid
)
nice_component_add_valid_candidate
(
component
,
remote_candidate
);
nice_component_add_valid_candidate
(
agent
,
component
,
remote_candidate
);
return
new_pair
;
return
new_pair
;
...
@@ -3165,7 +3165,7 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, NiceStre
...
@@ -3165,7 +3165,7 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, NiceStre
nice_debug
(
"Agent %p : Mapped address not found"
,
agent
);
nice_debug
(
"Agent %p : Mapped address not found"
,
agent
);
SET_PAIR_STATE
(
agent
,
p
,
NICE_CHECK_SUCCEEDED
);
SET_PAIR_STATE
(
agent
,
p
,
NICE_CHECK_SUCCEEDED
);
p
->
valid
=
TRUE
;
p
->
valid
=
TRUE
;
nice_component_add_valid_candidate
(
component
,
p
->
remote
);
nice_component_add_valid_candidate
(
agent
,
component
,
p
->
remote
);
}
else
}
else
ok_pair
=
priv_process_response_check_for_reflexive
(
agent
,
ok_pair
=
priv_process_response_check_for_reflexive
(
agent
,
stream
,
component
,
p
,
sockptr
,
&
sockaddr
.
addr
,
stream
,
component
,
p
,
sockptr
,
&
sockaddr
.
addr
,
...
@@ -4203,7 +4203,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream,
...
@@ -4203,7 +4203,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream,
}
}
}
}
nice_component_add_valid_candidate
(
component
,
remote_candidate
);
nice_component_add_valid_candidate
(
agent
,
component
,
remote_candidate
);
priv_reply_to_conn_check
(
agent
,
stream
,
component
,
local_candidate
,
priv_reply_to_conn_check
(
agent
,
stream
,
component
,
local_candidate
,
remote_candidate
,
from
,
nicesock
,
rbuf_len
,
&
msg
,
use_candidate
);
remote_candidate
,
from
,
nicesock
,
rbuf_len
,
&
msg
,
use_candidate
);
...
...
agent/stream.c
View file @
a4b82ce4
...
@@ -81,13 +81,13 @@ nice_stream_new (guint stream_id, guint n_components, NiceAgent *agent)
...
@@ -81,13 +81,13 @@ nice_stream_new (guint stream_id, guint n_components, NiceAgent *agent)
}
}
void
void
nice_stream_close
(
NiceStream
*
stream
)
nice_stream_close
(
Nice
Agent
*
agent
,
Nice
Stream
*
stream
)
{
{
GSList
*
i
;
GSList
*
i
;
for
(
i
=
stream
->
components
;
i
;
i
=
i
->
next
)
{
for
(
i
=
stream
->
components
;
i
;
i
=
i
->
next
)
{
NiceComponent
*
component
=
i
->
data
;
NiceComponent
*
component
=
i
->
data
;
nice_component_close
(
component
);
nice_component_close
(
agent
,
component
);
}
}
}
}
...
...
agent/stream.h
View file @
a4b82ce4
...
@@ -101,7 +101,7 @@ NiceStream *
...
@@ -101,7 +101,7 @@ NiceStream *
nice_stream_new
(
guint
stream_id
,
guint
n_components
,
NiceAgent
*
agent
);
nice_stream_new
(
guint
stream_id
,
guint
n_components
,
NiceAgent
*
agent
);
void
void
nice_stream_close
(
NiceStream
*
stream
);
nice_stream_close
(
Nice
Agent
*
agent
,
Nice
Stream
*
stream
);
NiceComponent
*
NiceComponent
*
nice_stream_find_component_by_id
(
NiceStream
*
stream
,
guint
id
);
nice_stream_find_component_by_id
(
NiceStream
*
stream
,
guint
id
);
...
...
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