diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2001-12-04 01:12:51 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2001-12-04 01:12:51 +0000 |
| commit | 6598654546f99b102711561e6ae9cefd5977ee3f (patch) | |
| tree | 5f640abde73153bc656665133e092ec0737e82b6 /lib/libfetch/http.c | |
| parent | 89db7b8c6df9967aecb0b03f0d1cca2cbfb346c8 (diff) | |
Notes
Diffstat (limited to 'lib/libfetch/http.c')
| -rw-r--r-- | lib/libfetch/http.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index ba0bdf8d2602..d9fe15f854c6 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -92,7 +92,7 @@ extern char *__progname; /* XXX not portable */ #define HTTP_MOVED_TEMP 302 #define HTTP_SEE_OTHER 303 #define HTTP_NEED_AUTH 401 -#define HTTP_NEED_PROXY_AUTH 403 +#define HTTP_NEED_PROXY_AUTH 407 #define HTTP_PROTOCOL_ERROR 999 #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \ @@ -728,6 +728,14 @@ _http_request(struct url *URL, const char *op, struct url_stat *us, if (!url->port) url->port = _fetch_default_port(url->scheme); + /* were we redirected to an FTP URL? */ + if (purl == NULL && strcmp(url->scheme, SCHEME_FTP) == 0) { + if (strcmp(op, "GET") == 0) + return _ftp_request(url, "RETR", us, purl, flags); + else if (strcmp(op, "HEAD") == 0) + return _ftp_request(url, "STAT", us, purl, flags); + } + /* connect to server or proxy */ if ((fd = _http_connect(url, purl, flags)) == -1) goto ouch; @@ -799,6 +807,7 @@ _http_request(struct url *URL, const char *op, struct url_stat *us, break; case HTTP_MOVED_PERM: case HTTP_MOVED_TEMP: + case HTTP_SEE_OTHER: /* * Not so fine, but we still have to read the headers to * get the new location. |
