Ronald S. Bultje
845bb40178
http: move chunk handling from http_read_stream() to http_buf_read().
8 years ago
Ronald S. Bultje
2a05c8f813
http: make length/offset-related variables unsigned.
...
Fixes #5992 , reported and found by Paul Cher <paulcher@icloud.com>.
8 years ago
Michael Niedermayer
a880923170
avformat/http: Fix #ifdef FF_API_HTTP_USER_AGENT
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Steven Liu
27714b462d
lavf/http: deprecate user-agent option
8 years ago
Moritz Barsnick
d14993478c
libavformat/http: add support for content_type option in listen mode
...
Instead of silently ignoring the content_type option in listen mode,
apply its value to the provided "Content-Type:" header.
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Moritz Barsnick
e8b355a028
libavformat/http: add support for headers option in listen mode
...
Instead of silently ignoring the headers option in listen mode, use
the provided headers.
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Yuri Zats
ebda8216dc
avformat/http: change seek_ret to int64
...
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Martin Storsjö
fab8156b2f
avio: Copy URLContext generic options into child URLContexts
...
Since all URLContexts have the same AVOptions, such AVOptions
will be applied on the outermost context only and removed from the
dict, while they probably make sense on all contexts.
This makes sure that rw_timeout gets propagated to the innermost
URLContext (to make sure it gets passed to the tcp protocol, when
opening a http connection for instance).
Alternatively, such matching options would be kept in the dict
and only removed after the ffurl_connect call.
Signed-off-by: Martin Storsjö <martin@martin.st>
9 years ago
Carl Eugen Hoyos
58fa694978
lavf/http: Add httpproxy to the default protocol whitelist.
9 years ago
Carl Eugen Hoyos
144ef773c7
Use correct msvc type specifiers for ptrdiff_t and size_t.
9 years ago
Derek Buitenhuis
93629735d7
avformat: Add a protocol blacklisting API
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
9 years ago
Anton Khirnov
8c0ceafb0f
urlprotocol: receive a list of protocols from the caller
...
This way, the decisions about which protocols are available for use in
any given situations can be delegated to the caller.
9 years ago
Anton Khirnov
2758cdedfb
lavf: reorganize URLProtocols
...
Instead of a linked list constructed at av_register_all(), store them
in a constant array of pointers.
Since no registration is necessary now, this removes some global state
from lavf. This will also allow the urlprotocol layer caller to limit
the available protocols in a simple and flexible way in the following
commits.
9 years ago
Schenk, Michael
93f4b41208
avformat/http: add crypto to default whitlist to get encrypted HLS working again
...
I think we missed the crypto in the default_whitelist in case of http. Otherwise encrypted HLS will fail with
[hls,applehttp @ 0x2af39c00] playlist[0] open_input [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts ], start_seq_no [1], cur_seq_no [14]
[hls,applehttp @ 0x2af39c00] open_input curseqno [14] startseqno [1]
[hls,applehttp @ 0x2af39c00] HLS request for url 'http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts ', offset 0, playlist 0
[NULL @ 0x2af3a200] KEY_AES_128 seg->key [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans.key ] pls->key_url [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans.key ]
[hls,applehttp @ 0x2af39c00] open_input [KEY_AES_128]
[hls,applehttp @ 0x2af39c00] : c->persistence [0]
[hls,applehttp @ 0x2af39c00] : c->probing [1]
[hls,applehttp @ 0x2af39c00] : pls->input [NULL]
[hls,applehttp @ 0x2af39c00] using normal http path for URL [crypto+http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts ]
[crypto @ 0x2aff7cc0] Protocol not on whitelist 'http,https,tls,rtp,tcp,udp!
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
fe3fed0b14
Update demuxers and protocols for protocol whitelist support
...
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Joel Holdsworth
b4eb1f29eb
avformat/http: Added http_proxy option
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Clément Bœsch
43ecec0f03
avformat: use AV_OPT_TYPE_BOOL in a bunch of places
9 years ago
Rodger Combs
362c17e656
lavf/http: fix incorrect warning in range requests
9 years ago
Michael Niedermayer
4d76e89c18
avformat/http: Initialize .str based default for AV_OPT_TYPE_STRING types
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
7277a4ace9
avformat/http: add reconnect_delay_max option
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
bdbab4a351
avformat/http: exponentially delay reconnection to avoid flooding the server
...
Reviewed-by: Zhang Rui <bbcallen@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
9bd68dea2b
avformat/http: Add reconnect_at_eof and reconnect_streamed options
...
They allow reconnecting endless live streams which fail with eof
Reviewed-by: Zhang Rui <bbcallen@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
63974bd494
avformat/http: print error that causes reconnection
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
7990beedee
avformat/http: require seekability only when seeking to position != 0
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Stephan Holljes
280d140cb0
lavf/http: Remove superfluous parenthesis.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Stephan Holljes
dd7b486e8e
lavf/http: Fix incorrectly placed parenthesis.
...
The assignment had incorrectly placed parentheses which resulted in ret
always being > 0.
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Stephan Holljes
4f860848ab
lavf/http: Fix parsing http request data to not read over '\0'.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
9 years ago
Stephan Holljes
3240e69de6
lavf/http: Implement server side network code.
...
add http_accept,
add http_handshake and move handshake logic there,
handle connection closing.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
10 years ago
Luca Barbato
5ae178539b
http: Add the trailing endlines if they are missing
...
Makes slightly easier the life of those want to use the option
from the command line
10 years ago
Stephan Holljes
de3a7ef204
lavf/http: Correctly terminate session with HTTP POST client.
...
Send a footer to correctly close client sockets.
This fixes network errors in client applications.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Stephan Holljes
44d1921200
lavf/http: Add simple autodetection for client HTTP method, based on AVIO_FLAG_READ.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
10 years ago
Stephan Holljes
290b237556
lavf/http: Indent else-clause.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
10 years ago
Stephan Holljes
a7e7c68b0e
lavf/http: Properly process HTTP header on listen.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
10 years ago
Stephan Holljes
8cfaa76a5e
lavf/http: Rudimentary error handling for HTTP requests received from clients.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
10 years ago
Stephan Holljes
bbcee92b6d
lavf/http: Process HTTP header before sending response.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
10 years ago
Stephan Holljes
aa74401af8
lavf/http: Document method option.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
10 years ago
Michael Niedermayer
a649f36f75
avformat/http: Mark lower_proto as const in http_listen()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Rodger Combs
71b69df622
lavf/http: support HTTPS when listening
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
22c0585a00
avformat/http: Fix 2 typos
...
Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
1a3eb042c7
Replace av_dlog with normal av_log at trace level
...
This applies to every library where performance is not critical.
10 years ago
Michael Niedermayer
3668701f96
avformat/http: Return an error in case of prematurely ending data
...
Fixes Ticket 4039
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Rodger Combs
a4d58c97d0
lavf/http: handle case where the server returns a redirect during a seek
...
txoffer (e.g. http://tori.aoi-chan.com/ ) redirects to the same URI on your
first request, and serves the actual file on the second. It's stupid, but AFAIK
technically compliant. We'd previously see the server not handing back a Range
header and return an error; now, instead, we see that there's a redirect and
keep track of the offset we want while trying again at the new URL.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Stephan Holljes
b51027fd18
libavformat/http.c: Make http-listen work as an input stream.
...
With this patch http can be used to listen for POST data to be used as an input stream.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Stephan Holljes
6d8c27f951
libavformat/http.c: Fix missing parenthesis in http_listen()
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Stephan Holljes
4a58d757de
lavf/http: add proof-of-concept http server.
...
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Reviewed-By: Nicolas George <george@nsup.org>
10 years ago
Himangi Saraogi
919d13d238
avformat/http: Fix null check on allocated value
...
probably fixes CID 1292299
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Micah Galizia
c59654d67d
avformat/http: replace cookies with updated values instead of appending forever
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Zhang Rui
3f375950f3
avformat/http: support auto reconnect
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
daf8cf358a
avformat: Don't anonymously typedef structs
10 years ago
Michael Niedermayer
bcd4447173
avformat/http: Use av_freep() avoid leaving stale pointers in memory
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago