Fix logger never called when write_content_with_provider returns false (#549)

This commit is contained in:
Ilya Tsybulsky 2020-07-02 00:09:43 +03:00 committed by GitHub
parent bad6b2d22f
commit 887def9490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3908,13 +3908,14 @@ inline bool Server::write_response(Stream &strm, bool close_connection,
strm.write(data.data(), data.size());
// Body
auto ret = true;
if (req.method != "HEAD") {
if (!res.body.empty()) {
if (!strm.write(res.body)) { return false; }
if (!strm.write(res.body)) { ret = false; }
} else if (res.content_provider_) {
if (!write_content_with_provider(strm, req, res, boundary,
content_type)) {
return false;
ret = false;
}
}
}
@ -3922,7 +3923,7 @@ inline bool Server::write_response(Stream &strm, bool close_connection,
// Log
if (logger_) { logger_(req, res); }
return true;
return ret;
}
inline bool