cURL / Mailing Lists / curl-library / Single Mail


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

From: Kamil Dudka <>
Date: Sat, 21 Jul 2012 16:38:26 +0200

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.

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

List admin:
Received on 2012-07-21