NetBSD Problem Report #9096

Received: (qmail 10867 invoked from network); 1 Jan 2000 13:47:46 -0000
Message-Id: <200001011347.WAA02830@itojun.org>
Date: Sat, 1 Jan 2000 22:47:43 +0900 (JST)
From: itojun@itojun.org
Reply-To: itojun@itojun.org
To: gnats-bugs@gnats.netbsd.org
Cc: itojun@coconut.itojun.org
Subject: ftp(1) does not like what apache 1.3.9 sends (chunked encoding)
X-Send-Pr-Version: 3.95

>Number:         9096
>Category:       bin
>Synopsis:       ftp(1) does not like what apache 1.3.9 sends (chunked encoding)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lukem
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 01 05:48:00 +0000 2000
>Closed-Date:    Tue Jan 25 07:13:49 +0000 2000
>Last-Modified:  Tue Jan 25 07:14:41 +0000 2000
>Originator:     Jun-ichiro itojun Hagino
>Release:        1.4.1, current
>Organization:
	itojun.org
>Environment:
System: NetBSD lychee.itojun.org 1.4.1 NetBSD 1.4.1 (LYCHEE.v6) #460: Fri Dec 31 01:31:37 JST 1999 itojun@lychee.itojun.org:/export/home/itojun/k/kame/netbsd/sys/arch/i386/compile/LYCHEE.v6 i386


>Description:
	apache 1.3.9 has a bug in chunked encoding, and ftp(1) does not
	forgive it.
	if you try to access http://mine.kame.net/~sakane/diary/ by using
	ftp(1), ftp(1) will bark "Unexpected data following chunksize" and exit.

	This is because apache 1.3.9 transmits a space after chunksize (hex
	number, "chunk-size".

HTTP/1.1 200 OK
Date: Sat, 01 Jan 2000 13:03:22 GMT
Server: Apache/1.3.9 (Unix)
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

b4 	<--- trailing space on this line


	from rfc2616, apache 1.3.9 is wrong and ftp(1) is correct.

3.6.1 Chunked Transfer Coding

       Chunked-Body   = *chunk
                        last-chunk
                        trailer
                        CRLF

       chunk          = chunk-size [ chunk-extension ] CRLF
                        chunk-data CRLF
       chunk-size     = 1*HEX
       last-chunk     = 1*("0") [ chunk-extension ] CRLF

       chunk-extension= *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
       chunk-ext-name = token
       chunk-ext-val  = token | quoted-string
       chunk-data     = chunk-size(OCTET)
       trailer        = *(entity-header CRLF)

>How-To-Repeat:
	try
	% ftp -d -v -o - http://mine.kame.net/~sakane/diary/ >/dev/null
>Fix:
	1. apache 1.3.9 should be fixed.
	2. due to wide install base of apache 1.3.9, it may be better for
	   ftp(1) to be forgiving about it, or ftp(1) should try to fall back
	   to HTTP/1.0?  I'm not sure.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: bin-bug-people->lukem 
Responsible-Changed-By: fair 
Responsible-Changed-When: Sun Jan 2 12:42:27 PST 2000 
Responsible-Changed-Why:  
Luke is Mr. FTP. 
State-Changed-From-To: open->closed 
State-Changed-By: lukem 
State-Changed-When: Mon Jan 24 23:13:49 PST 2000 
State-Changed-Why:  
i've committed a workaround 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.