Skip to content

Commit

Permalink
git-svn-id: svn://cherokee-project.com/cherokee/trunk@2053 5dc97367-9…
Browse files Browse the repository at this point in the history
…7f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed Sep 24, 2008
1 parent 1b7d2f6 commit e52151f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,5 +1,9 @@
2008-09-24 Alvaro Lopez Ortega <alvaro@alobbs.com>

* cherokee/handler_common.c (cherokee_handler_common_new): Reply
the the right HTTP error (415 Unsupported Media Type) when trying
to server a special file (not a file, nor a directory).

* cherokee/main.c (set_signals): SIGUSR2 management was missing.

* cherokee/handler_dbslayer.c (send_query): From now on, the MySQL
Expand Down
5 changes: 2 additions & 3 deletions cherokee/handler_common.c
Expand Up @@ -358,10 +358,9 @@ cherokee_handler_common_new (cherokee_handler_t **hdl, void *cnt, cherokee_modul

/* Unknown request type
*/
TRACE(ENTRIES, "Returns conn->error_code: %s\n", "http_internal_error");
conn->error_code = http_internal_error;
TRACE(ENTRIES, "Returns conn->error_code: %s\n", "http_unsupported_media_type");

SHOULDNT_HAPPEN;
conn->error_code = http_unsupported_media_type;
return ret_error;
}

Expand Down
2 changes: 2 additions & 0 deletions cherokee/http.c
Expand Up @@ -119,6 +119,7 @@ cherokee_http_code_to_string (cherokee_http_t code, const char **str)
case http_method_not_allowed: *str = http_method_not_allowed_string; break;
case http_length_required: *str = http_length_required_string; break;
case http_request_entity_too_large: *str = http_request_entity_too_large_string; break;
case http_unsupported_media_type: *str = http_unsupported_media_type_string; break;
case http_request_uri_too_long: *str = http_request_uri_too_long_string; break;
case http_range_not_satisfiable: *str = http_range_not_satisfiable_string; break;
case http_upgrade_required: *str = http_upgrade_required_string; break;
Expand Down Expand Up @@ -179,6 +180,7 @@ cherokee_http_code_copy (cherokee_http_t code, cherokee_buffer_t *buf)
entry_code (length_required);
entry_code (request_entity_too_large);
entry_code (request_uri_too_long);
entry_code (unsupported_media_type);
entry_code (range_not_satisfiable);
entry_code (upgrade_required);

Expand Down
2 changes: 2 additions & 0 deletions cherokee/http.h
Expand Up @@ -101,6 +101,7 @@ typedef enum {
http_length_required = 411,
http_request_entity_too_large = 413,
http_request_uri_too_long = 414,
http_unsupported_media_type = 415,
http_range_not_satisfiable = 416,
http_upgrade_required = 426,
http_internal_error = 500,
Expand Down Expand Up @@ -129,6 +130,7 @@ typedef enum {
#define http_length_required_string "411 Length Required"
#define http_request_entity_too_large_string "413 Request Entity too large"
#define http_request_uri_too_long_string "414 Request-URI too long"
#define http_unsupported_media_type_string "415 Unsupported Media Type"
#define http_range_not_satisfiable_string "416 Requested range not satisfiable"
#define http_upgrade_required_string "426 Upgrade Required"
#define http_internal_error_string "500 Internal Server Error"
Expand Down

0 comments on commit e52151f

Please sign in to comment.