diff options
author | Chris Wilson <chris+github@qwirx.com> | 2006-10-18 19:44:20 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2006-10-18 19:44:20 +0000 |
commit | 598b7bd0699b46b91a2e445338f389a14d4773e8 (patch) | |
tree | 1414b9b16d53cf982c2c3420695978537b033ea5 /lib/server | |
parent | 646f1f96f80dd16dbd83b21fbe8fcbc9db451c4e (diff) |
Reinstate ifdefs around code that should be disabled on Win32 (fake fork()
seems to be a bad idea).
Comment spelling fixes. (refs #3)
Diffstat (limited to 'lib/server')
-rw-r--r-- | lib/server/ServerStream.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/server/ServerStream.h b/lib/server/ServerStream.h index 67890d83..49479039 100644 --- a/lib/server/ServerStream.h +++ b/lib/server/ServerStream.h @@ -60,7 +60,7 @@ public: virtual void Run() { - // Set process title as appropraite + // Set process title as appropriate SetProcessTitle(ForkToHandleRequests?"server":"idle"); // Handle exceptions and child task quitting gracefully. @@ -217,7 +217,8 @@ public: if(connection.get()) { // Since this is a template parameter, the if() will be optimised out by the compiler - if(WillForkToHandleRequests()) + #ifndef WIN32 // no fork on Win32 + if(ForkToHandleRequests) { pid_t pid = ::fork(); switch(pid) @@ -257,18 +258,22 @@ public: } else { + #endif // !WIN32 // Just handle in this connection SetProcessTitle("handling"); HandleConnection(*connection); SetProcessTitle("idle"); + #ifndef WIN32 } + #endif // !WIN32 } } OnIdle(); + #ifndef WIN32 // Clean up child processes (if forking daemon) - if(WillForkToHandleRequests()) + if(ForkToHandleRequests) { int status = 0; int p = 0; @@ -281,6 +286,7 @@ public: } } while(p > 0); } + #endif // !WIN32 } } catch(...) @@ -301,7 +307,7 @@ public: virtual void Connection(StreamType &rStream) = 0; protected: - // For checking code in dervied classes -- use if you have an algorithm which + // For checking code in derived classes -- use if you have an algorithm which // depends on the forking model in case someone changes it later. bool WillForkToHandleRequests() { |