From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 26 14:30:27 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 980DF16A4CE for ; Thu, 26 Aug 2004 14:30:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E90043D39 for ; Thu, 26 Aug 2004 14:30:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i7QEURpd010012 for ; Thu, 26 Aug 2004 14:30:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i7QEURLD010010; Thu, 26 Aug 2004 14:30:27 GMT (envelope-from gnats) Resent-Date: Thu, 26 Aug 2004 14:30:27 GMT Resent-Message-Id: <200408261430.i7QEURLD010010@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, SANETO Takanori Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EBCC16A4CE for ; Thu, 26 Aug 2004 14:25:44 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7080C43D67 for ; Thu, 26 Aug 2004 14:25:44 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i7QEPiBH085795 for ; Thu, 26 Aug 2004 14:25:44 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i7QEPiS2085794; Thu, 26 Aug 2004 14:25:44 GMT (envelope-from nobody) Message-Id: <200408261425.i7QEPiS2085794@www.freebsd.org> Date: Thu, 26 Aug 2004 14:25:44 GMT From: SANETO Takanori To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: bin/70992: fetch always use Range when file exists X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 14:30:27 -0000 >Number: 70992 >Category: bin >Synopsis: fetch always use Range when file exists >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 26 14:30:26 GMT 2004 >Closed-Date: >Last-Modified: >Originator: SANETO Takanori >Release: 5.2-CURRENT >Organization: an individual >Environment: FreeBSD muse.sanewo.ddo.jp 5.2-CURRENT FreeBSD 5.2-CURRENT #321: Mon Aug 16 23:41:11 JST 2004 root@muse.sanewo.ddo.jp:/export/usr/obj/usr/src/sys/MUSE i386 >Description: when the target file exists on localy, fetch always use Range: header. If the size of local file is equal to or greater than remote file, some http server returns "Range not supported" error and fetch fails. Range should have been used only when -r option is specified. >How-To-Repeat: Try fetching same file twice from, e.g. http://www.FreeBSD.org/ports/auditfile.tbz . You will get following error: fetch: http://www.FreeBSD.org/ports/auditfile.tbz: Requested Range Not Satisfiable >Fix: Following patch might fix the problem. diff -u -r1.72 fetch.c --- fetch.c 15 Aug 2004 22:22:35 -0000 1.72 +++ fetch.c 26 Aug 2004 14:24:44 -0000 @@ -418,7 +418,7 @@ sb.st_size = -1; if (!o_stdout) { r = stat(path, &sb); - if (r == 0 && S_ISREG(sb.st_mode)) { + if (r == 0 && r_flag && S_ISREG(sb.st_mode)) { url->offset = sb.st_size; } else { /* >Release-Note: >Audit-Trail: >Unformatted: