cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: handling of unknown 1xx http codes

From: Phil Blundell <pb_at_reciva.com>
Date: Sat, 28 Jun 2008 09:16:55 +0100

On Fri, 2008-06-27 at 22:06 -0700, Dan Fandrich wrote:
> On Fri, Jun 27, 2008 at 12:00:35AM +0100, Phil Blundell wrote:
> > I've never seen it in the wild; I noticed this while testing our
> > application against a proprietary testsuite.
> >
> > I guess I didn't make it very clear in my original mail that the current
> > behaviour of curl is to leave the connection hung if it encounters any
> > code between 101 and 199 inclusive. For all codes between 102 and 199,
> > there odesn't seem to be any ambiguity: either possible reading of the
> > RFC would indicate that you should treat them like 100.
>
> That's an unacceptable response by default.

Why so? RFC 2616 is fairly explicit:

"A client MUST be prepared to accept one or more 1xx status responses
prior to a regular response, even if the client does not expect a 100
(Continue) status message. Unexpected 1xx status responses MAY be
ignored by a user agent."

and

"HTTP applications are not required to understand the meaning of all
registered status codes, though such understanding is obviously
desirable. However, applications MUST understand the class of any status
code, as indicated by the first digit, and treat any unrecognized
response as being equivalent to the x00 status code of that class, with
the exception that an unrecognized response MUST NOT be cached."

Both of these statements seem like a clear indication that the expected
behaviour is to ignore (i.e. treat like "100 continue") an unrecognised
1xx result code.

p.
Received on 2008-06-28