From root@slime.mail.vuurwerk.net  Thu Jul  1 09:11:19 2004
Return-Path: <root@slime.mail.vuurwerk.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 13F3216A518
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 Jul 2004 09:11:19 +0000 (GMT)
Received: from slime.mail.vuurwerk.net (slime.mail.vuurwerk.net [62.250.3.103])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8A2E343D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 Jul 2004 09:11:18 +0000 (GMT)
	(envelope-from root@slime.mail.vuurwerk.net)
Received: from slime.mail.vuurwerk.net (localhost [127.0.0.1])
	by slime.mail.vuurwerk.net (8.12.9p2/8.12.9) with ESMTP id i61ABIGM000555;
	Thu, 1 Jul 2004 10:11:18 GMT
	(envelope-from root@slime.mail.vuurwerk.net)
Received: (from root@localhost)
	by slime.mail.vuurwerk.net (8.12.9p2/8.12.9/Submit) id i61ABIRD000554;
	Thu, 1 Jul 2004 10:11:18 GMT
	(envelope-from root)
Message-Id: <200407011011.i61ABIRD000554@slime.mail.vuurwerk.net>
Date: Thu, 1 Jul 2004 10:11:18 GMT
From: Paul de Weerd <weerd@weirdnet.nl>
Reply-To: Paul de Weerd <weerd@weirdnet.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc: peter@dataloss.nl, peter@vuurwerk.nl, weerd@weirdnet.nl
Subject: ftp breaks on chunked encoding (http)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         68547
>Category:       bin
>Synopsis:       ftp breaks on chunked encoding (http)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 01 09:20:21 GMT 2004
>Closed-Date:    Wed Jul 28 08:37:26 GMT 2004
>Last-Modified:  Tue Jul  5 10:20:13 GMT 2005
>Originator:     Paul de Weerd
>Release:        FreeBSD 4.9-RELEASE-p10 i386
>Organization:
weirdnet.nl
>Environment:
System: FreeBSD slime.mail.vuurwerk.net 4.9-RELEASE-p10 FreeBSD 4.9-RELEASE-p10 #0: Tue Jun 22 12:25:42 GMT 2004 root@sludge.mail.vuurwerk.nl:/usr/obj/usr/src/sys/MAIL i386


	all tested systems show this behaviour
>Description:
	when downloading a file via http and this file gets send with chunked encoding by the webserver, the chunk messages are saved to the output file. This corrupts the file.
>How-To-Repeat:
	ftp http://www.dataloss.nl/software/patches/qmail-barelfdelay.patch
	md5 sum should be : bcd66117948538a31e17504c2c9e942d
	md5 sum IS        : 4c17905706d043e2187752f8c9d085d6
>Fix:

	work around : do not use FreeBSD's ftp(1) to download files via HTTP.


>Release-Note:
>Audit-Trail:

From: Paul de Weerd <weerd@weirdnet.nl>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/68547: ftp breaks on chunked encoding (http)
Date: Thu, 1 Jul 2004 19:43:35 +0200

 Of course, a workaround is to use fetch(1), fetch does not have this
 issue (as far as I can see).
 
 Cheers,
 
 Paul 'WEiRD' de Weerd
 
 -- 
 >++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
 +++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                  http://www.weirdnet.nl/                 

From: "Volker Stolz" <vs@freebsd.org>
To: freebsd-gnats-submit@freebsd.org, weerd@weirdnet.nl
Cc:  
Subject: Re: bin/68547: ftp breaks on chunked encoding (http)
Date: Thu, 15 Jul 2004 10:54:41 +0200

 The correct solution would be for ftp to never send the HTTP/1.1 header  
 since it obviously IS NOT HTTP/1.1-compliant.
 RFC 2616 clearly states in section 3.6.1:
 
 "All HTTP/1.1 applications MUST be able to receive and decode the  
 "chunked" transfer-coding, and MUST ignore chunk-extension extensions they  
 do not understand."
 
 However, ftp has already been replaced in -CURRENT, so this applies only  
 to usr.bin/ftp/fetch.c on 4.X, but would
 be a useful addition, especially in the face of the pending EOL of 4.X.
 
 Volker
State-Changed-From-To: open->feedback 
State-Changed-By: yar 
State-Changed-When: Fri Jul 16 09:05:03 GMT 2004 
State-Changed-Why:  
I've just committed a remedy for this problem to STABLE. 
Could you please confirm that it works for you? 
Thanks for reporting! 


Responsible-Changed-From-To: freebsd-bugs->yar 
Responsible-Changed-By: yar 
Responsible-Changed-When: Fri Jul 16 09:05:03 GMT 2004 
Responsible-Changed-Why:  
I committed a fix, so I'd like to see feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68547 
State-Changed-From-To: feedback->closed 
State-Changed-By: yar 
State-Changed-When: Wed Jul 28 08:36:45 GMT 2004 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68547 

From: Yar Tikhiy <yar@comp.chem.msu.su>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/68547: ftp breaks on chunked encoding (http)
Date: Tue, 5 Jul 2005 14:13:13 +0400

 Paul de Weerd, the originator of this PR, has confirmed
 in private mail that the solution works well for him.
 
 -- 
 Yar
>Unformatted:
