From cejkar@dcse.fee.vutbr.cz  Sat May 20 00:15:43 2000
Return-Path: <cejkar@dcse.fee.vutbr.cz>
Received: from boco.fee.vutbr.cz (boco.fee.vutbr.cz [147.229.9.11])
	by hub.freebsd.org (Postfix) with ESMTP id E670937B6CA
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 20 May 2000 00:15:41 -0700 (PDT)
	(envelope-from cejkar@dcse.fee.vutbr.cz)
Received: from kazi.dcse.fee.vutbr.cz (kazi.dcse.fee.vutbr.cz [147.229.8.12])
	by boco.fee.vutbr.cz (8.11.0.Beta1/8.11.0.Beta1) with ESMTP id e4K7FZw44210
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 20 May 2000 09:15:36 +0200 (CEST)
Received: (from cejkar@localhost)
	by kazi.dcse.fee.vutbr.cz (8.10.1/8.10.1) id e4K7FY712821;
	Sat, 20 May 2000 09:15:34 +0200 (CEST)
Message-Id: <200005200715.e4K7FY712821@kazi.dcse.fee.vutbr.cz>
Date: Sat, 20 May 2000 09:15:34 +0200 (CEST)
From: cejkar@dcse.fee.vutbr.cz
Reply-To: cejkar@dcse.fee.vutbr.cz
To: FreeBSD-gnats-submit@freebsd.org
Subject: libfetch: Restart does not work in active FTP mode (r.: des)
X-Send-Pr-Version: 3.2

>Number:         18688
>Category:       bin
>Synopsis:       libfetch: Restart does not work in active FTP mode (r.: des)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 20 00:20:01 PDT 2000
>Closed-Date:    Wed Jul 19 02:27:02 PDT 2000
>Last-Modified:  Wed Jul 19 02:27:38 PDT 2000
>Originator:     Rudolf Cejka
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Brno University of Technology, FEE&CS, Czech Republic
>Environment:

5.0-CURRENT

>Description:

In libfetch, there is restart capability (data downloading with begin
somewhere in the middle of the file) for HTTP and passive FTP
mode. But when active FTP mode is used, restart does not work.

It is because lines performing REST command were added only to
passive FTP mode section, whereas in active FTP mode these lines
are missing.

>How-To-Repeat:
>Fix:

Hmm. It looks that branching in lib/libfetch/ftp.c,v is broken:

# co lib/libfetch/ftp.c,v
lib/libfetch/ftp.c,v  -->  ftp.c
revision 1.20
done

But retrieved file is revision 1.19:

$FreeBSD: src/lib/libfetch/ftp.c,v 1.19 2000/05/15 08:24:58 des Exp $

Here is simple patch adding restart capability to active ftp mode:

--- ftp.c.orig	Fri May 19 22:00:43 2000
+++ ftp.c	Fri May 19 22:10:01 2000
@@ -303,6 +303,11 @@
 	if (e != FTP_OK)
 	    goto ouch;
 
+	/* seek to required offset */
+	if (offset)
+	    if (_ftp_cmd(cd, "REST %lu", (u_long)offset) != FTP_FILE_OK)
+		goto sysouch;
+
 	/* make the server initiate the transfer */
 	if (verbose)
 	    _fetch_info("initiating transfer");


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: des 
State-Changed-When: Thu Jun 29 03:44:19 PDT 2000 
State-Changed-Why:  
Patch applied to -CURRENT, thanks! 


Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Thu Jun 29 03:44:19 PDT 2000 
Responsible-Changed-Why:  
libfetch is mine. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=18688 
State-Changed-From-To: feedback->closed 
State-Changed-By: des 
State-Changed-When: Wed Jul 19 02:27:02 PDT 2000 
State-Changed-Why:  
Fixed in -CURRENT and -STABLE, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=18688 
>Unformatted:
