Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
a7e7c68b
Commit
a7e7c68b
authored
Jun 03, 2015
by
Stephan Holljes
Committed by
Nicolas George
Jun 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/http: Properly process HTTP header on listen.
Signed-off-by:
Stephan Holljes
<
klaxa1337@googlemail.com
>
parent
8cfaa76a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletion
+40
-1
http.c
libavformat/http.c
+40
-1
No files found.
libavformat/http.c
View file @
a7e7c68b
...
@@ -563,7 +563,7 @@ static int process_line(URLContext *h, char *line, int line_count,
...
@@ -563,7 +563,7 @@ static int process_line(URLContext *h, char *line, int line_count,
int
*
new_location
)
int
*
new_location
)
{
{
HTTPContext
*
s
=
h
->
priv_data
;
HTTPContext
*
s
=
h
->
priv_data
;
char
*
tag
,
*
p
,
*
end
;
char
*
tag
,
*
p
,
*
end
,
*
method
,
*
resource
,
*
version
;
int
ret
;
int
ret
;
/* end of header */
/* end of header */
...
@@ -574,6 +574,44 @@ static int process_line(URLContext *h, char *line, int line_count,
...
@@ -574,6 +574,44 @@ static int process_line(URLContext *h, char *line, int line_count,
p
=
line
;
p
=
line
;
if
(
line_count
==
0
)
{
if
(
line_count
==
0
)
{
if
(
s
->
listen
)
{
// HTTP method
method
=
p
;
while
(
!
av_isspace
(
*
p
))
p
++
;
*
(
p
++
)
=
'\0'
;
av_log
(
h
,
AV_LOG_TRACE
,
"Received method: %s
\n
"
,
method
);
if
(
s
->
method
)
{
if
(
av_strcasecmp
(
s
->
method
,
method
))
{
av_log
(
h
,
AV_LOG_ERROR
,
"Received and expected HTTP method do not match. (%s expected, %s received)
\n
"
,
s
->
method
,
method
);
return
ff_http_averror
(
400
,
AVERROR
(
EIO
));
}
}
// HTTP resource
while
(
av_isspace
(
*
p
))
p
++
;
resource
=
p
;
while
(
!
av_isspace
(
*
p
))
p
++
;
*
(
p
++
)
=
'\0'
;
av_log
(
h
,
AV_LOG_TRACE
,
"Requested resource: %s
\n
"
,
resource
);
// HTTP version
while
(
av_isspace
(
*
p
))
p
++
;
version
=
p
;
while
(
!
av_isspace
(
*
p
))
p
++
;
*
p
=
'\0'
;
if
(
av_strncasecmp
(
version
,
"HTTP/"
,
5
))
{
av_log
(
h
,
AV_LOG_ERROR
,
"Malformed HTTP version string.
\n
"
);
return
ff_http_averror
(
400
,
AVERROR
(
EIO
));
}
av_log
(
h
,
AV_LOG_TRACE
,
"HTTP version string: %s
\n
"
,
version
);
}
else
{
/* TODO: reindent */
while
(
!
av_isspace
(
*
p
)
&&
*
p
!=
'\0'
)
while
(
!
av_isspace
(
*
p
)
&&
*
p
!=
'\0'
)
p
++
;
p
++
;
while
(
av_isspace
(
*
p
))
while
(
av_isspace
(
*
p
))
...
@@ -584,6 +622,7 @@ static int process_line(URLContext *h, char *line, int line_count,
...
@@ -584,6 +622,7 @@ static int process_line(URLContext *h, char *line, int line_count,
if
((
ret
=
check_http_code
(
h
,
s
->
http_code
,
end
))
<
0
)
if
((
ret
=
check_http_code
(
h
,
s
->
http_code
,
end
))
<
0
)
return
ret
;
return
ret
;
}
}
else
{
}
else
{
while
(
*
p
!=
'\0'
&&
*
p
!=
':'
)
while
(
*
p
!=
'\0'
&&
*
p
!=
':'
)
p
++
;
p
++
;
...
...
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