freebsd-skq/lib/libfetch
Dag-Erling Smørgrav c8453e5bf4 Fix partial requests (used by fetch -r) when the requested file is
already complete.

Since 416 is an error code, any Content-Range header in the response
would refer to the error message, not the requested document, so
relying on the value of size when we know we got a 416 is wrong.
Instead, just verify that offset == 0 and assume that we've reached
the end of the document (if offset > 0, we did not request a range,
and the server is screwing with us).  Note that we cannot distinguish
between reaching the end and going past it, but that is a flaw in the
protocol, not in the code, so we just have to assume that the caller
knows what it's doing.  A smart caller would request an offset
slightly before what it believes is the end and compare the result to
what is already in the file.

PR:		212065
Reported by:	mandree
MFC after:	3 weeks
2017-03-05 12:06:45 +00:00
..
common.c Properly indent a default: label and avoid crashing when running 2017-02-28 18:10:03 +00:00
common.h Refactor fetch_connect() and fetch_bind() to improve readability and avoid 2016-11-22 13:30:07 +00:00
fetch.3 Fix bunch of .Xrs. 2016-03-28 16:48:28 +00:00
fetch.c Properly initialize netrcfd in fetchParseURL 2017-03-03 12:51:16 +00:00
fetch.h Add a file descriptor in struct url for netrc 2017-02-20 00:14:31 +00:00
file.c Call closedir() before returning from fetchListFile() to avoid a leak. 2016-05-25 07:43:32 +00:00
ftp.c Refactor fetch_connect() and fetch_bind() to improve readability and avoid 2016-11-22 13:30:07 +00:00
ftp.errors
http.c Fix partial requests (used by fetch -r) when the requested file is 2017-03-05 12:06:45 +00:00
http.errors
Makefile First pass through library packaging. 2016-02-04 21:16:35 +00:00
Makefile.depend DIRDEPS_BUILD: Regenerate without local dependencies. 2016-02-24 17:20:11 +00:00