From owner-freebsd-arch Tue May 16 11:57:25 2000 Delivered-To: freebsd-arch@freebsd.org Received: from peace.mahoroba.org (peace.calm.imasy.or.jp [202.227.26.34]) by hub.freebsd.org (Postfix) with ESMTP id 0C07337BAE0 for ; Tue, 16 May 2000 11:57:17 -0700 (PDT) (envelope-from ume@mahoroba.org) Received: from localhost (IDENT:++HZv7OzshIb+HWEohnE2pVceH/7yGAg7f38Cd9umtJX+ffLiZYHf5QRBFsHuQrH@localhost [::1]) by peace.mahoroba.org (8.10.1/3.7W-peace) with ESMTP id e4GIqhF74521; Wed, 17 May 2000 03:52:43 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Wed, 17 May 2000 03:52:43 +0900 (JST) Message-Id: <200005161852.e4GIqhF74521@peace.mahoroba.org> To: des@flood.ping.uio.no Cc: arch@freebsd.org Subject: Re: fetch(1) In-Reply-To: References: <200005122016.e4CKGtF38185@peace.mahoroba.org> X-Mailer: xcite1.20> Mew version 1.94.2 on Emacs 20.6 / Mule 4.0 =?iso-2022-jp?B?KBskQjJWMWMbKEIp?= X-PGP-Public-Key: http://www.imasy.org/~ume/publickey.asc X-PGP-Fingerprint: 6B 0C 53 FC 5D D0 37 91 05 D0 B3 EF 36 9B 6A BC X-URL: http://www.imasy.org/~ume/ X-OS: FreeBSD 5.0-CURRENT Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Hajimu UMEMOTO (=?ISO-2022-JP?B?GyRCR19LXBsoQiA=?= =?ISO-2022-JP?B?GyRCSCUbKEI=?=) X-Dispatcher: imput version 20000228(IM140) Lines: 36 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>> On 15 May 2000 09:53:04 +0200 >>>>> Dag-Erling Smorgrav said: > Your fetch(1) doesn't handle content size correctly on some case. If > HTTP server doesn't reply Content-Length:, fetchStat() > (fetchStatHTTP()) doesn't return -1 and doesn't touch us.size. Then, > the value of us.size stays unknown. des> That's a bug in fetchStatHTTP(), thanks for pointing it out. You are welcome. There is one more problem. If us.size is -1 with HTTP, gotten file is shorten than original one. This change seems to fix it. Index: http.c =================================================================== RCS file: /home/ncvs/src/lib/libfetch/http.c,v retrieving revision 1.18 diff -u -r1.18 http.c --- http.c 2000/05/15 09:05:36 1.18 +++ http.c 2000/05/16 18:53:46 @@ -135,6 +135,8 @@ } else if (c->encoding == ENC_CHUNKED) { if (c->chunksize == 0) { ln = fgetln(c->real_f, &len); + if (len <= 2) + return NULL; DEBUG(fprintf(stderr, "\033[1m_http_fillbuf(): new chunk: " "%*.*s\033[m\n", (int)len-2, (int)len-2, ln)); sscanf(ln, "%x", &(c->chunksize)); -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message