summaryrefslogtreecommitdiff
path: root/lib/server
diff options
context:
space:
mode:
Diffstat (limited to 'lib/server')
-rw-r--r--lib/server/ServerStream.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/server/ServerStream.h b/lib/server/ServerStream.h
index 8dafccae..67890d83 100644
--- a/lib/server/ServerStream.h
+++ b/lib/server/ServerStream.h
@@ -56,6 +56,8 @@ public:
return "generic-stream-server";
}
+ virtual void OnIdle() { }
+
virtual void Run()
{
// Set process title as appropraite
@@ -215,7 +217,7 @@ public:
if(connection.get())
{
// Since this is a template parameter, the if() will be optimised out by the compiler
- if(ForkToHandleRequests)
+ if(WillForkToHandleRequests())
{
pid_t pid = ::fork();
switch(pid)
@@ -262,9 +264,11 @@ public:
}
}
}
-
+
+ OnIdle();
+
// Clean up child processes (if forking daemon)
- if(ForkToHandleRequests)
+ if(WillForkToHandleRequests())
{
int status = 0;
int p = 0;
@@ -301,7 +305,11 @@ protected:
// depends on the forking model in case someone changes it later.
bool WillForkToHandleRequests()
{
+ #ifdef WIN32
+ return false;
+ #else
return ForkToHandleRequests;
+ #endif // WIN32
}
private: