Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
9e4693a1
Commit
9e4693a1
authored
Jan 10, 2022
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/network: log ff_listen() errors to proper contexts rather than NULL
parent
d2519e86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
network.c
libavformat/network.c
+3
-3
network.h
libavformat/network.h
+2
-1
tcp.c
libavformat/tcp.c
+1
-1
No files found.
libavformat/network.c
View file @
9e4693a1
...
...
@@ -208,12 +208,12 @@ int ff_socket(int af, int type, int proto, void *logctx)
}
int
ff_listen
(
int
fd
,
const
struct
sockaddr
*
addr
,
socklen_t
addrlen
)
socklen_t
addrlen
,
void
*
logctx
)
{
int
ret
;
int
reuse
=
1
;
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
reuse
,
sizeof
(
reuse
)))
{
av_log
(
NULL
,
AV_LOG_WARNING
,
"setsockopt(SO_REUSEADDR) failed
\n
"
);
av_log
(
logctx
,
AV_LOG_WARNING
,
"setsockopt(SO_REUSEADDR) failed
\n
"
);
}
ret
=
bind
(
fd
,
addr
,
addrlen
);
if
(
ret
)
...
...
@@ -247,7 +247,7 @@ int ff_listen_bind(int fd, const struct sockaddr *addr,
socklen_t
addrlen
,
int
timeout
,
URLContext
*
h
)
{
int
ret
;
if
((
ret
=
ff_listen
(
fd
,
addr
,
addrlen
))
<
0
)
if
((
ret
=
ff_listen
(
fd
,
addr
,
addrlen
,
h
))
<
0
)
return
ret
;
if
((
ret
=
ff_accept
(
fd
,
timeout
,
h
))
<
0
)
return
ret
;
...
...
libavformat/network.h
View file @
9e4693a1
...
...
@@ -271,7 +271,8 @@ int ff_listen_bind(int fd, const struct sockaddr *addr,
* @param addrlen Third argument of bind().
* @return 0 on success or an AVERROR on failure.
*/
int
ff_listen
(
int
fd
,
const
struct
sockaddr
*
addr
,
socklen_t
addrlen
);
int
ff_listen
(
int
fd
,
const
struct
sockaddr
*
addr
,
socklen_t
addrlen
,
void
*
logctx
);
/**
* Poll for a single connection on the passed file descriptor.
...
...
libavformat/tcp.c
View file @
9e4693a1
...
...
@@ -188,7 +188,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
if
(
s
->
listen
==
2
)
{
// multi-client
if
((
ret
=
ff_listen
(
fd
,
cur_ai
->
ai_addr
,
cur_ai
->
ai_addrlen
))
<
0
)
if
((
ret
=
ff_listen
(
fd
,
cur_ai
->
ai_addr
,
cur_ai
->
ai_addrlen
,
h
))
<
0
)
goto
fail1
;
}
else
if
(
s
->
listen
==
1
)
{
// single client
...
...
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