Skip to content

Commit e1dfc99

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

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

httplib.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,8 @@
103103
#endif
104104

105105
#ifndef CPPHTTPLIB_IDLE_INTERVAL_USECOND
106-
#ifdef _WIN32
107-
#define CPPHTTPLIB_IDLE_INTERVAL_USECOND 1000
108-
#else
109106
#define CPPHTTPLIB_IDLE_INTERVAL_USECOND 0
110107
#endif
111-
#endif
112108

113109
#ifndef CPPHTTPLIB_REQUEST_URI_MAX_LENGTH
114110
#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH 8192
@@ -7993,18 +7989,14 @@ inline bool Server::listen_internal() {
79937989
std::unique_ptr<TaskQueue> task_queue(new_task_queue());
79947990

79957991
while (svr_sock_ != INVALID_SOCKET) {
7996-
#ifndef _WIN32
79977992
if (idle_interval_sec_ > 0 || idle_interval_usec_ > 0) {
7998-
#endif
79997993
auto val = detail::select_read(svr_sock_, idle_interval_sec_,
80007994
idle_interval_usec_);
80017995
if (val == 0) { // Timeout
80027996
task_queue->on_idle();
80037997
continue;
80047998
}
8005-
#ifndef _WIN32
80067999
}
8007-
#endif
80088000

80098001
#if defined _WIN32
80108002
// sockets connected via WASAccept inherit flags NO_HANDLE_INHERIT,

0 commit comments

Comments
 (0)