-/* $OpenBSD: fetch.c,v 1.207 2021/11/09 12:14:35 kn Exp $ */
+/* $OpenBSD: fetch.c,v 1.208 2021/11/10 07:32:55 kn Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
int ishttpsurl = 0;
#endif /* !NOSSL */
#ifndef SMALL
- char *eurl = NULL;
char *full_host = NULL;
const char *scheme;
char *locbase;
struct stat stbuf;
struct tm lmt = { 0 };
struct timespec ts[2];
-#else
- char *eurl = NULL;
#endif /* !SMALL */
struct tls *tls = NULL;
int status;
#endif /* !NOSSL */
epath = url_encode(path);
-#ifndef SMALL
- if (asprintf(&eurl, "%s%s%s%s/%s",
- scheme,
- full_host,
- portnum ? ":" : "",
- portnum ? portnum : "",
- epath) == -1)
- errx(1, "Cannot build encoded URL");
-#endif
if (proxyurl) {
-#ifndef SMALL
if (verbose) {
fprintf(ttyout, "Requesting %s (via %s)\n",
- eurl, proxyurl);
+ origline, proxyurl);
}
-#endif
/*
* Host: directive must use the destination host address for
* the original URI (path).
proxy_credentials);
ftp_printf(fin, "\r\n");
} else {
-#ifndef SMALL
if (verbose)
- fprintf(ttyout, "Requesting %s\n", eurl);
+ fprintf(ttyout, "Requesting %s\n", origline);
+#ifndef SMALL
if (resume || timestamp) {
if (stat(savefile, &stbuf) == 0) {
if (resume)
status = strtonum(ststr, 200, 503, &errstr);
if (errstr) {
strnvis(gerror, cp, sizeof gerror, VIS_SAFE);
-#ifndef SMALL
- warnx("Error retrieving %s: %s", eurl, gerror);
-#else
warnx("Error retrieving %s: %s", origline, gerror);
-#endif
goto cleanup_url_get;
}
break;
default:
strnvis(gerror, cp, sizeof gerror, VIS_SAFE);
-#ifndef SMALL
- warnx("Error retrieving %s: %s", eurl, gerror);
-#else
warnx("Error retrieving %s: %s", origline, gerror);
-#endif
goto cleanup_url_get;
}
if (isunavail) {
if (retried || retryafter != 0)
warnx("Error retrieving %s: 503 Service Unavailable",
-#ifndef SMALL
- eurl);
-#else
origline);
-#endif
else {
if (verbose)
fprintf(ttyout, "Retrying %s\n", origline);
cleanup_url_get:
#ifndef SMALL
- free(eurl);
free(full_host);
#endif /* !SMALL */
#ifndef NOSSL