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
55a215ba
Commit
55a215ba
authored
Mar 10, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: Return meaningful error codes
parent
390acbea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
http.c
libavformat/http.c
+6
-6
No files found.
libavformat/http.c
View file @
55a215ba
...
...
@@ -264,7 +264,7 @@ static int http_getc(HTTPContext *s)
if
(
len
<
0
)
{
return
len
;
}
else
if
(
len
==
0
)
{
return
-
1
;
return
AVERROR_EOF
;
}
else
{
s
->
buf_ptr
=
s
->
buffer
;
s
->
buf_end
=
s
->
buffer
+
len
;
...
...
@@ -327,7 +327,7 @@ static int process_line(URLContext *h, char *line, int line_count,
end
+=
strspn
(
end
,
SPACE_CHARS
);
av_log
(
h
,
AV_LOG_WARNING
,
"HTTP error %d %s
\n
"
,
s
->
http_code
,
end
);
return
-
1
;
return
AVERROR
(
EIO
)
;
}
}
else
{
while
(
*
p
!=
'\0'
&&
*
p
!=
':'
)
...
...
@@ -732,13 +732,13 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
URLContext
*
old_hd
=
s
->
hd
;
int64_t
old_off
=
s
->
off
;
uint8_t
old_buf
[
BUFFER_SIZE
];
int
old_buf_size
;
int
old_buf_size
,
ret
;
AVDictionary
*
options
=
NULL
;
if
(
whence
==
AVSEEK_SIZE
)
return
s
->
filesize
;
else
if
((
s
->
filesize
==
-
1
&&
whence
==
SEEK_END
)
||
h
->
is_streamed
)
return
-
1
;
return
AVERROR
(
ENOSYS
)
;
/* we save the old context in case the seek fails */
old_buf_size
=
s
->
buf_end
-
s
->
buf_ptr
;
...
...
@@ -752,14 +752,14 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
/* if it fails, continue on old connection */
av_dict_copy
(
&
options
,
s
->
chained_options
,
0
);
if
(
http_open_cnx
(
h
,
&
options
)
<
0
)
{
if
(
(
ret
=
http_open_cnx
(
h
,
&
options
)
)
<
0
)
{
av_dict_free
(
&
options
);
memcpy
(
s
->
buffer
,
old_buf
,
old_buf_size
);
s
->
buf_ptr
=
s
->
buffer
;
s
->
buf_end
=
s
->
buffer
+
old_buf_size
;
s
->
hd
=
old_hd
;
s
->
off
=
old_off
;
return
-
1
;
return
ret
;
}
av_dict_free
(
&
options
);
ffurl_close
(
old_hd
);
...
...
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