Skip to content
Snippets Groups Projects

Fix issue #30

Open Torbjørn Bøe Lauvvik requested to merge torbjbla/buggy-web-server:master into master
1 file
+ 15
1
Compare changes
  • Side-by-side
  • Inline
+ 15
1
@@ -762,13 +762,27 @@ namespace SimpleWeb {
return;
}
}
/* Buggy shit
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;
*/
}
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(const std::invalid_argument &ia) {
std::cerr << "Invalid HTTP version: " << ia.what() << "\n";
}
catch(std::out_of_range &oor) {
std::cerr << "HTTP version out of range: " << oor.what() << "\n";
}
else if(this->on_error)
if(this->on_error)
this->on_error(response->session->request, ec);
});
});
Loading