aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/http.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * http: Stop reading after receiving the whole file for non-chunked transfersMartin Storsjö2014-08-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously this logic was only used if the server didn't respond with Connection: close, but use it even for that case, if the server response is non-chunked. Originally the http code has relied on Connection: close to close the socket when the file/stream is received - the http protocol code just kept reading from the socket until the socket was closed. In f240ed18 we added a check for the file size, because some http servers didn't respond with Connection: close (and wouldn't close the socket) even though we requested it, which meant that the http protocol blocked for a long time at the end of files, waiting for a socket level timeout. When reading over tls, trying to read at the end of the connection, when the peer has closed the connection, can produce spurious (but harmless) warnings. Therefore always voluntarily stop reading when the specified file size has been received, if not using a chunked transfer encoding. (For chunked transfers, we already return 0 as soon as we get the chunk header indicating end of stream.) Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '6a463e7fb4f028c52d2e2d054f9483f4fff492bc'Michael Niedermayer2014-08-041-13/+24
|\| | | | | | | | | | | | | | | * commit '6a463e7fb4f028c52d2e2d054f9483f4fff492bc': http: Refactor http_open_cnx See: c2a170ac0ddd53516d004cd2bf55ceaffa59642a Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Refactor http_open_cnxLuca Barbato2014-08-031-12/+24
| | | | | | | | | | | | | | | | | | Split return value handling from the actual opening. Incidentally fixes the https -> http redirect issue reported by Compn on behalf of rcombs. CC: libav-stable@libav.org
* | avformat/http: fix tls/tcp protocol after a 302 move in httpsRodger Combs2014-08-041-0/+1
| | | | | | | | | | | | Fixes ticket 3824 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'ce2e858f5b3416c2d54f7f8c14e901f75c48b785'Michael Niedermayer2014-07-241-109/+115
|\| | | | | | | | | | | | | | | | | | | * commit 'ce2e858f5b3416c2d54f7f8c14e901f75c48b785': http: K&R formatting cosmetics Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: K&R formatting cosmeticsDiego Biurrun2014-07-231-104/+110
| | | | | | | | Also comment some #endifs and reshuffle headers into canonical order.
* | Merge commit '7bdd2ff6825951f7a6a6008303acfce7c2a63532'Michael Niedermayer2014-07-221-1/+1
|\| | | | | | | | | | | | | | | | | | | * commit '7bdd2ff6825951f7a6a6008303acfce7c2a63532': http: Use a constant for the supported header size Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Use a constant for the supported header sizeLuca Barbato2014-07-221-1/+1
| |
* | Merge commit '389380c27915b0505fed538cd54c035c891fabd9'Michael Niedermayer2014-07-221-10/+12
|\| | | | | | | | | | | | | * commit '389380c27915b0505fed538cd54c035c891fabd9': http: Do move the class instantiation in the conditional block Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Do move the class instantiation in the conditional blockLuca Barbato2014-07-211-10/+12
| | | | | | | | Remove a warning if https support is disabled.
* | Merge commit '28df1d24112c6ad0763985df2faeeb198cfbad69'Michael Niedermayer2014-07-221-1/+7
|\| | | | | | | | | | | | | * commit '28df1d24112c6ad0763985df2faeeb198cfbad69': http: Provide an option to override the HTTP method Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Provide an option to override the HTTP methodLuca Barbato2014-07-211-1/+7
| | | | | | | | Certain servers accept only PUT as valid method.
* | avformat/http: remove never twice executable loopMichael Niedermayer2014-05-141-3/+0
| | | | | | | | | | | | | | Fixes CID1197069 Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | http: restructure http_connect error handling pathwm42014-03-231-8/+10
| | | | | | | | | | | | | | | | 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-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-121-0/+4
|\| | | | | | | | | | | | | * qatar/master: http: Properly initialize icy headers string Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Properly initialize icy headers stringAlessandro Ghedini2014-03-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-121-2/+2
|\| | | | | | | | | | | | | * 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-121-2/+2
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-03-121-2/+3
|\| | | | | | | | | | | | | | | | | | | | | * 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-111-0/+6
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * http: Improve options descriptionsAlessandro Ghedini2014-03-111-2/+2
| | | | | | | | | | | | Add documentation where missing. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'ab76d9f628ad46e1d3bbf26c5bf1f87083f239ab'Michael Niedermayer2014-03-121-1/+2
|\| | | | | | | | | | | | | | | | | | | | | * 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-111-0/+3
| | | | | | | | | | | | 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-121-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | * 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-111-3/+14
| | | | | | | | | | | | Comment from Reimar Döffinger included as pro memoria. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'ddfc98906373d1f17f6205cedd14c68d7a75995f'Michael Niedermayer2014-03-121-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | * 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-111-2/+6
| | | | | | | | | | | | | | 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-121-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-111-0/+5
| | | | | | | | | | | | Bug-Id: https://bugs.debian.org/740421 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '8075c3d8bb1f6aade0cc7c5c40db9bc1bcd84cab'Michael Niedermayer2014-03-121-36/+65
|\| | | | | | | | | | | | | | | | | | | | | | | | | * 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-111-1/+103
| | | | | | | | | | | | | | | | | | 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-121-51/+85
|\| | | | | | | | | | | | | | | | | | | * commit '4ff99ab3d7d5576e99e6b8a411b4a44500ed88fa': http: Refactor process_line Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Refactor process_lineLuca Barbato2014-03-111-51/+85
| |
* | Merge commit '7a2fddb4480121712df560cf619c1c3566cae3ff'Michael Niedermayer2014-03-121-15/+18
|\| | | | | | | | | | | | | | | | | | | * 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-111-15/+17
| |
* | Merge commit '78b21c1d7177e1d61ad3c9225f67699da089aa7c'Michael Niedermayer2014-03-121-5/+11
|\| | | | | | | | | | | | | | | | | | | * commit '78b21c1d7177e1d61ad3c9225f67699da089aa7c': http: Drop doxy comments Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Drop doxy commentsLuca Barbato2014-03-111-5/+11
| |
* | Merge commit '55a215ba63d9fa79cd7ee265ee2e777ee86b200c'Michael Niedermayer2014-03-121-6/+6
|\| | | | | | | | | | | | | * commit '55a215ba63d9fa79cd7ee265ee2e777ee86b200c': http: Return meaningful error codes Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * http: Return meaningful error codesLuca Barbato2014-03-111-6/+6
| |
* | Merge remote-tracking branch 'lukaszmluki/master'Michael Niedermayer2014-03-061-4/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-061-0/+2
| | | | | | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
| * | lavf/http: return error on seeking to negative postionLukasz Marek2014-03-061-4/+7
| | | | | | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* | | http: handle ICY in presence of chunked transfer encodingwm42014-03-051-15/+39
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-231-1/+4
| | | | | | | | | | | | Fixes ticket #3336 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/http: always allow no-op seekAnssi Hannula2014-01-031-0/+2
| | | | | | | | | | | | 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-311-3/+11
| | | | | | | | | | | | | | 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-221-5/+15
|\| | | | | | | | | | | | | | | | | | | | | * 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-221-5/+15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '393d80cc278e2b2f5c9e7805db176e6f28335a33'Michael Niedermayer2013-11-221-2/+3
|\| | | | | | | | | | | | | | | | | | | | | * commit '393d80cc278e2b2f5c9e7805db176e6f28335a33': http: Support relative URL redirection Conflicts: libavformat/http.c See: 4a4c93cb3f2f564263f4b20446a7d500772e0d40 Merged-by: Michael Niedermayer <michaelni@gmx.at>