From 48923b69bf54be973d671c9715591f3e10289c67 Mon Sep 17 00:00:00 2001 From: lukem Date: Fri, 19 Feb 1999 16:29:27 +0000 Subject: [PATCH] support restart during proxy transfers (the traditional ftp command, not the http proxy). seems to work with my limited testing (i'm not a big user of proxy). bug noted by Jorgen Lundman in [bin/5948] --- usr.bin/ftp/ftp.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c index 46d163e25b97..f3a1d69e34f1 100644 --- a/usr.bin/ftp/ftp.c +++ b/usr.bin/ftp/ftp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.40 1999/01/24 02:39:30 lukem Exp $ */ +/* $NetBSD: ftp.c,v 1.41 1999/02/19 16:29:27 lukem Exp $ */ /* * Copyright (c) 1985, 1989, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else -__RCSID("$NetBSD: ftp.c,v 1.40 1999/01/24 02:39:30 lukem Exp $"); +__RCSID("$NetBSD: ftp.c,v 1.41 1999/02/19 16:29:27 lukem Exp $"); #endif #endif /* not lint */ @@ -1426,7 +1426,13 @@ proxtrans(cmd, local, remote) if (setjmp(ptabort)) goto abort; oldintr = signal(SIGINT, abortpt); - if (command("%s %s", cmd, remote) != PRELIM) { + if ((restart_point && +#ifndef NO_QUAD + (command("REST %qd", (long long) restart_point) != CONTINUE) +#else + (command("REST %ld", (long) restart_point) != CONTINUE) +#endif + ) || (command("%s %s", cmd, remote) != PRELIM)) { (void)signal(SIGINT, oldintr); pswitch(1); return; @@ -1434,7 +1440,13 @@ proxtrans(cmd, local, remote) sleep(2); pswitch(1); secndflag++; - if (command("%s %s", cmd2, local) != PRELIM) + if ((restart_point && +#ifndef NO_QUAD + (command("REST %qd", (long long) restart_point) != CONTINUE) +#else + (command("REST %ld", (long) restart_point) != CONTINUE) +#endif + ) || (command("%s %s", cmd2, local) != PRELIM)) goto abort; ptflag++; (void)getreply(0);