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
7cb326cf
Commit
7cb326cf
authored
Jul 09, 2014
by
Olivier Crête
Committed by
Youness Alaoui
Jul 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "agent: Separate reliability from ice-tcp vs ice-udp"
This reverts commit
18e5dff4
.
parent
5f031cc8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
31 deletions
+17
-31
agent/agent.c
agent/agent.c
+3
-4
agent/discovery.c
agent/discovery.c
+2
-4
socket/tcp-active.c
socket/tcp-active.c
+2
-5
socket/tcp-active.h
socket/tcp-active.h
+1
-2
socket/tcp-passive.c
socket/tcp-passive.c
+2
-8
socket/tcp-passive.h
socket/tcp-passive.h
+1
-2
tests/test-icetcp.c
tests/test-icetcp.c
+4
-4
tests/test-tcp.c
tests/test-tcp.c
+2
-2
No files found.
agent/agent.c
View file @
7cb326cf
...
@@ -1792,13 +1792,12 @@ void agent_gathering_done (NiceAgent *agent)
...
@@ -1792,13 +1792,12 @@ void agent_gathering_done (NiceAgent *agent)
if
(
nice_debug_is_enabled
())
{
if
(
nice_debug_is_enabled
())
{
gchar
tmpbuf
[
INET6_ADDRSTRLEN
];
gchar
tmpbuf
[
INET6_ADDRSTRLEN
];
nice_address_to_string
(
&
local_candidate
->
addr
,
tmpbuf
);
nice_address_to_string
(
&
local_candidate
->
addr
,
tmpbuf
);
nice_debug
(
"Agent %p: gathered %s local candidate: [%s]:%u"
nice_debug
(
"Agent %p: gathered %s local candidate
: [%s]:%u"
" for s%d/c%d. U/P '%s'/'%s'
prio: %u
"
,
agent
,
" for s%d/c%d. U/P '%s'/'%s'"
,
agent
,
_transport_to_string
(
local_candidate
->
transport
),
_transport_to_string
(
local_candidate
->
transport
),
tmpbuf
,
nice_address_get_port
(
&
local_candidate
->
addr
),
tmpbuf
,
nice_address_get_port
(
&
local_candidate
->
addr
),
local_candidate
->
stream_id
,
local_candidate
->
component_id
,
local_candidate
->
stream_id
,
local_candidate
->
component_id
,
local_candidate
->
username
,
local_candidate
->
password
,
local_candidate
->
username
,
local_candidate
->
password
);
local_candidate
->
priority
);
}
}
for
(
l
=
component
->
remote_candidates
;
l
;
l
=
l
->
next
)
{
for
(
l
=
component
->
remote_candidates
;
l
;
l
=
l
->
next
)
{
NiceCandidate
*
remote_candidate
=
l
->
data
;
NiceCandidate
*
remote_candidate
=
l
->
data
;
...
...
agent/discovery.c
View file @
7cb326cf
...
@@ -512,11 +512,9 @@ HostCandidateResult discovery_add_local_host_candidate (
...
@@ -512,11 +512,9 @@ HostCandidateResult discovery_add_local_host_candidate (
if
(
transport
==
NICE_CANDIDATE_TRANSPORT_UDP
)
{
if
(
transport
==
NICE_CANDIDATE_TRANSPORT_UDP
)
{
nicesock
=
nice_udp_bsd_socket_new
(
address
);
nicesock
=
nice_udp_bsd_socket_new
(
address
);
}
else
if
(
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
)
{
}
else
if
(
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
)
{
nicesock
=
nice_tcp_active_socket_new
(
agent
->
main_context
,
address
,
nicesock
=
nice_tcp_active_socket_new
(
agent
->
main_context
,
address
);
agent
->
reliable
);
}
else
if
(
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE
)
{
}
else
if
(
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE
)
{
nicesock
=
nice_tcp_passive_socket_new
(
agent
->
main_context
,
address
,
nicesock
=
nice_tcp_passive_socket_new
(
agent
->
main_context
,
address
);
agent
->
reliable
);
}
else
{
}
else
{
/* TODO: Add TCP-SO */
/* TODO: Add TCP-SO */
}
}
...
...
socket/tcp-active.c
View file @
7cb326cf
...
@@ -51,7 +51,6 @@
...
@@ -51,7 +51,6 @@
#endif
#endif
typedef
struct
{
typedef
struct
{
gboolean
reliable
;
GSocketAddress
*
local_addr
;
GSocketAddress
*
local_addr
;
GMainContext
*
context
;
GMainContext
*
context
;
}
TcpActivePriv
;
}
TcpActivePriv
;
...
@@ -71,8 +70,7 @@ static void socket_set_writable_callback (NiceSocket *sock,
...
@@ -71,8 +70,7 @@ static void socket_set_writable_callback (NiceSocket *sock,
NiceSocket
*
NiceSocket
*
nice_tcp_active_socket_new
(
GMainContext
*
ctx
,
NiceAddress
*
addr
,
nice_tcp_active_socket_new
(
GMainContext
*
ctx
,
NiceAddress
*
addr
)
gboolean
reliable
)
{
{
union
{
union
{
struct
sockaddr_storage
storage
;
struct
sockaddr_storage
storage
;
...
@@ -109,7 +107,6 @@ nice_tcp_active_socket_new (GMainContext *ctx, NiceAddress *addr,
...
@@ -109,7 +107,6 @@ nice_tcp_active_socket_new (GMainContext *ctx, NiceAddress *addr,
sock
->
priv
=
priv
=
g_slice_new0
(
TcpActivePriv
);
sock
->
priv
=
priv
=
g_slice_new0
(
TcpActivePriv
);
priv
->
reliable
=
reliable
;
priv
->
context
=
g_main_context_ref
(
ctx
);
priv
->
context
=
g_main_context_ref
(
ctx
);
priv
->
local_addr
=
gaddr
;
priv
->
local_addr
=
gaddr
;
...
@@ -256,7 +253,7 @@ nice_tcp_active_socket_connect (NiceSocket *sock, NiceAddress *addr)
...
@@ -256,7 +253,7 @@ nice_tcp_active_socket_connect (NiceSocket *sock, NiceAddress *addr)
nice_address_set_from_sockaddr
(
&
local_addr
,
&
name
.
addr
);
nice_address_set_from_sockaddr
(
&
local_addr
,
&
name
.
addr
);
new_socket
=
nice_tcp_bsd_socket_new_from_gsock
(
priv
->
context
,
gsock
,
new_socket
=
nice_tcp_bsd_socket_new_from_gsock
(
priv
->
context
,
gsock
,
&
local_addr
,
addr
,
priv
->
reliable
);
&
local_addr
,
addr
,
TRUE
);
g_object_unref
(
gsock
);
g_object_unref
(
gsock
);
return
new_socket
;
return
new_socket
;
...
...
socket/tcp-active.h
View file @
7cb326cf
...
@@ -41,8 +41,7 @@
...
@@ -41,8 +41,7 @@
G_BEGIN_DECLS
G_BEGIN_DECLS
NiceSocket
*
nice_tcp_active_socket_new
(
GMainContext
*
ctx
,
NiceAddress
*
addr
,
NiceSocket
*
nice_tcp_active_socket_new
(
GMainContext
*
ctx
,
NiceAddress
*
addr
);
gboolean
reliable
);
NiceSocket
*
nice_tcp_active_socket_connect
(
NiceSocket
*
socket
,
NiceAddress
*
addr
);
NiceSocket
*
nice_tcp_active_socket_connect
(
NiceSocket
*
socket
,
NiceAddress
*
addr
);
...
...
socket/tcp-passive.c
View file @
7cb326cf
...
@@ -51,8 +51,6 @@
...
@@ -51,8 +51,6 @@
#endif
#endif
typedef
struct
{
typedef
struct
{
gboolean
reliable
;
GMainContext
*
context
;
GMainContext
*
context
;
GHashTable
*
connections
;
GHashTable
*
connections
;
NiceSocketWritableCb
writable_cb
;
NiceSocketWritableCb
writable_cb
;
...
@@ -75,8 +73,7 @@ static void socket_set_writable_callback (NiceSocket *sock,
...
@@ -75,8 +73,7 @@ static void socket_set_writable_callback (NiceSocket *sock,
static
guint
nice_address_hash
(
const
NiceAddress
*
key
);
static
guint
nice_address_hash
(
const
NiceAddress
*
key
);
NiceSocket
*
NiceSocket
*
nice_tcp_passive_socket_new
(
GMainContext
*
ctx
,
NiceAddress
*
addr
,
nice_tcp_passive_socket_new
(
GMainContext
*
ctx
,
NiceAddress
*
addr
)
gboolean
reliable
)
{
{
union
{
union
{
struct
sockaddr_storage
storage
;
struct
sockaddr_storage
storage
;
...
@@ -154,7 +151,6 @@ nice_tcp_passive_socket_new (GMainContext *ctx, NiceAddress *addr,
...
@@ -154,7 +151,6 @@ nice_tcp_passive_socket_new (GMainContext *ctx, NiceAddress *addr,
nice_address_set_from_sockaddr
(
&
sock
->
addr
,
&
name
.
addr
);
nice_address_set_from_sockaddr
(
&
sock
->
addr
,
&
name
.
addr
);
sock
->
priv
=
priv
=
g_slice_new0
(
TcpPassivePriv
);
sock
->
priv
=
priv
=
g_slice_new0
(
TcpPassivePriv
);
priv
->
reliable
=
reliable
;
priv
->
context
=
g_main_context_ref
(
ctx
);
priv
->
context
=
g_main_context_ref
(
ctx
);
priv
->
connections
=
g_hash_table_new_full
((
GHashFunc
)
nice_address_hash
,
priv
->
connections
=
g_hash_table_new_full
((
GHashFunc
)
nice_address_hash
,
(
GEqualFunc
)
nice_address_equal
,
(
(
GEqualFunc
)
nice_address_equal
,
(
...
@@ -223,9 +219,7 @@ static gint socket_send_messages_reliable (NiceSocket *sock,
...
@@ -223,9 +219,7 @@ static gint socket_send_messages_reliable (NiceSocket *sock,
static
gboolean
static
gboolean
socket_is_reliable
(
NiceSocket
*
sock
)
socket_is_reliable
(
NiceSocket
*
sock
)
{
{
TcpPassivePriv
*
priv
=
sock
->
priv
;
return
TRUE
;
return
priv
->
reliable
;
}
}
static
gboolean
static
gboolean
...
...
socket/tcp-passive.h
View file @
7cb326cf
...
@@ -43,8 +43,7 @@
...
@@ -43,8 +43,7 @@
G_BEGIN_DECLS
G_BEGIN_DECLS
NiceSocket
*
nice_tcp_passive_socket_new
(
GMainContext
*
ctx
,
NiceAddress
*
addr
,
NiceSocket
*
nice_tcp_passive_socket_new
(
GMainContext
*
ctx
,
NiceAddress
*
addr
);
gboolean
reliable
);
NiceSocket
*
nice_tcp_passive_socket_accept
(
NiceSocket
*
socket
);
NiceSocket
*
nice_tcp_passive_socket_accept
(
NiceSocket
*
socket
);
...
...
tests/test-icetcp.c
View file @
7cb326cf
...
@@ -404,9 +404,9 @@ int main (void)
...
@@ -404,9 +404,9 @@ int main (void)
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
global_mainloop
=
g_main_loop_new
(
NULL
,
FALSE
);
/* step: create the agents L and R */
/* step: create the agents L and R */
lagent
=
nice_agent_new
_reliable
(
g_main_loop_get_context
(
global_mainloop
),
lagent
=
nice_agent_new
(
g_main_loop_get_context
(
global_mainloop
),
NICE_COMPATIBILITY_RFC5245
);
NICE_COMPATIBILITY_RFC5245
);
ragent
=
nice_agent_new
_reliable
(
g_main_loop_get_context
(
global_mainloop
),
ragent
=
nice_agent_new
(
g_main_loop_get_context
(
global_mainloop
),
NICE_COMPATIBILITY_RFC5245
);
NICE_COMPATIBILITY_RFC5245
);
g_object_set
(
G_OBJECT
(
lagent
),
"ice-udp"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
lagent
),
"ice-udp"
,
FALSE
,
NULL
);
...
...
tests/test-tcp.c
View file @
7cb326cf
...
@@ -102,7 +102,7 @@ main (void)
...
@@ -102,7 +102,7 @@ main (void)
nice_address_init
(
&
tmp
);
nice_address_init
(
&
tmp
);
passive_sock
=
nice_tcp_passive_socket_new
(
g_main_loop_get_context
(
mainloop
),
passive_sock
=
nice_tcp_passive_socket_new
(
g_main_loop_get_context
(
mainloop
),
&
passive_bind_addr
,
TRUE
);
&
passive_bind_addr
);
g_assert
(
passive_sock
);
g_assert
(
passive_sock
);
srv_listen_source
=
g_socket_create_source
(
passive_sock
->
fileno
,
srv_listen_source
=
g_socket_create_source
(
passive_sock
->
fileno
,
...
@@ -112,7 +112,7 @@ main (void)
...
@@ -112,7 +112,7 @@ main (void)
g_source_attach
(
srv_listen_source
,
g_main_loop_get_context
(
mainloop
));
g_source_attach
(
srv_listen_source
,
g_main_loop_get_context
(
mainloop
));
active_sock
=
nice_tcp_active_socket_new
(
g_main_loop_get_context
(
mainloop
),
active_sock
=
nice_tcp_active_socket_new
(
g_main_loop_get_context
(
mainloop
),
&
active_bind_addr
,
TRUE
);
&
active_bind_addr
);
g_assert
(
active_sock
);
g_assert
(
active_sock
);
client
=
nice_tcp_active_socket_connect
(
active_sock
,
&
passive_bind_addr
);
client
=
nice_tcp_active_socket_connect
(
active_sock
,
&
passive_bind_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