mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Code format
This commit is contained in:
parent
969cccd52a
commit
6b22409217
11
httplib.h
11
httplib.h
@ -1860,10 +1860,9 @@ inline bool keep_alive(socket_t sock) {
|
|||||||
} else if (val == 0) {
|
} else if (val == 0) {
|
||||||
auto current = steady_clock::now();
|
auto current = steady_clock::now();
|
||||||
auto duration = duration_cast<milliseconds>(current - start);
|
auto duration = duration_cast<milliseconds>(current - start);
|
||||||
auto timeout = CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND * 100 + CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND;
|
auto timeout = CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND * 100 +
|
||||||
if (duration.count() > timeout) {
|
CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND;
|
||||||
return false;
|
if (duration.count() > timeout) { return false; }
|
||||||
}
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
@ -2841,9 +2840,7 @@ public:
|
|||||||
auto pattern = dash_ + boundary_ + crlf_;
|
auto pattern = dash_ + boundary_ + crlf_;
|
||||||
if (pattern.size() > buf_.size()) { return true; }
|
if (pattern.size() > buf_.size()) { return true; }
|
||||||
auto pos = buf_.find(pattern);
|
auto pos = buf_.find(pattern);
|
||||||
if (pos != 0) {
|
if (pos != 0) { return false; }
|
||||||
return false;
|
|
||||||
}
|
|
||||||
buf_.erase(0, pattern.size());
|
buf_.erase(0, pattern.size());
|
||||||
off_ += pattern.size();
|
off_ += pattern.size();
|
||||||
state_ = 1;
|
state_ = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user