summaryrefslogtreecommitdiff
path: root/lib/libfetch
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2002-06-19 08:36:00 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2002-06-19 08:36:00 +0000
commitf8bd33a0ae3ecc1475f6fa440b37992c0b5aa26b (patch)
tree988eca4adb4de76a4a805d357345fe9ae1d1278f /lib/libfetch
parent5f19035b04d7cfcbea6f2973e123a0b2632664f1 (diff)
Notes
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/http.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 68497e9b6042..99b34ffe87da 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -766,7 +766,7 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
conn_t *conn;
struct url *url, *new;
int chunked, direct, need_auth, noredirect, verbose;
- int i, n;
+ int e, i, n;
off_t offset, clength, length, size;
time_t mtime;
const char *p;
@@ -793,6 +793,7 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
n = noredirect ? 1 : MAX_REDIRECT;
i = 0;
+ e = HTTP_PROTOCOL_ERROR;
need_auth = 0;
do {
new = NULL;
@@ -990,6 +991,7 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
/* we need to provide authentication */
if (conn->err == HTTP_NEED_AUTH) {
+ e = conn->err;
need_auth = 1;
_fetch_close(conn);
conn = NULL;
@@ -997,6 +999,7 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
}
/* all other cases: we got a redirect */
+ e = conn->err;
need_auth = 0;
_fetch_close(conn);
conn = NULL;
@@ -1011,7 +1014,7 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
/* we failed, or ran out of retries */
if (conn == NULL) {
- _http_seterr(conn->err);
+ _http_seterr(e);
goto ouch;
}