You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Paul C. Bryan" <pb...@creatia.com> on 2001/11/22 00:12:25 UTC

[PATCH] Bug 5018

Summary:

Chunked transfer encoding not isolated from application.


Description:

Chunked transfer encoding is not being supported transparently by the 
HttpMethodBase object, causing chunk data to be embedded in response 
body data and forcing the application to handle the HTTP/1.1 
implementation of chunked transfer encoding.

The included patch now properly parses chunk data as per RFC 2068 and 
provides body content consistently, regardless of whether chunked 
transfer encoding was used by the server or not. This relieves the 
application from the requirement of implementing RFC 2068.


Patch Notes:

RFC 2068 specifies optional footer fields that are supplied after the 
end of the chunked data body. These are parsed, but added as "header" 
fields because I didn't want to change the HttpMethod interface. The 
result is that footer fields such as signatures must be retrieved as 
headers. The downside to this approach is there is no way to distinguish 
  between a header field and a footer field when interrogating the 
HttpMethod.

I've defined a constant SIZE_buf to use as a buffer size for allocated 
copy buffers. I've only used it in my patch (because it is referred to 
more than once in the method), but propose that it be used by any 
methods that perform copy operations with the allocation of a buffer. 
Comments?

Because a ResponseInputStream is used to read the body, the response 
footers cannot be retrived using the conn.readLine() method. Instead, 
the ResponseInputStream.readLine method must be used. For this reason, 
response footers are read after the body in the readResponseBody method.

I'm not sure why only get request method is supporting writing content 
to disk. I believe the useDisk functionality should be moved to 
HttpMethodBase. I was tempted to do so, but didn't want to jeopardize 
the acceptance of this patch. If someone gives me the go ahead, I am 
willing to move useDisk into HttpMethodBase.

GetMethod.readResponseBody(HttpState, HttpConnection) duplicated much of 
HttpMethodBase.readResponseBody(HttpState, HttpConnection) 
functionality. I moved this into a new common 
readResponseBody(ResponseInputStream, OutputStream) that is shared by 
HttpMethodBase and GetMethod. If useDisk moves into HttpMethodBase, 
there should be no longer be a need for this separate method.

The included patches have been extensively tested against a WebLogic 6.1 
SP1 server, which makes use of chunked transfer encoding when content 
length is not known ahead of time.

I've gone out of my way to keep the style of this patch consistent with 
the existing source code. I'm curious how much liberty I should take in 
the future when it comes to formatting.

Yours truly,

Paul C. Bryan
pbryan@creatia.com

Re: [HttpClient] Re: [PATCH] Bug 5018

Posted by robert burrell donkin <ro...@mac.com>.
On Monday, November 26, 2001, at 05:01 PM, Paul C. Bryan wrote:

> Dear HttpClient Developers:
>
> Last week, I reported a deficiency in the HttpClient library and 
> submitted a patch via this mailing list, addressing the lack of 
> transparent support for chunked transfer encoding.
>
> I haven't heard yet from anyone in response to my submission, so I'm 
> wondering if perhaps I failed to submit it properly, or failed to observe 
> proper etiquette.
>
> Any insight anyone can provide would be most appreciated.

commons is a bit different from most of the other projects here at jakarta.
  the commons is composed (as you probably know) of lots of smaller 
sub-projects. each of these sub-projects has fewer developers and 
committers than is usual.

this means is that you might have to wait a little long and maybe repost a 
few more times.

so please keep trying :)

- robert


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


[HttpClient] Re: [PATCH] Bug 5018

Posted by "Paul C. Bryan" <pb...@creatia.com>.
Dear HttpClient Developers:

Last week, I reported a deficiency in the HttpClient library and 
submitted a patch via this mailing list, addressing the lack of 
transparent support for chunked transfer encoding.

I haven't heard yet from anyone in response to my submission, so I'm 
wondering if perhaps I failed to submit it properly, or failed to 
observe proper etiquette.

Any insight anyone can provide would be most appreciated.

Yours truly,

Paul C. Bryan
pbryan@creatia.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>