diff options
author | des <des@FreeBSD.org> | 2003-01-22 17:52:27 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2003-01-22 17:52:27 +0000 |
commit | a5ab2dd958ae62591a2b7bb6677bf2125953122d (patch) | |
tree | 8c19a0f38aedbcf09761e144e674fcfad3d02397 /lib | |
parent | a6d2c44ea2eec7d34c25abdb52db8d033d7e979d (diff) | |
download | FreeBSD-src-a5ab2dd958ae62591a2b7bb6677bf2125953122d.zip FreeBSD-src-a5ab2dd958ae62591a2b7bb6677bf2125953122d.tar.gz |
A negative offset means "get it all".
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libfetch/http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 00f28e8..8eebb83 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -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; } |