cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] http: print reason phrase from HTTP status line on error

From: Fabian Keil <freebsd-listen_at_fabiankeil.de>
Date: Sat, 21 Jul 2012 20:05:11 +0200

Kamil Dudka <kdudka_at_redhat.com> wrote:

> On Saturday, July 21, 2012 12:51:10 Fabian Keil wrote:
> > Maybe there should be a:
> >
> > if(!end)
> > end = strchr(start, '\n');
> >
> > here, to deal with the minority of servers that terminate
> > headers with a single LF. It would be consistent with other
> > parts of libcurl, for example copy_header_value().
>
> Thank you for looking at the patch! I am not convinced that we should be
> trying to get the reason phrase from a non-compliant HTTP server. In that
> case, fallback to printing just the status code feels like fair response
> to me. Otherwise we could end up printing non-printable characters to the
> error buffer.

That could happen either way.

I agree that dealing with LF terminators isn't particularly important,
though. I mainly suggested it because doing it is easy and it's already
done elsewhere.

> Are you aware of any publicly available HTTTP server that would exercise
> the code path above? This would need some testing I guess...

I can't name any out of my head. I'd expect that some still exist,
but given that pretty much no client requires the proper header
termination they don't really stand out.

Fabian

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2012-07-21