summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2021-11-10 07:32:56 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2021-11-10 07:32:56 +0000
commit953d9dd7bda85fd46b754eb53e0630a1c3c9d56d (patch)
treee5514f5b7b9ac0f58a9c45a925fa8ec6e536162f /usr.bin
parent5f9107190412f473cd644f9c28a78db30aa7f57f (diff)
Revert previous
I overlooked the autoinstall case where "Requesting ..." is used, but those messages that got fixed where omitted in ftp's SMALL version. Noticed the hard way by anton
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ftp/fetch.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 602371f06e4..ebc7498c0a7 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $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 $ */
/*-
@@ -336,7 +336,6 @@ url_get(const char *origline, const char *proxyenv, const char *outfile, int las
int ishttpsurl = 0;
#endif /* !NOSSL */
#ifndef SMALL
- char *eurl = NULL;
char *full_host = NULL;
const char *scheme;
char *locbase;
@@ -346,8 +345,6 @@ url_get(const char *origline, const char *proxyenv, const char *outfile, int las
struct stat stbuf;
struct tm lmt = { 0 };
struct timespec ts[2];
-#else
- char *eurl = NULL;
#endif /* !SMALL */
struct tls *tls = NULL;
int status;
@@ -716,22 +713,11 @@ noslash:
#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).
@@ -748,9 +734,9 @@ noslash:
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)
@@ -847,11 +833,7 @@ noslash:
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;
}
@@ -897,11 +879,7 @@ noslash:
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;
}
@@ -1034,11 +1012,7 @@ noslash:
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);
@@ -1161,7 +1135,6 @@ improper:
cleanup_url_get:
#ifndef SMALL
- free(eurl);
free(full_host);
#endif /* !SMALL */
#ifndef NOSSL