From: Nick Mathewson Date: Wed, 26 May 2010 16:58:02 +0000 (-0400) Subject: Let evhttp_send_error infer the right error reasons X-Git-Tag: release-2.0.6-rc~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39906698ca5db840495af1b68923ae6bd12ae1dd;p=libevent Let evhttp_send_error infer the right error reasons --- diff --git a/evrpc.c b/evrpc.c index 43f4dcb5..8765316d 100644 --- a/evrpc.c +++ b/evrpc.c @@ -324,7 +324,7 @@ evrpc_request_cb(struct evhttp_request *req, void *arg) error: if (rpc_state != NULL) evrpc_reqstate_free(rpc_state); - evhttp_send_error(req, HTTP_SERVUNAVAIL, "Service Error"); + evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL); return; } @@ -363,7 +363,7 @@ evrpc_request_cb_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res) error: if (rpc_state != NULL) evrpc_reqstate_free(rpc_state); - evhttp_send_error(req, HTTP_SERVUNAVAIL, "Service Error"); + evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL); return; } @@ -440,7 +440,7 @@ evrpc_request_done(struct evrpc_req_generic *rpc_state) error: if (rpc_state != NULL) evrpc_reqstate_free(rpc_state); - evhttp_send_error(req, HTTP_SERVUNAVAIL, "Service Error"); + evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL); return; } @@ -479,7 +479,7 @@ evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res) error: if (rpc_state != NULL) evrpc_reqstate_free(rpc_state); - evhttp_send_error(req, HTTP_SERVUNAVAIL, "Service Error"); + evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL); return; } diff --git a/http.c b/http.c index 71850bb8..3f39e0bf 100644 --- a/http.c +++ b/http.c @@ -2520,7 +2520,7 @@ evhttp_handle_request(struct evhttp_request *req, void *arg) req->userdone = 0; if (req->uri == NULL) { - evhttp_send_error(req, HTTP_BADREQUEST, "Bad Request"); + evhttp_send_error(req, HTTP_BADREQUEST, NULL); return; }