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
58e66d50
Commit
58e66d50
authored
Dec 16, 2010
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some minor changes, code cleaning
parent
a606b24f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
socket/turn.c
socket/turn.c
+8
-12
stun/tests/test-turn.c
stun/tests/test-turn.c
+1
-1
stun/usages/turn.c
stun/usages/turn.c
+0
-1
No files found.
socket/turn.c
View file @
58e66d50
...
...
@@ -384,7 +384,7 @@ priv_remove_peer_from_list (GList *list, const NiceAddress *peer)
NiceAddress
*
address
=
(
NiceAddress
*
)
iter
->
data
;
if
(
nice_address_equal
(
address
,
peer
))
{
nice_address_free
(
(
NiceAddress
*
)
iter
->
data
);
nice_address_free
(
address
);
list
=
g_list_delete_link
(
list
,
iter
);
}
}
...
...
@@ -502,8 +502,7 @@ socket_send (NiceSocket *sock, const NiceAddress *to,
goto
send
;
if
(
stun_message_append32
(
&
msg
,
STUN_ATTRIBUTE_MAGIC_COOKIE
,
TURN_MAGIC_COOKIE
)
!=
STUN_MESSAGE_RETURN_SUCCESS
)
TURN_MAGIC_COOKIE
)
!=
STUN_MESSAGE_RETURN_SUCCESS
)
goto
send
;
if
(
priv
->
username
!=
NULL
&&
priv
->
username_len
>
0
)
{
if
(
stun_message_append_bytes
(
&
msg
,
STUN_ATTRIBUTE_USERNAME
,
...
...
@@ -512,8 +511,8 @@ socket_send (NiceSocket *sock, const NiceAddress *to,
goto
send
;
}
if
(
stun_message_append_addr
(
&
msg
,
STUN_ATTRIBUTE_DESTINATION_ADDRESS
,
(
struct
sockaddr
*
)
&
sa
,
sizeof
(
sa
))
!=
STUN_MESSAGE_RETURN_SUCCESS
)
(
struct
sockaddr
*
)
&
sa
,
sizeof
(
sa
))
!=
STUN_MESSAGE_RETURN_SUCCESS
)
goto
send
;
if
(
priv
->
compatibility
==
NICE_TURN_SOCKET_COMPATIBILITY_GOOGLE
&&
...
...
@@ -545,9 +544,7 @@ socket_send (NiceSocket *sock, const NiceAddress *to,
req
->
priv
=
priv
;
stun_message_id
(
&
msg
,
req
->
id
);
req
->
source
=
agent_timeout_add_with_context
(
priv
->
nice
,
STUN_END_TIMEOUT
,
priv_forget_send_request
,
req
);
STUN_END_TIMEOUT
,
priv_forget_send_request
,
req
);
g_queue_push_tail
(
priv
->
send_requests
,
req
);
}
}
...
...
@@ -666,8 +663,7 @@ nice_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
if
(
nice_address_equal
(
&
priv
->
server_addr
,
recv_from
))
{
valid
=
stun_agent_validate
(
&
priv
->
agent
,
&
msg
,
(
uint8_t
*
)
recv_buf
,
(
size_t
)
recv_len
,
NULL
,
NULL
);
(
uint8_t
*
)
recv_buf
,
(
size_t
)
recv_len
,
NULL
,
NULL
);
if
(
valid
==
STUN_VALIDATION_SUCCESS
)
{
if
(
priv
->
compatibility
!=
NICE_TURN_SOCKET_COMPATIBILITY_DRAFT9
&&
...
...
@@ -781,7 +777,7 @@ nice_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
&
priv
->
current_binding
->
peer
);
}
else
{
/* look up binding associated with peer */
GList
*
i
=
priv
->
channels
;
GList
*
i
;
ChannelBinding
*
binding
=
NULL
;
struct
sockaddr
sa
;
socklen_t
sa_len
=
sizeof
(
sa
);
...
...
@@ -793,7 +789,7 @@ nice_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
&
sa_len
);
nice_address_set_from_sockaddr
(
&
to
,
&
sa
);
for
(;
i
;
i
=
i
->
next
)
{
for
(
i
=
priv
->
channels
;
i
;
i
=
i
->
next
)
{
ChannelBinding
*
b
=
i
->
data
;
if
(
nice_address_equal
(
&
b
->
peer
,
&
to
))
{
binding
=
b
;
...
...
stun/tests/test-turn.c
View file @
58e66d50
...
...
@@ -238,7 +238,7 @@ static void test_turn (char *username, char *password, char *hostname, int port)
static
void
turnserver
(
void
)
{
test_turn
(
"toto"
,
"password"
,
"127.0.0.1"
,
"3478"
);
test_turn
(
"toto"
,
"password"
,
"127.0.0.1"
,
"3478"
);
}
static
void
numb
(
void
)
...
...
stun/usages/turn.c
View file @
58e66d50
...
...
@@ -256,7 +256,6 @@ size_t stun_usage_turn_create_permission (StunAgent *agent, StunMessage *msg,
return
0
;
}
stun_debug
(
"before stun_agent_finish_message
\n
"
);
return
stun_agent_finish_message
(
agent
,
msg
,
password
,
password_len
);
}
...
...
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