nghttpd: Use util::utos instead of slow util::to_str
This commit is contained in:
parent
20ffe2b2a0
commit
d0271a90b5
|
@ -613,7 +613,7 @@ int Http2Handler::submit_file_response(const std::string& status,
|
||||||
nghttp2_data_provider *data_prd)
|
nghttp2_data_provider *data_prd)
|
||||||
{
|
{
|
||||||
std::string date_str = util::http_date(time(0));
|
std::string date_str = util::http_date(time(0));
|
||||||
std::string content_length = util::to_str(file_length);
|
std::string content_length = util::utos(file_length);
|
||||||
std::string last_modified_str;
|
std::string last_modified_str;
|
||||||
auto nva = std::vector<nghttp2_nv>{
|
auto nva = std::vector<nghttp2_nv>{
|
||||||
http2::make_nv_ls(":status", status),
|
http2::make_nv_ls(":status", status),
|
||||||
|
|
|
@ -212,14 +212,6 @@ std::string http_date(time_t t);
|
||||||
|
|
||||||
time_t parse_http_date(const std::string& s);
|
time_t parse_http_date(const std::string& s);
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
std::string to_str(T value)
|
|
||||||
{
|
|
||||||
std::stringstream ss;
|
|
||||||
ss << value;
|
|
||||||
return ss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename InputIterator1, typename InputIterator2>
|
template<typename InputIterator1, typename InputIterator2>
|
||||||
bool startsWith
|
bool startsWith
|
||||||
(InputIterator1 first1,
|
(InputIterator1 first1,
|
||||||
|
|
Loading…
Reference in New Issue