From 39906698ca5db840495af1b68923ae6bd12ae1dd Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 26 May 2010 12:58:02 -0400 Subject: [PATCH] Let evhttp_send_error infer the right error reasons --- evrpc.c | 8 ++++---- http.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.40.0