libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] HTTP error status string incorrect


From: Eivind Sarto
Subject: [libmicrohttpd] HTTP error status string incorrect
Date: Tue, 12 Jul 2011 13:57:08 -0400

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]