bin/70992: fetch always use Range when file exists

SANETO Takanori sanewo at ba2.so-net.ne.jp
Thu Aug 26 07:30:27 PDT 2004


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


More information about the freebsd-bugs mailing list