summaryrefslogtreecommitdiff
path: root/libavformat/http.c
Commit message (Collapse)AuthorAge
* http: restructure http_connect error handling pathwm42014-03-23
| | | | | | | | The authstr memory allocations make it annoying to error in the middle of the header setup code, so apply the usual C error handling idiom to make it easier to error at any point. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* http: never send 'Cookie: (null)' to the serverwm42014-03-21
| | | | | | | | | | | | | If a domain has some cookies set, but matching the cookie fails due to the port being different, get_cookies() succeeds, but sets cookies to NULL. The caller of get_cookies() didn't check for the NULL value. This also avoids passing NULL to libc string functions, which is undefined behavior Fixes Ticket2180 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-03-12
|\ | | | | | | | | | | | | * qatar/master: http: Properly initialize icy headers string Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Properly initialize icy headers stringAlessandro Ghedini2014-03-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The icy_metadata_headers string never gets initialized, so, during the first call to av_strlcatf() in parse_icy(), strlen() will be called on a pointer to uninitialized memory. At best this causes some garbage data to be left at the start of the string. By initializing icy_metadata_headers to the empty string, the first call to strlen() will always return 0, so that data is appended from the start of the string. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'e77a2ea9505863e50bf013706f66bf8b7325e524'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | * commit 'e77a2ea9505863e50bf013706f66bf8b7325e524': http: Declare more parameters as const where possible Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Declare more parameters as const where possibleMartin Storsjö2014-03-12
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | | | * qatar/master: http: Allow setting a Content-Type for POST requests Conflicts: libavformat/http.c See: c01d1d4ddf4d8240427341af1c077f6455243576 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Allow setting a Content-Type for POST requestsClément Bœsch2014-03-11
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * http: Improve options descriptionsAlessandro Ghedini2014-03-11
| | | | | | | | | | | | Add documentation where missing. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'ab76d9f628ad46e1d3bbf26c5bf1f87083f239ab'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | | | * commit 'ab76d9f628ad46e1d3bbf26c5bf1f87083f239ab': http: Always allow no-op seek Conflicts: libavformat/http.c See: 857841c1b63bf3ffacef03da2bd6275d55ead769 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Always allow no-op seekAnssi Hannula2014-03-11
| | | | | | | | | | | | This also allows checking stream position as per ffurl_seek() doxy. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '2ec33d27127251bbc45e1f88e60691ad59cf2319'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '2ec33d27127251bbc45e1f88e60691ad59cf2319': http: Add support for selecting a request range Conflicts: doc/protocols.texi libavformat/http.c See: d52882faef368264f9fe5a595274ec84d3446132 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Add support for selecting a request rangeAnssi Hannula2014-03-11
| | | | | | | | | | | | Comment from Reimar Döffinger included as pro memoria. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'ddfc98906373d1f17f6205cedd14c68d7a75995f'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'ddfc98906373d1f17f6205cedd14c68d7a75995f': http: Support setting custom User-Agent Conflicts: doc/protocols.texi libavformat/http.c See: 2bb1c713cc7e8fd018a3a0b579145a31a1c47bce Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Support setting custom User-AgentClément Bœsch2014-03-11
| | | | | | | | | | | | | | Contextually make the default User-Agent use the common "Name/Version" pattern. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'e58c85b0686892960042232e51c77168b264838a'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e58c85b0686892960042232e51c77168b264838a': http: Export Content-Type information Conflicts: doc/protocols.texi libavformat/http.c See: 76d851b65619e5a0fe4cc5248a6858287fe890b4 See: 20899c54f03c413b225e8839a3c5318ab47abe55 See: 255ec768da6f6e821775888621da2156764598da Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Export Content-Type informationMichael Niedermayer2014-03-11
| | | | | | | | | | | | Bug-Id: https://bugs.debian.org/740421 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '8075c3d8bb1f6aade0cc7c5c40db9bc1bcd84cab'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '8075c3d8bb1f6aade0cc7c5c40db9bc1bcd84cab': http: Add support reading ICY metadata Conflicts: doc/protocols.texi libavformat/http.c See: a92fbe16f2dc118c0d3adc222484268831388648 See: 636273d3d4a8c42f51832e8bf83e566e875916bf Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Add support reading ICY metadataLuca Barbato2014-03-11
| | | | | | | | | | | | | | | | | | Export the metadata as a icy_metadata_packet avoption. Based on the work of wm4 and Alessandro Ghedini. Bug-Id: https://bugs.debian.org/739936 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '4ff99ab3d7d5576e99e6b8a411b4a44500ed88fa'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | * commit '4ff99ab3d7d5576e99e6b8a411b4a44500ed88fa': http: Refactor process_line Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Refactor process_lineLuca Barbato2014-03-11
| |
* | Merge commit '7a2fddb4480121712df560cf619c1c3566cae3ff'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | * commit '7a2fddb4480121712df560cf619c1c3566cae3ff': http: K&R formatting cosmetics Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: K&R formatting cosmeticsLuca Barbato2014-03-11
| |
* | Merge commit '78b21c1d7177e1d61ad3c9225f67699da089aa7c'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | | | | | | | * commit '78b21c1d7177e1d61ad3c9225f67699da089aa7c': http: Drop doxy comments Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Drop doxy commentsLuca Barbato2014-03-11
| |
* | Merge commit '55a215ba63d9fa79cd7ee265ee2e777ee86b200c'Michael Niedermayer2014-03-12
|\| | | | | | | | | | | | | * commit '55a215ba63d9fa79cd7ee265ee2e777ee86b200c': http: Return meaningful error codes Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Return meaningful error codesLuca Barbato2014-03-11
| |
* | Merge remote-tracking branch 'lukaszmluki/master'Michael Niedermayer2014-03-06
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * lukaszmluki/master: lavd/avdevice: always free detected devices on error lavf/http: return error from seek on invalid whence lavf/http: return error on seeking to negative postion lavf/avio: fix ffurl_alloc error checks Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * | lavf/http: return error from seek on invalid whenceLukasz Marek2014-03-06
| | | | | | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
| * | lavf/http: return error on seeking to negative postionLukasz Marek2014-03-06
| | | | | | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* | | http: handle ICY in presence of chunked transfer encodingwm42014-03-05
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some http servers send an ICY stream in combination with chunked transfer encoding. This case was handled incorrectly by the ICY code: instead of handling chunked encoding before anything ICY related, both were mixed. Fix this by separating the ICY code from normal http reading. Move the normal http reading to a new function http_read_stream(), while http_read() handles ICY on top of http_read_stream(). The server identified itself as: cloudflare-nginx Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/http: Properly handle cookies that specify sub-domain where the URL.Eli Kara2014-01-23
| | | | | | | | | | | | Fixes ticket #3336 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/http: always allow no-op seekAnssi Hannula2014-01-03
| | | | | | | | | | | | This also allows checking stream position as per ffurl_seek() doxy. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* | avformat/http: allow the caller to select a request rangeAnssi Hannula2013-12-31
| | | | | | | | | | | | | | Add AVOptions for setting the initial offset and the ending offset, so they can be used for setting an appropriate Range header. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* | Merge commit 'be4edda6731a341d3fdeaa0e57753dc396790362'Michael Niedermayer2013-11-22
|\| | | | | | | | | | | | | | | | | | | | | * commit 'be4edda6731a341d3fdeaa0e57753dc396790362': http: Expose the content location via an AVOption Conflicts: libavformat/http.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Expose the content location via an AVOptionMartin Storsjö2013-11-22
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '393d80cc278e2b2f5c9e7805db176e6f28335a33'Michael Niedermayer2013-11-22
|\| | | | | | | | | | | | | | | | | | | | | * commit '393d80cc278e2b2f5c9e7805db176e6f28335a33': http: Support relative URL redirection Conflicts: libavformat/http.c See: 4a4c93cb3f2f564263f4b20446a7d500772e0d40 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Support relative URL redirectionZhang Rui2013-11-22
| | | | | | | | | | | | | | | | | | In RFC 2616, this was explicitly said to be an absolute URL, while in an upcoming draft [1] it is allowed to be relative as well. [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-25#section-7.1.2 Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '76267ecc82e3018e1913a2483d5fc47d0949cbd8'Michael Niedermayer2013-11-22
|\| | | | | | | | | | | | | * commit '76267ecc82e3018e1913a2483d5fc47d0949cbd8': http: Remove an unrelated and mistakenly set AVOption unit name Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Remove an unrelated and mistakenly set AVOption unit nameMartin Storsjö2013-11-22
| | | | | | | | | | | | This was due to a copypaste oversight. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/http: print http headers at AV_LOG_DEBUG levelMichael Niedermayer2013-11-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http: add hack to make streams served by MediaGateway not seekablewm42013-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These streams are reported as seekable, but all tests show they are not, and the server merely pretends the streams are seekable. The server responds with: content-range: bytes 0-1999999999/2000000000 Range requests seem to be correctly answered, but the actual data returned at the same offset is different. Assume this is a bug in the server software. The server identifies itself as: Server: MediaGateway 3.5.2-001 Add a hack that checks the server name, and disables seeking in this case. Test URL: http://8283.live.streamtheworld.com:80/CBC_R1_VCR_H_SC Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/http: fix cookiesMichael Niedermayer2013-10-31
| | | | | | | | | | | | Fixes Ticket3096 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/http: dont fail with unknown Content-EncodingsMichael Niedermayer2013-10-26
| | | | | | | | | | | | | | 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-15
|\| | | | | | | | | | | | | | | | | | | * 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-14
| | | | | | | | | | | | | | 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-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-14
|\| | | | | | | | | | | | | | | | | | | * 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-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-14
|\| | | | | | | | | | | | | | | | | | | | | * commit 'eb8b05a3824a9fa85e20d603595ac8a3b83505d4': http: Add an option for forcing basic authentication Conflicts: libavformat/http.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>