summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/fetch.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-02-09 03:43:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-02-09 03:43:49 +0000
commit7abfc1ed31eb7979e079708ca83bbf191e6e3789 (patch)
tree22fa9089e5b54ec0f12ea73a398687edf82f0846 /usr.bin/ftp/fetch.c
parent3d04c3892f5974aa845566bb6d3544cd56116ee2 (diff)
if we read less than Content-Length, whine and error
Diffstat (limited to 'usr.bin/ftp/fetch.c')
-rw-r--r--usr.bin/ftp/fetch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 4d01874892e..27291212e16 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.23 1998/09/30 07:49:36 deraadt Exp $ */
+/* $OpenBSD: fetch.c,v 1.24 1999/02/09 03:43:48 deraadt Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: fetch.c,v 1.23 1998/09/30 07:49:36 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: fetch.c,v 1.24 1999/02/09 03:43:48 deraadt Exp $";
#endif /* not lint */
/*
@@ -474,6 +474,12 @@ url_get(origline, proxyenv, outfile)
goto cleanup_url_get;
}
progressmeter(1);
+ if (filesize != -1 && len == 0 && bytes != filesize) {
+ if (verbose)
+ fputs("Read short file.\n", ttyout);
+ goto cleanup_url_get;
+ }
+
if (verbose)
fputs("Successfully retrieved file.\n", ttyout);
(void)signal(SIGINT, oldintr);