[go: nahoru, domu]

Skip to content

Commit

Permalink
send 503 in case of ENFILE or EMFILE
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed May 6, 2015
1 parent 350734c commit 1552b44
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/handler/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ static int on_req(h2o_handler_t *_self, h2o_req_t *req)
/* failed to open */
if (errno == ENOENT) {
h2o_send_error(req, 404, "File Not Found", "file not found", 0);
} else if (errno == ENFILE || errno == EMFILE) {
h2o_send_error(req, 503, "Service Unavailable", "please try again later", 0);
} else {
h2o_send_error(req, 403, "Access Forbidden", "access forbidden", 0);
}
Expand Down

0 comments on commit 1552b44

Please sign in to comment.