1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-20 15:43:16 +00:00

A negative offset means "get it all".

This commit is contained in:
Dag-Erling Smørgrav 2003-01-22 17:52:27 +00:00
parent 256b988c93
commit 591c019988
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109693

View File

@ -887,7 +887,7 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
_http_cmd(conn, "User-Agent: %s", p);
else
_http_cmd(conn, "User-Agent: %s " _LIBFETCH_VER, getprogname());
if (url->offset)
if (url->offset > 0)
_http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset);
_http_cmd(conn, "Connection: close");
_http_cmd(conn, "");
@ -1059,7 +1059,7 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
}
/* too far? */
if (offset > URL->offset) {
if (URL->offset > 0 && offset > URL->offset) {
_http_seterr(HTTP_PROTOCOL_ERROR);
goto ouch;
}