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) if(timer)
timer->cancel(); timer->cancel();
if(!ec) { 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) if (response->close_connection_after_response)
return; return;
@ -408,7 +398,7 @@ namespace SimpleWeb {
if(boost::iequals(it->second, "close")) if(boost::iequals(it->second, "close"))
return; return;
} }
if(http_version>1.05) if(request->http_version >= "1.1")
this->read_request_and_content(response->socket); this->read_request_and_content(response->socket);
} }
else if(on_error) else if(on_error)