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

Rename argument name

This commit is contained in:
yhirose 2017-12-07 13:18:47 -05:00
parent f35f2b23fa
commit e557282641

View File

@ -727,19 +727,19 @@ bool read_content(Stream& strm, T& x, Progress progress = [](int64_t,int64_t){})
} }
template <typename T> template <typename T>
inline void write_headers(Stream& strm, const T& res) inline void write_headers(Stream& strm, const T& info)
{ {
strm.write("Connection: close\r\n"); strm.write("Connection: close\r\n");
for (const auto& x: res.headers) { for (const auto& x: info.headers) {
if (x.first != "Content-Type" && x.first != "Content-Length") { if (x.first != "Content-Type" && x.first != "Content-Length") {
socket_printf(strm, "%s: %s\r\n", x.first.c_str(), x.second.c_str()); socket_printf(strm, "%s: %s\r\n", x.first.c_str(), x.second.c_str());
} }
} }
auto t = get_header_value(res.headers, "Content-Type", "text/plain"); auto t = get_header_value(info.headers, "Content-Type", "text/plain");
socket_printf(strm, "Content-Type: %s\r\n", t); socket_printf(strm, "Content-Type: %s\r\n", t);
socket_printf(strm, "Content-Length: %ld\r\n", res.body.size()); socket_printf(strm, "Content-Length: %ld\r\n", info.body.size());
strm.write("\r\n"); strm.write("\r\n");
} }