Skip to content
Snippets Groups Projects
Commit 23a772eb authored by Håkon Dalen Hestnes's avatar Håkon Dalen Hestnes
Browse files

Added try-catch to prevent crash

parent c0bfd99e
Branches master
No related tags found
No related merge requests found
Pipeline #46723 failed
......@@ -739,12 +739,17 @@ namespace SimpleWeb {
return;
}
}
try {
if(std::stof(response->session->request->http_version) >= 1.1) {
auto new_session = std::make_shared<Session>(this->config.max_request_streambuf_size, response->session->connection);
this->read(new_session);
return;
}
}
catch(std::out_of_range) {
std::cout << "Out of range";
}
}
else if(this->on_error)
this->on_error(response->session->request, ec);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment