aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/http.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/http: dont fail with unknown Content-EncodingsMichael Niedermayer2013-10-261-1/+0
| | | | | | | Fixes: http://m1.file.xiami.com/282/23282/343749/1769075752_709488_l.mp3 Based-on-patch-by: Crossle Song <sxm@yixia.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-151-1/+2
|\ | | | | | | | | | | | | | | | | | | * qatar/master: http: Check the auth string contents and not only the pointer Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Check the auth string contents and not only the pointerMichael Niedermayer2013-10-141-1/+2
| | | | | | | | | | | | | | This makes sure we don't send the Except: 100-continue header if no authentication credentials have been provided. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/http: check the auth string contents not the pointer which cannot ↵Michael Niedermayer2013-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | be NULL It appears this bug originates from a "work in progress" patch from ffmpeg-devel that was heavily redesigned by and integrated in libav And that patch even had a reply and review on the mailing list pointing out that it had a bug. This fixes a deadlock with ffserver See: [FFmpeg-devel] [PATCH] Fix HTTP authentication problem for POST actions. [FFmpeg-devel] [PATCH 1/3] Introduce auth_phase flag, which will be true if authorization needs to be sent, but the type of authorization is not known yet Partial fix #3036 [FFmpeg-devel] [PATCH 2/3] Only add Transfer-Encoding header when not in authorization phase, because server will wait (indefinitely) for data when receiving this header Partial fix #3036 [FFmpeg-devel] [PATCH 3/3] Only allow posting data and/or forcing a 200 code, enabling posting isml chunks, -after- we did a possible first request to get a 403 from the server telling us which type of authentication to apply Final part fix #3036 See: 71549a857b13edf4c4f95037de6ed5bb4c4bd4af Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '71549a857b13edf4c4f95037de6ed5bb4c4bd4af'Michael Niedermayer2013-10-141-1/+17
|\| | | | | | | | | | | | | | | | | | | * commit '71549a857b13edf4c4f95037de6ed5bb4c4bd4af': http: Support auth method detection for POST Conflicts: libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Support auth method detection for POSTMartin Storsjö2013-10-131-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by a patch by Jakob van Bethlehem. But instead of doing an empty POST first to trigger the WWW-Authenticate header (which would succeed if no auth actually was required), add an Expect: 100-continue header, which is meant to be used exactly for cases like this. The header is added if doing a post, and the user has specified authentication but we don't know the auth method yet. Not all common HTTP servers support the Expect: 100-continue header, though, so we only try to use it when it really is needed. The user can request it to be added for other POST requests as well via an option - which would allow the caller to know immediately that the POST has failed (e.g. if no auth was provided but the server required it, or if the target URL simply doesn't exist). This is only done for write mode posts (e.g. posts without pre-set post_data) - for posts with pre-set data, we can just redo the post if it failed due to 401. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'eb8b05a3824a9fa85e20d603595ac8a3b83505d4'Michael Niedermayer2013-10-141-0/+3
|\| | | | | | | | | | | | | | | | | | | | | * commit 'eb8b05a3824a9fa85e20d603595ac8a3b83505d4': http: Add an option for forcing basic authentication Conflicts: libavformat/http.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Add an option for forcing basic authenticationMartin Storsjö2013-10-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The default is to autodetect the auth method. This does require one extra request (and also closing and reopening the http connection). For some cases such as HTTP POST, the autodetection is not handled properly (yet). No option is added for digest, since this method requires getting nonce parameters from the server first and can't be used straight away like Basic. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '5c53bf7aaf03748464cbf978bffe7ffdb71112b1'Michael Niedermayer2013-09-271-25/+27
|\| | | | | | | | | | | | | | | | | | | | | * commit '5c53bf7aaf03748464cbf978bffe7ffdb71112b1': http: Pass options through to the nested protocol Conflicts: libavformat/http.c See: b6f435fbc87c024f8403fca69e6e6b98bccf93fa Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Pass options through to the nested protocolMartin Storsjö2013-09-261-8/+26
| | | | | | | | | | | | | | | | When passing a dict to the nested protocol, it will consume the used options from it, so a separate copy needs to be used when reopening the connection multiple times. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '0f51c398beac87682b2249662b97e30512f7868c'Michael Niedermayer2013-07-291-8/+17
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '0f51c398beac87682b2249662b97e30512f7868c': http: Support reading gzip/deflate compressed data utvideoenc: use av_image_copy_plane() Conflicts: libavformat/http.c See: b09d86c6366f2933d7bec430486d9d56bf98f7b6 See: 6bab3430a775183f2f9acbd91d1376c71e87c026 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Support reading gzip/deflate compressed dataZhang Rui2013-07-281-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Derived from VLC's http module. Original authors: Antoine Cellerier <dionoea@videolan.org> Sébastien Escudier <sebastien-devel@celeos.eu> Rémi Duraffort <ivoire@videolan.org> Rémi Denis-Courmont <remi@remlab.net> Francois Cartegnie <fcvlcdev@free.fr> Normally, http servers shouldn't send this to us since we don't advertise it with an Accept-Encoding header, but some servers still do it anyway. Signed-off-by: Martin Storsjö <martin@martin.st>
| * Use the avstring.h locale-independent character type functionsReimar Döffinger2013-03-071-3/+3
| | | | | | | | | | | | Make sure the behavior does not change with the locale. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/http: support reading compressed dataZhang Rui2013-07-241-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | Derived from VLC's http module. Original authors: Antoine Cellerier <dionoea@videolan.org> Sébastien Escudier <sebastien-devel@celeos.eu> Rémi Duraffort <ivoire@videolan.org> Rémi Denis-Courmont <remi@remlab.net> Francois Cartegnie <fcvlcdev@free.fr> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/http: support relative url redirectionZhang Rui2013-07-041-1/+3
| | | | | | | | | | | | see also http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-17#section-9.5 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/http: add support for reading streamcast metadatawm42013-07-021-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow applications to request reading streamcast metadata. This uses AVOptions as API, and requires the application to explicitly request and read metadata. Metadata can be updated mid-stream; if an application is interested in that, it has to poll for the data by reading the "icy_metadata_packet" option in regular intervals. There doesn't seem to be a nice way to transfer the metadata in a nicer way. Converting the metadata to ID3v2 tags might be a nice idea, but the libavformat mp3 demuxer doesn't seem to read these tags mid-stream, and even then we couldn't guarantee that tags are not inserted in the middle of mp3 packet data. This commit provides the minimum to enable applications to retrieve this information at all. Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
* | lavf/http: remove Mozilla/5.0 from user agent.Clément Bœsch2013-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | It is notably known to break playback on http streaming servers who use the user agent to guess if it's a browser (to display a summary) or a player (to stream the audio data). This reverts 1fabd95. Fixes Ticket #2663.
* | Accept incomplete http cookies without domain.Carl Eugen Hoyos2013-06-101-0/+2
| | | | | | | | | | | | | | Works around a bug in some servers that apparently send incomplete cookies. Fixes a part of ticket #2619. Reviewed-by: Micah Galizia
* | lavf/http: remove duplicated dec flag.Clément Bœsch2013-04-191-2/+1
| |
* | lavf/http: use a more compatible default user agent.Clément Bœsch2013-04-061-3/+3
| | | | | | | | Fixes Ticket 2265.
* | Remove incorrect use of ctype.h functions.Reimar Döffinger2013-03-031-3/+3
| | | | | | | | | | | | | | As far as I can tell the code should not change behaviour depending on locale in any of these places. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-02-281-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavf: Add a fate test for the noproxy pattern matching lavf: Handle the environment variable no_proxy more properly Conflicts: libavformat/Makefile libavformat/internal.h libavformat/tls.c libavformat/utils.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: Handle the environment variable no_proxy more properlyMartin Storsjö2013-02-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The handling of the environment variable no_proxy, present since one of the initial commits (de6d9b6404), is inconsistent with how many other applications and libraries interpret this variable. Its bare presence does not indicate that the use of proxies should be skipped, but it is some sort of pattern for hosts that does not need using a proxy (e.g. for a local network). As investigated by Rudolf Polzer, different libraries handle this in different ways, some supporting IP address masks, some supporting arbitrary globbing using *, some just checking that the pattern matches the end of the hostname without regard for whether it actually is the right domain or a domain that ends in the same string. This simple logic should be pretty similar to the logic used by lynx and curl. Signed-off-by: Martin Storsjö <martin@martin.st>
* | fix memory leak on string reassignMicah Galizia2013-01-211-0/+3
| | | | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Fixes CID968584 and CID968585
* | lavf/http: add HTTP protocol cookie supportMicah Galizia2013-01-151-0/+116
| | | | | | | | Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
* | lavf/http: fix/extend option descriptionsStefano Sabatini2013-01-121-5/+5
| | | | | | | | | | In particular, favor predicative form over nominal description of the set parameter. This is more globally consistent.
* | http: dont null check p, its unneededMichael Niedermayer2012-12-111-1/+1
| | | | | | | | | | Fixes CID747740 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http/utils: rename "demuxer" to mime_typeMichael Niedermayer2012-12-101-3/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http/utils: move mime -> demuxer maping from http to utilsMichael Niedermayer2012-12-091-4/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http: export ICY content typeMichael Niedermayer2012-12-091-0/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http: add -content_type user option.Clément Bœsch2012-10-241-0/+5
| |
* | Merge commit '6d0beefbf6ee6dbf8efb522a9307e54c6ed5f702'Michael Niedermayer2012-10-101-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6d0beefbf6ee6dbf8efb522a9307e54c6ed5f702': swscale: Do not make ff_ symbols globally visible. rtspdec: use av_strlcpy for writing into fixed size buffer g722enc: fix size argument in memset http: use av_strlcpy instead of strcpy() without size checks avfilter: correct memcpy size avfilter_copy_buf_props() lavc: split asv12 encoder/decoder Conflicts: libavcodec/asvdec.c libavfilter/buffer.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: use av_strlcpy instead of strcpy() without size checksJanne Grunau2012-10-091-1/+1
| | | | | | | | Fixes CID700730.
* | http: add 'timeout' AVOptionAndrey Utkin2012-10-091-2/+18
| | | | | | | | | | | | This option is passed though to underlying tcp protocol context Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http: prevent the Range header being sent when seekability probing isnt usedDuncan Salerno2012-10-051-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http: add option to prevent probing for HTTP seekabilityDuncan Salerno2012-10-051-4/+12
| | | | | | | | | | | | Add an tri-state (seek, non seek, automatic detection) option to HTTP to control seekability (default: automatic). Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-09-281-5/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: libopus: Remap channels using libopus' internal remapping. Opus decoder using libopus avcodec: document the use of AVCodecContext.delay for audio decoding vc1dec: add flush function for WMV9 and VC-1 decoders http: Increase buffer sizes to cope with longer URIs nutenc: const correctness for ff_put_v_trace/put_s_trace function arguments h264_refs: Fix debug tprintf argument types golomb: const correctness for get_ue()/get_se() function arguments get_bits: const correctness for get_bits_trace()/get_xbits_trace() arguments Conflicts: Changelog libavcodec/Makefile libavcodec/version.h libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Increase buffer sizes to cope with longer URIsDuncan Salerno2012-09-281-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the MAX_URL_SIZE define where applicable. Increase buffer sizes for all buffers that need to fit a long pathname - buffers that need to fit only the hostname (and other short strings, but not the pathname - such as "headers" in http_connect) are kept at 1024 bytes for now. Also increase the max line length in http_read_header, since it might need to contain a full url for Location: redirects. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Document why we always send a Range HTTP header.Reimar Döffinger2012-09-231-0/+3
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Revert "http: only send range header when necessary"Michael Niedermayer2012-09-231-1/+1
| | | | | | | | | | This reverts commit 48cf0f1c18f2f91363601c94177c71bc3ac13b8e. This can cause problems with seekability detection
* | http: only send range header when necessaryDuncan Salerno2012-09-231-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http: larger buffer for long URIsDuncan Salerno2012-09-231-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9'Michael Niedermayer2012-09-051-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9': avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member Conflicts: libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libx264.c libavcodec/mpeg12enc.c libavcodec/options_table.h libavcodec/snowenc.c libavcodec/tiffenc.c libavdevice/v4l2.c libavdevice/x11grab.c libavfilter/af_amix.c libavfilter/af_asyncts.c libavfilter/af_join.c libavfilter/buffersrc.c libavfilter/src_movie.c libavfilter/vf_delogo.c libavfilter/vf_drawtext.c libavformat/http.c libavformat/img2dec.c libavformat/img2enc.c libavformat/movenc.c libavformat/mpegenc.c libavformat/mpegtsenc.c libavformat/options_table.h libavformat/segment.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union memberMartin Storsjö2012-09-041-2/+2
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | http: try to detect live akamai streams and dont enable seeking for themMichael Niedermayer2012-06-281-1/+5
| | | | | | | | | | | | Fixes ticket1320 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-201-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: MS Screen 1 decoder aacdec: Fix popping channel layouts. av_gettime: support Win32 without gettimeofday() Use av_gettime() in various places Move av_gettime() to libavutil dct-test: use emms_c() from libavutil instead of duplicating it mov: fix operator precedence bug mathematics.h: remove a couple of math defines Remove unnecessary inclusions of [sys/]time.h lavf: remove unnecessary inclusions of unistd.h bfin: libswscale: add const where appropriate to fix warnings bfin: libswscale: remove unnecessary #includes udp: Properly check for invalid sockets tcp: Check the return value from getsockopt network: Use av_strerror for getting error messages udp: Properly print error from getnameinfo mmst: Use AVUNERROR() to convert error codes to the right range for strerror network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows rtmp: Reduce the number of idle posts sent by sleeping 50ms Conflicts: Changelog configure libavcodec/aacdec.c libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/dct-test.c libavcodec/version.h libavformat/riff.c libavformat/udp.c libavutil/Makefile libswscale/bfin/yuv2rgb_bfin.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: remove unnecessary inclusions of unistd.hMans Rullgard2012-06-201-1/+0
| | | | | | | | | | | | These files do not use anything provided by unistd.h. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-191-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (24 commits) flvdec: remove incomplete, disabled seeking code mem: add support for _aligned_malloc() as found on Windows lavc: Extend the documentation for avcodec_init_packet flvdec: remove incomplete, disabled seeking code http: replace atoll() with strtoll() mpegts: remove unused/incomplete/broken seeking code af_amix: allow float planar sample format as input af_amix: use AVFloatDSPContext.vector_fmac_scalar() float_dsp: add x86-optimized functions for vector_fmac_scalar() float_dsp: Move vector_fmac_scalar() from libavcodec to libavutil lavr: Add x86-optimized function for flt to s32 conversion lavr: Add x86-optimized function for flt to s16 conversion lavr: Add x86-optimized functions for s32 to flt conversion lavr: Add x86-optimized functions for s32 to s16 conversion lavr: Add x86-optimized functions for s16 to flt conversion lavr: Add x86-optimized function for s16 to s32 conversion rtpenc: Support packetizing iLBC rtpdec: Add a depacketizer for iLBC Implement the iLBC storage file format mov: Support muxing/demuxing iLBC ... Conflicts: Changelog configure libavcodec/avcodec.h libavcodec/dsputil.c libavcodec/version.h libavformat/movenc.c libavformat/mpegts.c libavformat/version.h libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: replace atoll() with strtoll()Ronald S. Bultje2012-06-191-3/+3
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-181-8/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavr: add x86-optimized functions for mixing 1-to-2 s16p with flt coeffs lavr: add x86-optimized functions for mixing 1-to-2 fltp with flt coeffs Add Dolby/DPLII downmix support to libavresample vorbisdec: replace div/mod in loop with a counter fate: vorbis: add 5.1 surround test rtpenc: Allow requesting H264 RTP packetization mode 0 configure: Sort the library listings in the help text alphabetically dwt: remove variable-length arrays RTMPT protocol support http: Properly handle chunked transfer-encoding for replies to post data http: Fail reading if the connection has gone away amr: Mark an array const amr: More space cleanup rtpenc: Fix memory leaks in the muxer open function Conflicts: Changelog configure doc/APIchanges libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>