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
cd9d6399
Commit
cd9d6399
authored
Oct 09, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: Support passing old-style tcp options
Make tcp and tls urls near-interchangeable.
parent
3df8d52f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
tls.c
libavformat/tls.c
+12
-1
No files found.
libavformat/tls.c
View file @
cd9d6399
...
@@ -142,6 +142,7 @@ static int tls_open(URLContext *h, const char *uri, int flags)
...
@@ -142,6 +142,7 @@ static int tls_open(URLContext *h, const char *uri, int flags)
TLSContext
*
c
=
h
->
priv_data
;
TLSContext
*
c
=
h
->
priv_data
;
int
ret
;
int
ret
;
int
port
;
int
port
;
const
char
*
p
;
char
buf
[
200
],
host
[
200
],
opts
[
50
]
=
""
;
char
buf
[
200
],
host
[
200
],
opts
[
50
]
=
""
;
int
numerichost
=
0
;
int
numerichost
=
0
;
struct
addrinfo
hints
=
{
0
},
*
ai
=
NULL
;
struct
addrinfo
hints
=
{
0
},
*
ai
=
NULL
;
...
@@ -154,7 +155,17 @@ static int tls_open(URLContext *h, const char *uri, int flags)
...
@@ -154,7 +155,17 @@ static int tls_open(URLContext *h, const char *uri, int flags)
snprintf
(
opts
,
sizeof
(
opts
),
"?listen=1"
);
snprintf
(
opts
,
sizeof
(
opts
),
"?listen=1"
);
av_url_split
(
NULL
,
0
,
NULL
,
0
,
host
,
sizeof
(
host
),
&
port
,
NULL
,
0
,
uri
);
av_url_split
(
NULL
,
0
,
NULL
,
0
,
host
,
sizeof
(
host
),
&
port
,
NULL
,
0
,
uri
);
ff_url_join
(
buf
,
sizeof
(
buf
),
"tcp"
,
NULL
,
host
,
port
,
"%s"
,
opts
);
p
=
strchr
(
uri
,
'?'
);
if
(
!
p
)
{
p
=
opts
;
}
else
{
if
(
av_find_info_tag
(
opts
,
sizeof
(
opts
),
"listen"
,
p
))
c
->
listen
=
1
;
}
ff_url_join
(
buf
,
sizeof
(
buf
),
"tcp"
,
NULL
,
host
,
port
,
"%s"
,
p
);
hints
.
ai_flags
=
AI_NUMERICHOST
;
hints
.
ai_flags
=
AI_NUMERICHOST
;
if
(
!
getaddrinfo
(
host
,
NULL
,
&
hints
,
&
ai
))
{
if
(
!
getaddrinfo
(
host
,
NULL
,
&
hints
,
&
ai
))
{
...
...
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