mirror of https://github.com/adamdruppe/arsd.git
a stop hack for embedded httpd threads on windows
This commit is contained in:
parent
db612a4c47
commit
680003ae87
21
cgi.d
21
cgi.d
|
@ -5521,8 +5521,25 @@ class ListeningConnectionManager {
|
||||||
return listener.accept();
|
return listener.accept();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
} else
|
} else {
|
||||||
return listener.accept(); // FIXME: check the cancel flag!
|
|
||||||
|
Socket socket = listener;
|
||||||
|
|
||||||
|
auto check = new SocketSet();
|
||||||
|
|
||||||
|
keep_looping:
|
||||||
|
check.reset();
|
||||||
|
check.add(socket);
|
||||||
|
|
||||||
|
// just to check the stop flag on a kinda busy loop. i hate this FIXME
|
||||||
|
auto got = Socket.select(check, null, null, 3.seconds);
|
||||||
|
if(got > 0)
|
||||||
|
return listener.accept();
|
||||||
|
if(globalStopFlag)
|
||||||
|
return null;
|
||||||
|
else
|
||||||
|
goto keep_looping;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int defaultNumberOfThreads() {
|
int defaultNumberOfThreads() {
|
||||||
|
|
Loading…
Reference in New Issue