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
5bc8e4bc
Commit
5bc8e4bc
authored
Apr 15, 2014
by
Youness Alaoui
Committed by
Olivier Crête
May 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RFC4571 n_buffers when reading and frame outgoing STUN messages
parent
58943610
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
agent/agent.c
agent/agent.c
+10
-4
No files found.
agent/agent.c
View file @
5bc8e4bc
...
@@ -2545,8 +2545,9 @@ static gboolean priv_add_remote_candidate (
...
@@ -2545,8 +2545,9 @@ static gboolean priv_add_remote_candidate (
gchar
tmpbuf
[
INET6_ADDRSTRLEN
]
=
{
0
};
gchar
tmpbuf
[
INET6_ADDRSTRLEN
]
=
{
0
};
if
(
addr
)
if
(
addr
)
nice_address_to_string
(
addr
,
tmpbuf
);
nice_address_to_string
(
addr
,
tmpbuf
);
nice_debug
(
"Agent %p : Adding remote candidate with addr [%s]:%u"
nice_debug
(
"Agent %p : Adding %s remote candidate with addr [%s]:%u"
" for s%d/c%d. U/P '%s'/'%s' prio: %u"
,
agent
,
tmpbuf
,
" for s%d/c%d. U/P '%s'/'%s' prio: %u"
,
agent
,
_transport_to_string
(
transport
),
tmpbuf
,
addr
?
nice_address_get_port
(
addr
)
:
0
,
stream_id
,
component_id
,
addr
?
nice_address_get_port
(
addr
)
:
0
,
stream_id
,
component_id
,
username
,
password
,
priority
);
username
,
password
,
priority
);
}
}
...
@@ -3750,7 +3751,7 @@ nice_agent_send_messages_nonblocking_internal (
...
@@ -3750,7 +3751,7 @@ nice_agent_send_messages_nonblocking_internal (
((
guint8
*
)
message
->
buffers
[
j
].
buffer
)
+
offset_in_buffer
;
((
guint8
*
)
message
->
buffers
[
j
].
buffer
)
+
offset_in_buffer
;
local_bufs
[
local_message
.
n_buffers
].
size
=
local_bufs
[
local_message
.
n_buffers
].
size
=
MIN
(
message
->
buffers
[
j
].
size
,
packet_len
);
MIN
(
message
->
buffers
[
j
].
size
,
packet_len
);
packet_len
-=
local_bufs
[
local_message
.
n_buffers
++
].
size
;
packet_len
-=
local_bufs
[
local_message
.
n_buffers
].
size
;
offset
+=
local_bufs
[
local_message
.
n_buffers
++
].
size
;
offset
+=
local_bufs
[
local_message
.
n_buffers
++
].
size
;
offset_in_buffer
=
0
;
offset_in_buffer
=
0
;
}
}
...
@@ -5176,7 +5177,12 @@ agent_socket_send (NiceSocket *sock, const NiceAddress *addr, gsize len,
...
@@ -5176,7 +5177,12 @@ agent_socket_send (NiceSocket *sock, const NiceAddress *addr, gsize len,
const
gchar
*
buf
)
const
gchar
*
buf
)
{
{
if
(
nice_socket_is_reliable
(
sock
))
{
if
(
nice_socket_is_reliable
(
sock
))
{
return
nice_socket_send_reliable
(
sock
,
addr
,
len
,
buf
);
guint16
rfc4571_frame
=
htons
(
len
);
GOutputVector
local_buf
[
2
]
=
{{
&
rfc4571_frame
,
2
},
{
buf
,
len
}};
NiceOutputMessage
local_message
=
{
local_buf
,
2
};
/* ICE-TCP requires that all packets be framed with RFC4571 */
return
nice_socket_send_messages_reliable
(
sock
,
addr
,
&
local_message
,
1
);
}
else
{
}
else
{
gssize
ret
=
nice_socket_send_reliable
(
sock
,
addr
,
len
,
buf
);
gssize
ret
=
nice_socket_send_reliable
(
sock
,
addr
,
len
,
buf
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
...
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