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
318ba4de
Commit
318ba4de
authored
Jul 16, 2019
by
Jakub Adam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udp-bsd: log source and destination addresses on GSocket send error
parent
c2ace8ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
socket/udp-bsd.c
socket/udp-bsd.c
+24
-4
No files found.
socket/udp-bsd.c
View file @
318ba4de
...
...
@@ -289,19 +289,39 @@ socket_send_message (NiceSocket *sock, const NiceAddress *to,
len
=
g_socket_send_message
(
sock
->
fileno
,
gaddr
,
message
->
buffers
,
message
->
n_buffers
,
NULL
,
0
,
G_SOCKET_MSG_NONE
,
NULL
,
&
child_error
);
g_clear_object
(
&
gaddr
);
if
(
len
<
0
)
{
if
(
g_error_matches
(
child_error
,
G_IO_ERROR
,
G_IO_ERROR_WOULD_BLOCK
))
{
len
=
0
;
}
else
{
nice_debug_verbose
(
"%s: udp-bsd socket %p: error: %s"
,
G_STRFUNC
,
sock
,
}
else
if
(
nice_debug_is_verbose
())
{
struct
sockaddr
sa
;
GSocketAddress
*
gsocket
;
NiceAddress
local_addr
;
NiceAddress
remote_addr
;
char
remote_addr_str
[
INET6_ADDRSTRLEN
];
char
local_addr_str
[
INET6_ADDRSTRLEN
];
g_socket_address_to_native
(
gaddr
,
&
sa
,
sizeof
(
sa
),
NULL
);
nice_address_set_from_sockaddr
(
&
remote_addr
,
&
sa
);
nice_address_to_string
(
&
remote_addr
,
remote_addr_str
);
gsocket
=
g_socket_get_local_address
(
sock
->
fileno
,
NULL
);
g_socket_address_to_native
(
gsocket
,
&
sa
,
sizeof
(
sa
),
NULL
);
nice_address_set_from_sockaddr
(
&
local_addr
,
&
sa
);
nice_address_to_string
(
&
local_addr
,
local_addr_str
);
g_object_unref
(
gsocket
);
nice_debug_verbose
(
"%s: udp-bsd socket %p %s:%u -> %s:%u: error: %s"
,
G_STRFUNC
,
sock
,
local_addr_str
,
nice_address_get_port
(
&
local_addr
),
remote_addr_str
,
nice_address_get_port
(
&
remote_addr
),
child_error
->
message
);
}
g_error_free
(
child_error
);
}
g_clear_object
(
&
gaddr
);
return
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