Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.6.1, 0.7
-
Any
-
Patch Available
Description
When an error occur during a HTTP request, exceptions are not captured before entering back libevent. For example a simple 'curl http://localhost:8080' will trigger a 'not enough data' exception, however no code will actually set the HTTP status (triggering a unhandled exception, and a crash).
Here is a proposed change:
void TEvhttpServer::request(struct evhttp_request* req, void* self) {
try
catch(std::exception& e)
{ evhttp_send_reply(req, HTTP_INTERNAL, e.what(), 0); }}