Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
8c76bfac
Commit
8c76bfac
authored
Aug 10, 2018
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp: Use ff_connect_parallel for RFC 8305 style connecting
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
9b4c3f5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
26 deletions
+15
-26
tcp.c
libavformat/tcp.c
+15
-26
No files found.
libavformat/tcp.c
View file @
8c76bfac
...
...
@@ -108,30 +108,28 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
cur_ai
=
ai
;
restart:
fd
=
ff_socket
(
cur_ai
->
ai_family
,
cur_ai
->
ai_socktype
,
cur_ai
->
ai_protocol
);
if
(
fd
<
0
)
{
ret
=
ff_neterrno
();
goto
fail
;
}
if
(
s
->
listen
)
{
while
(
cur_ai
&&
fd
<
0
)
{
fd
=
ff_socket
(
cur_ai
->
ai_family
,
cur_ai
->
ai_socktype
,
cur_ai
->
ai_protocol
);
if
(
fd
<
0
)
{
ret
=
ff_neterrno
();
cur_ai
=
cur_ai
->
ai_next
;
}
}
if
(
fd
<
0
)
goto
fail1
;
if
((
ret
=
ff_listen_bind
(
fd
,
cur_ai
->
ai_addr
,
cur_ai
->
ai_addrlen
,
s
->
listen_timeout
,
h
))
<
0
)
{
goto
fail1
;
}
fd
=
ret
;
}
else
{
if
((
ret
=
ff_listen_connect
(
fd
,
cur_ai
->
ai_addr
,
cur_ai
->
ai_addrlen
,
s
->
timeout
,
h
,
!!
cur_ai
->
ai_next
))
<
0
)
{
if
(
ret
==
AVERROR_EXIT
)
goto
fail1
;
else
goto
fail
;
}
ret
=
ff_connect_parallel
(
ai
,
s
->
timeout
,
3
,
h
,
&
fd
,
NULL
,
NULL
);
if
(
ret
<
0
)
goto
fail1
;
}
h
->
is_streamed
=
1
;
...
...
@@ -139,15 +137,6 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
freeaddrinfo
(
ai
);
return
0
;
fail:
if
(
cur_ai
->
ai_next
)
{
/* Retry with the next sockaddr */
cur_ai
=
cur_ai
->
ai_next
;
if
(
fd
>=
0
)
closesocket
(
fd
);
ret
=
0
;
goto
restart
;
}
fail1:
if
(
fd
>=
0
)
closesocket
(
fd
);
...
...
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