Code format

This commit is contained in:
yhirose 2020-01-10 09:35:07 -05:00
parent a15d16a9de
commit 0ee9660f3d

View File

@ -2051,8 +2051,7 @@ inline bool parse_range_header(const std::string &s, Ranges &ranges) {
auto pos = m.position(1); auto pos = m.position(1);
auto len = m.length(1); auto len = m.length(1);
bool all_valid_ranges = true; bool all_valid_ranges = true;
split( split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
if (!all_valid_ranges) return; if (!all_valid_ranges) return;
static auto re_another_range = std::regex(R"(\s*(\d*)-(\d*))"); static auto re_another_range = std::regex(R"(\s*(\d*)-(\d*))");
std::cmatch m; std::cmatch m;
@ -2380,8 +2379,7 @@ inline bool write_multipart_ranges_data(Stream &strm, const Request &req,
[&](const std::string &token) { strm.write(token); }, [&](const std::string &token) { strm.write(token); },
[&](const char *token) { strm.write(token); }, [&](const char *token) { strm.write(token); },
[&](size_t offset, size_t length) { [&](size_t offset, size_t length) {
return write_content(strm, res.content_provider, offset, return write_content(strm, res.content_provider, offset, length) >= 0;
length) >= 0;
}); });
} }
@ -3079,8 +3077,11 @@ Server::write_content_with_provider(Stream &strm, const Request &req,
} }
} }
} else { } else {
auto is_shutting_down = [this]() { return this->svr_sock_ == INVALID_SOCKET; }; auto is_shutting_down = [this]() {
if (detail::write_content_chunked(strm, res.content_provider, is_shutting_down) < 0) { return this->svr_sock_ == INVALID_SOCKET;
};
if (detail::write_content_chunked(strm, res.content_provider,
is_shutting_down) < 0) {
return false; return false;
} }
} }