From: kn Date: Wed, 10 Nov 2021 07:32:55 +0000 (+0000) Subject: Revert previous X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3348847899a8dc5df2a4635c5d375118a9fb2607;p=openbsd 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 --- 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