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

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