Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
a3303add
Commit
a3303add
authored
16 years ago
by
Ronald S. Bultje
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetics after previous patches.
Originally committed as revision 14926 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
8b9af28d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/tcp.c
+3
-7
3 additions, 7 deletions
libavformat/tcp.c
with
3 additions
and
7 deletions
libavformat/tcp.c
+
3
−
7
View file @
a3303add
...
@@ -32,27 +32,23 @@ typedef struct TCPContext {
...
@@ -32,27 +32,23 @@ typedef struct TCPContext {
static
int
tcp_open
(
URLContext
*
h
,
const
char
*
uri
,
int
flags
)
static
int
tcp_open
(
URLContext
*
h
,
const
char
*
uri
,
int
flags
)
{
{
struct
sockaddr_in
dest_addr
;
struct
sockaddr_in
dest_addr
;
char
hostname
[
1024
],
*
q
;
int
port
,
fd
=
-
1
;
int
port
,
fd
=
-
1
;
TCPContext
*
s
=
NULL
;
TCPContext
*
s
=
NULL
;
fd_set
wfds
;
fd_set
wfds
;
int
fd_max
,
ret
;
int
fd_max
,
ret
;
struct
timeval
tv
;
struct
timeval
tv
;
socklen_t
optlen
;
socklen_t
optlen
;
char
proto
[
1024
],
path
[
1024
],
tmp
[
1024
];
char
hostname
[
1024
],
proto
[
1024
],
path
[
1024
],
tmp
[
1024
]
,
*
q
;
if
(
!
ff_network_init
())
if
(
!
ff_network_init
())
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
url_split
(
proto
,
sizeof
(
proto
),
NULL
,
0
,
hostname
,
sizeof
(
hostname
),
url_split
(
proto
,
sizeof
(
proto
),
NULL
,
0
,
hostname
,
sizeof
(
hostname
),
&
port
,
path
,
sizeof
(
path
),
uri
);
&
port
,
path
,
sizeof
(
path
),
uri
);
if
(
strcmp
(
proto
,
"tcp"
))
if
(
strcmp
(
proto
,
"tcp"
)
||
port
<=
0
||
port
>=
65536
)
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
if
((
q
=
strchr
(
hostname
,
'@'
)))
{
strcpy
(
tmp
,
q
+
1
);
strcpy
(
hostname
,
tmp
);
}
if
((
q
=
strchr
(
hostname
,
'@'
)))
{
strcpy
(
tmp
,
q
+
1
);
strcpy
(
hostname
,
tmp
);
}
if
(
port
<=
0
||
port
>=
65536
)
return
AVERROR
(
EINVAL
);
dest_addr
.
sin_family
=
AF_INET
;
dest_addr
.
sin_family
=
AF_INET
;
dest_addr
.
sin_port
=
htons
(
port
);
dest_addr
.
sin_port
=
htons
(
port
);
if
(
resolve_host
(
&
dest_addr
.
sin_addr
,
hostname
)
<
0
)
if
(
resolve_host
(
&
dest_addr
.
sin_addr
,
hostname
)
<
0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment