Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Aug 2004 14:25:44 GMT
From:      SANETO Takanori <sanewo@ba2.so-net.ne.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/70992: fetch always use Range when file exists
Message-ID:  <200408261425.i7QEPiS2085794@www.freebsd.org>
Resent-Message-ID: <200408261430.i7QEURLD010010@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408261425.i7QEPiS2085794>