From owner-freebsd-bugs Mon Mar 3 23:10:04 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id XAA01732 for bugs-outgoing; Mon, 3 Mar 1997 23:10:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id XAA01724; Mon, 3 Mar 1997 23:10:02 -0800 (PST) Resent-Date: Mon, 3 Mar 1997 23:10:02 -0800 (PST) Resent-Message-Id: <199703040710.XAA01724@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, marcs@znep.com Received: from valis.worldgate.com (marcs@valis.worldgate.com [198.161.84.2]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA01505 for ; Mon, 3 Mar 1997 23:07:54 -0800 (PST) Received: (from marcs@localhost) by valis.worldgate.com (8.8.5/8.8.5) id AAA28947; Tue, 4 Mar 1997 00:07:47 -0700 (MST) Message-Id: <199703040707.AAA28947@valis.worldgate.com> Date: Tue, 4 Mar 1997 00:07:47 -0700 (MST) From: marcs@znep.com Reply-To: marcs@znep.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/2870: fetch won't restart http transfers Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 2870 >Category: bin >Synopsis: fetch -r just doesn't work for http transfers >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 3 23:10:01 PST 1997 >Last-Modified: >Originator: Marc Slemko >Organization: >Release: FreeBSD 2.2-GAMMA i386 >Environment: Latest fetch, from 2.2 or -current. >Description: When you try to use fetch -r against a http server to resume a transfer, it will always give an error about "unknown Content-Range unit". Once I fixed that problem, it was then filling the start of the file with null characters when it was resumed. >How-To-Repeat: $ fetch http://localhost/~marcs/epi-r06.pdf ^C (abort partway through the file) $ fetch -r http://localhost/~marcs/epi-r06.pdf >Fix: The following fixes the problem, and I _think_ it shouldn't cause any other problems but have not had time to look at it in detail. After this patch, fetch restarts http transfers fine for me, although it still doesn't quite do chunked encodings properly... Index: http.c =================================================================== RCS file: /usr/cvs/src/usr.bin/fetch/http.c,v retrieving revision 1.4 diff -c -r1.4 http.c *** http.c 1997/02/11 20:46:05 1.4 --- http.c 1997/03/04 06:57:47 *************** *** 857,863 **** if (to_stdout) local = fopen("/dev/stdout", "w"); else ! local = fopen(fs->fs_outputfile, "w"); if (local == 0) { warn("%s: fopen", fs->fs_outputfile); fclose(remote); --- 857,863 ---- if (to_stdout) local = fopen("/dev/stdout", "w"); else ! local = fopen(fs->fs_outputfile, "a"); if (local == 0) { warn("%s: fopen", fs->fs_outputfile); fclose(remote); *************** *** 1263,1269 **** u_quad_t first, last, total; char *ep; ! if (strcasecmp(orig, "bytes") != 0) { warnx("unknown Content-Range unit: `%s'", orig); return EX_PROTOCOL; } --- 1263,1269 ---- u_quad_t first, last, total; char *ep; ! if (strncasecmp(orig, "bytes", 5) != 0) { warnx("unknown Content-Range unit: `%s'", orig); return EX_PROTOCOL; } >Audit-Trail: >Unformatted: