[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] HTTP error status string incorrect
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] HTTP error status string incorrect |
Date: |
Wed, 13 Jul 2011 11:29:30 +0200 |
User-agent: |
KMail/1.13.7 (Linux/2.6.39-1-amd64; KDE/4.6.3; x86_64; ; ) |
Oops. Fixed in libmicrohttpd 0.9.13, which just got released. This is the
only significant change.
Happy hacking,
Christian
On Tuesday, July 12, 2011 07:57:08 PM Eivind Sarto wrote:
> It looks like the mapping of http error status number to string is
> incorrect. Returning a MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED maps to the
> string "Not Extended" (instead of "Bandwidth Limit Exceeded").
>
> The reason for this is that there are holes in the table lookup in
> reason_phrase.c
>
> static const char *five_hundred[] = {
> "Internal Server Error",
> "Not Implemented",
> "Bad Gateway",
> "Service Unavailable",
> "Gateway Time-out",
> "HTTP Version not supported",
> "Variant Also Negotiates",
> "Insufficient Storage",
> "Bandwidth Limit Exceeded",
> "Not Extended"
> };
>
> #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
> #define MHD_HTTP_NOT_IMPLEMENTED 501
> #define MHD_HTTP_BAD_GATEWAY 502
> #define MHD_HTTP_SERVICE_UNAVAILABLE 503
> #define MHD_HTTP_GATEWAY_TIMEOUT 504
> #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
> #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
> #define MHD_HTTP_INSUFFICIENT_STORAGE 507
> #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
> #define MHD_HTTP_NOT_EXTENDED 510
>
> There is no entry for error status 508, so any status above that is off.
>
> There are similar holes in the four_hundred[] mapping table as well.
>
> -eivind