Skip to content

Commit a8bceca

Browse files
committed
Fix performance problem on Windows
1 parent 318a3fe commit a8bceca

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

httplib.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#endif
4848

4949
#ifndef CPPHTTPLIB_KEEPALIVE_TIMEOUT_CHECK_INTERVAL_USECOND
50-
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_CHECK_INTERVAL_USECOND 10000
50+
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_CHECK_INTERVAL_USECOND 0
5151
#endif
5252

5353
#ifndef CPPHTTPLIB_KEEPALIVE_MAX_COUNT
@@ -7993,18 +7993,14 @@ inline bool Server::listen_internal() {
79937993
std::unique_ptr<TaskQueue> task_queue(new_task_queue());
79947994

79957995
while (svr_sock_ != INVALID_SOCKET) {
7996-
#ifndef _WIN32
79977996
if (idle_interval_sec_ > 0 || idle_interval_usec_ > 0) {
7998-
#endif
79997997
auto val = detail::select_read(svr_sock_, idle_interval_sec_,
80007998
idle_interval_usec_);
80017999
if (val == 0) { // Timeout
80028000
task_queue->on_idle();
80038001
continue;
80048002
}
8005-
#ifndef _WIN32
80068003
}
8007-
#endif
80088004

80098005
#if defined _WIN32
80108006
// sockets connected via WASAccept inherit flags NO_HANDLE_INHERIT,

0 commit comments

Comments
 (0)