Bug in HTTPClient (shouldn't look for body in 304 response)

Hi, I’ve detected a bug in HTTPClient when receiving a 304 with no
Content-Length.

According to RFC 2616:


4.4 Message Length

The transfer-length of a message is the length of the message-body as
it appears in the message; that is, after any transfer-codings have
been applied. When a message-body is included with a message, the
transfer-length of that body is determined by one of the following (in
order of precedence):

1.Any response message which “MUST NOT” include a message-body (such
as the 1xx, 204, and 304 responses and any response to a HEAD request)
is always terminated by the first empty line after the header fields,
regardless of the entity-header fields present in the message

This means that a 304 doesn’t require “Content-Length: 0” at all, and
HTTPClient shouldn’t wait and look for it. Unfortunatelly HTTPClient
waits for it and creates ReceiveTimeoutError exception).

I’ve already reported the bug in the project tracker but have received
no reply at all fro the author (I also wrote him directly with no
success):

http://dev.ctor.org/http-access2/ticket/224

As you can see in the tracker, I also tryed to fix it but found some
problems I cannot solve. Anyway I think it’s a easy fix for a more
experimented programmer :slight_smile:
could you please help me on fixing it?

Thanks a lot.

On Jul 21, 2009, at 09:36, Iñaki Baz C. wrote:

Hi, I’ve detected a bug in HTTPClient when receiving a 304 with no
Content-Length.

Did you file a bug?

$ gem list -d httpclient

*** LOCAL GEMS ***

httpclient (2.1.5.2)
Author: NAKAMURA, Hiroshi
Homepage: http://dev.ctor.org/httpclient
Installed at: /Library/Ruby/Gems/1.8

 gives something like the functionality of libwww-perl (LWP) in Ruby

It seems the homepage has a bug tracker…

2009/7/22 Eric H. [email protected]:

On Jul 21, 2009, at 09:36, Iñaki Baz C. wrote:

Hi, I’ve detected a bug in HTTPClient when receiving a 304 with no
Content-Length.

Did you file a bug?

Yes (as I already told in my mail):

http://dev.ctor.org/http-access2/ticket/224

Unfortunately I get no response for this report.

On Jul 22, 2009, at 01:58 , Iñaki Baz C. wrote:

http://dev.ctor.org/http-access2/ticket/224

Unfortunately I get no response for this report.

One thing I can suggest is more code/patch, less English. Sometimes
the best response you’ll get is status changes on the tickets.
Sometimes not… really depends on the author, their life, job,
relationships, phase of moon, etc.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs