[Box Backup-dev] COMMIT r705 - box/chris/general/lib/server

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Thu, 27 Jul 2006 22:28:22 +0000 (GMT)


Author: chris
Date: 2006-07-27 22:28:21 +0000 (Thu, 27 Jul 2006)
New Revision: 705

Modified:
   box/chris/general/lib/server/ServerStream.h
Log:
* ServerStream.h
- Don't define the OnIdle() method except under Windows
- Cosmetic indenting fixes


Modified: box/chris/general/lib/server/ServerStream.h
===================================================================
--- box/chris/general/lib/server/ServerStream.h	2006-07-27 22:27:33 UTC (rev 704)
+++ box/chris/general/lib/server/ServerStream.h	2006-07-27 22:28:21 UTC (rev 705)
@@ -56,7 +56,9 @@
 		return "generic-stream-server";
 	}
 
+	#ifdef WIN32
 	virtual void OnIdle() { }
+	#endif
 
 	virtual void Run()
 	{
@@ -217,7 +219,7 @@
 					if(connection.get())
 					{
 						// Since this is a template parameter, the if() will be optimised out by the compiler
-#ifndef WIN32 // no fork on Win32
+						#ifndef WIN32 // no fork on Win32
 						if(ForkToHandleRequests)
 						{
 							pid_t pid = ::fork();
@@ -258,20 +260,20 @@
 						}
 						else
 						{
-#endif // !WIN32
+						#endif // !WIN32
 							// Just handle in this connection
 							SetProcessTitle("handling");
 							HandleConnection(*connection);
 							SetProcessTitle("idle");										
-#ifndef WIN32
+						#ifndef WIN32
 						}
-#endif // !WIN32
+						#endif // !WIN32
 					}
 				}
 
-#ifdef WIN32
+				#ifdef WIN32
 				OnIdle();
-#else // !WIN32
+				#else // !WIN32
 				// Clean up child processes (if forking daemon)
 				if(ForkToHandleRequests)
 				{
@@ -286,7 +288,7 @@
 						}
 					} while(p > 0);
 				}
-#endif // !WIN32
+				#endif // !WIN32
 			}
 		}
 		catch(...)
@@ -311,11 +313,11 @@
 	// depends on the forking model in case someone changes it later.
 	bool WillForkToHandleRequests()
 	{
-#ifdef WIN32
+		#ifdef WIN32
 		return false;
-#else
+		#else
 		return ForkToHandleRequests;
-#endif // WIN32
+		#endif // WIN32
 	}
 
 private: