| | 299 | #if 0 |
|---|
| | 300 | typedef struct |
|---|
| | 301 | { |
|---|
| | 302 | int i_code; |
|---|
| | 303 | const char *psz_reason; |
|---|
| | 304 | } http_status_info; |
|---|
| | 305 | |
|---|
| | 306 | static const http_status_info http_reason[] = |
|---|
| | 307 | { |
|---|
| | 308 | /*{ 100, "Continue" }, |
|---|
| | 309 | { 101, "Switching Protocols" },*/ |
|---|
| | 310 | { 200, "OK" }/*, |
|---|
| | 311 | { 201, "Created" }, |
|---|
| | 312 | { 202, "Accepted" }, |
|---|
| | 313 | { 203, "Non-Authoritative Information" }, |
|---|
| | 314 | { 204, "No Content" }, |
|---|
| | 315 | { 205, "Reset Content" }, |
|---|
| | 316 | { 206, "Partial Content" }, |
|---|
| | 317 | { 250, "Low on Storage Space" }, |
|---|
| | 318 | { 300, "Multiple Choices" }*/, |
|---|
| | 319 | { 301, "Moved Permanently" }/*, |
|---|
| | 320 | { 302, "Moved Temporarily" }, - aka "Found" |
|---|
| | 321 | { 303, "See Other" }, |
|---|
| | 322 | { 304, "Not Modified" }, |
|---|
| | 323 | { 305, "Use Proxy" }, |
|---|
| | 324 | { 307, "Temporary Redirect" }, |
|---|
| | 325 | { 400, "Bad Request" }*/, |
|---|
| | 326 | { 401, "Unauthorized" }/*, |
|---|
| | 327 | { 402, "Payment Required" }*/, |
|---|
| | 328 | { 403, "Forbidden" }, |
|---|
| | 329 | { 404, "Not Found" }/*, |
|---|
| | 330 | { 405, "Method Not Allowed" }, |
|---|
| | 331 | { 406, "Not Acceptable" }, |
|---|
| | 332 | { 407, "Proxy Authentication Required" }, |
|---|
| | 333 | { 408, "Request Time-out" }, |
|---|
| | 334 | { 409, "Conflict" }, |
|---|
| | 335 | { 410, "Gone" }, |
|---|
| | 336 | { 411, "Length Required" }, |
|---|
| | 337 | { 412, "Precondition Failed" }, |
|---|
| | 338 | { 413, "Request Entity Too Large" }, |
|---|
| | 339 | { 414, "Request-URI Too Large" }, |
|---|
| | 340 | { 415, "Unsupported Media Type" }, |
|---|
| | 341 | { 416, "Requested range not satisfiable" }, |
|---|
| | 342 | { 417, "Expectation Failed" }, |
|---|
| | 343 | { 451, "Parameter Not Understood" }, |
|---|
| | 344 | { 452, "Conference Not Found" }, |
|---|
| | 345 | { 453, "Not Enough Bandwidth" }*/, |
|---|
| | 346 | { 454, "Session Not Found" }/*, |
|---|
| | 347 | { 455, "Method Not Valid in This State" }, |
|---|
| | 348 | { 456, "Header Field Not Valid for Resource" }, |
|---|
| | 349 | { 457, "Invalid Range" }, |
|---|
| | 350 | { 458, "Parameter Is Read-Only" }, |
|---|
| | 351 | { 459, "Aggregate operation not allowed" }, |
|---|
| | 352 | { 460, "Only aggregate operation allowed" }*/, |
|---|
| | 353 | { 461, "Unsupported transport" }/*, |
|---|
| | 354 | { 462, "Destination unreachable" }*/, |
|---|
| | 355 | { 500, "Internal Server Error" }, |
|---|
| | 356 | { 501, "Not Implemented" }/*, |
|---|
| | 357 | { 502, "Bad Gateway" }*/, |
|---|
| | 358 | { 503, "Service Unavailable" }/*, |
|---|
| | 359 | { 504, "Gateway Time-out" }, |
|---|
| | 360 | { 505, "Protocol version not supported" }*/, |
|---|
| | 361 | { 0, NULL } |
|---|
| | 362 | }; |
|---|
| | 363 | |
|---|
| | 364 | static const char *psz_fallback_reason[] = |
|---|
| | 365 | { "Continue", "OK", "Found", "Client Error", "Server Error" }; |
|---|
| | 366 | |
|---|
| | 367 | static const char *httpd_ReasonFromCode( int i_code ) |
|---|
| | 368 | { |
|---|
| | 369 | const http_status_info *p; |
|---|
| | 370 | |
|---|
| | 371 | for (p = http_reason; p->i_code < i_code; p++); |
|---|
| | 372 | |
|---|
| | 373 | if( p->i_code == i_code ) |
|---|
| | 374 | return p->psz_reason; |
|---|
| | 375 | |
|---|
| | 376 | assert( ( i_code >= 100 ) && ( i_code <= 599 ) ); |
|---|
| | 377 | return psz_fallback_reason[(i_code / 100) - 1]; |
|---|
| | 378 | } |
|---|
| | 379 | #endif |
|---|
| | 380 | |
|---|