version 1.170, 2019/06/28 13:35:01 |
version 1.171, 2019/10/05 20:54:20 |
|
|
jmp_buf httpabort; |
jmp_buf httpabort; |
|
|
static int redirect_loop; |
static int redirect_loop; |
|
static int retried; |
|
|
/* |
/* |
* Determine whether the character needs encoding, per RFC1738: |
* Determine whether the character needs encoding, per RFC1738: |
|
|
cp++; |
cp++; |
|
|
strlcpy(ststr, cp, sizeof(ststr)); |
strlcpy(ststr, cp, sizeof(ststr)); |
status = strtonum(ststr, 200, 416, &errstr); |
status = strtonum(ststr, 200, 503, &errstr); |
if (errstr) { |
if (errstr) { |
warnx("Error retrieving file: %s", cp); |
warnx("Error retrieving file: %s", cp); |
goto cleanup_url_get; |
goto cleanup_url_get; |
|
|
warnx("File is already fully retrieved."); |
warnx("File is already fully retrieved."); |
goto cleanup_url_get; |
goto cleanup_url_get; |
#endif /* !SMALL */ |
#endif /* !SMALL */ |
|
case 503: |
|
if (retried++) { |
|
warnx("Error retrieving file: %s", cp); |
|
goto cleanup_url_get; |
|
} |
|
if (verbose) |
|
fprintf(ttyout, "Retrying %s\n", origline); |
|
rval = url_get(origline, proxyenv, savefile, lastfile); |
|
goto cleanup_url_get; |
default: |
default: |
warnx("Error retrieving file: %s", cp); |
warnx("Error retrieving file: %s", cp); |
goto cleanup_url_get; |
goto cleanup_url_get; |
|
|
#endif /* !NOSSL */ |
#endif /* !NOSSL */ |
strncasecmp(url, FILE_URL, sizeof(FILE_URL) - 1) == 0) { |
strncasecmp(url, FILE_URL, sizeof(FILE_URL) - 1) == 0) { |
redirect_loop = 0; |
redirect_loop = 0; |
|
retried = 0; |
if (url_get(url, httpproxy, outfile, lastfile) == -1) |
if (url_get(url, httpproxy, outfile, lastfile) == -1) |
rval = argpos + 1; |
rval = argpos + 1; |
continue; |
continue; |