Let evhttp_send_error infer the right error reasons

This commit is contained in:
Nick Mathewson 2010-05-26 12:58:02 -04:00
parent 06bd05634d
commit 39906698ca
2 changed files with 5 additions and 5 deletions

View File

@ -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;
}

2
http.c
View File

@ -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;
}