1
0
mirror of synced 2025-04-20 11:47:43 +03:00

Code cleanup

This commit is contained in:
yhirose 2019-07-28 07:52:57 -04:00
parent f40de531ab
commit d15df874b3

View File

@ -1246,8 +1246,7 @@ template <typename T> inline int write_headers(Stream &strm, const T &info) {
return write_len; return write_len;
} }
template <typename T> template <typename T> inline int write_content(Stream &strm, const T &x) {
inline int write_content_chunked(Stream &strm, const T &x) {
auto chunked_response = !x.has_header("Content-Length"); auto chunked_response = !x.has_header("Content-Length");
uint64_t offset = 0; uint64_t offset = 0;
auto data_available = true; auto data_available = true;
@ -1831,7 +1830,7 @@ inline bool Server::write_response(Stream &strm, bool last_connection,
if (!res.body.empty()) { if (!res.body.empty()) {
if (!strm.write(res.body.c_str(), res.body.size())) { return false; } if (!strm.write(res.body.c_str(), res.body.size())) { return false; }
} else if (res.content_producer) { } else if (res.content_producer) {
if (!detail::write_content_chunked(strm, res)) { return false; } if (!detail::write_content(strm, res)) { return false; }
} }
} }