mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-15 23:35:02 -04:00
Let evhttp_send_error infer the right error reasons
This commit is contained in:
parent
06bd05634d
commit
39906698ca
8
evrpc.c
8
evrpc.c
@ -324,7 +324,7 @@ evrpc_request_cb(struct evhttp_request *req, void *arg)
|
|||||||
error:
|
error:
|
||||||
if (rpc_state != NULL)
|
if (rpc_state != NULL)
|
||||||
evrpc_reqstate_free(rpc_state);
|
evrpc_reqstate_free(rpc_state);
|
||||||
evhttp_send_error(req, HTTP_SERVUNAVAIL, "Service Error");
|
evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ evrpc_request_cb_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
|
|||||||
error:
|
error:
|
||||||
if (rpc_state != NULL)
|
if (rpc_state != NULL)
|
||||||
evrpc_reqstate_free(rpc_state);
|
evrpc_reqstate_free(rpc_state);
|
||||||
evhttp_send_error(req, HTTP_SERVUNAVAIL, "Service Error");
|
evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,7 +440,7 @@ evrpc_request_done(struct evrpc_req_generic *rpc_state)
|
|||||||
error:
|
error:
|
||||||
if (rpc_state != NULL)
|
if (rpc_state != NULL)
|
||||||
evrpc_reqstate_free(rpc_state);
|
evrpc_reqstate_free(rpc_state);
|
||||||
evhttp_send_error(req, HTTP_SERVUNAVAIL, "Service Error");
|
evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
|
|||||||
error:
|
error:
|
||||||
if (rpc_state != NULL)
|
if (rpc_state != NULL)
|
||||||
evrpc_reqstate_free(rpc_state);
|
evrpc_reqstate_free(rpc_state);
|
||||||
evhttp_send_error(req, HTTP_SERVUNAVAIL, "Service Error");
|
evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
http.c
2
http.c
@ -2520,7 +2520,7 @@ evhttp_handle_request(struct evhttp_request *req, void *arg)
|
|||||||
req->userdone = 0;
|
req->userdone = 0;
|
||||||
|
|
||||||
if (req->uri == NULL) {
|
if (req->uri == NULL) {
|
||||||
evhttp_send_error(req, HTTP_BADREQUEST, "Bad Request");
|
evhttp_send_error(req, HTTP_BADREQUEST, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user