remove locale dependent stof()

e.g. stof("1.1") might return 1.0 if the locale decimal delimiter is ","
This commit is contained in:
David Siroky 2017-02-14 10:16:44 +01:00 committed by eidheim
commit 50ce7510ef

View file

@ -390,16 +390,6 @@ namespace SimpleWeb {
if(timer)
timer->cancel();
if(!ec) {
float http_version;
try {
http_version=stof(request->http_version);
}
catch(const std::exception &e){
if(on_error)
on_error(request, boost::system::error_code(boost::system::errc::protocol_error, boost::system::generic_category()));
return;
}
if (response->close_connection_after_response)
return;
@ -408,7 +398,7 @@ namespace SimpleWeb {
if(boost::iequals(it->second, "close"))
return;
}
if(http_version>1.05)
if(request->http_version >= "1.1")
this->read_request_and_content(response->socket);
}
else if(on_error)