Changeset 2262
- Timestamp:
- 21/08/2008 12:18:39 (3 months ago)
- Files:
-
- box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp (modified) (2 diffs)
- box/trunk/bin/bbstored/BackupStoreContext.cpp (modified) (1 diff)
- box/trunk/bin/bbstored/BackupStoreContext.h (modified) (3 diffs)
- box/trunk/bin/bbstored/BackupStoreDaemon.cpp (modified) (2 diffs)
- box/trunk/bin/bbstored/BackupStoreDaemon.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp
r2127 r2262 156 156 void BackupStoreDaemon::OnIdle() 157 157 { 158 #ifdef WIN32 158 if (!IsSingleProcess()) 159 { 160 return; 161 } 162 159 163 if (!mHousekeepingInited) 160 164 { … … 164 168 165 169 RunHousekeepingIfNeeded(); 166 #endif167 170 } 168 171 box/trunk/bin/bbstored/BackupStoreContext.cpp
r2226 r2262 54 54 // 55 55 // -------------------------------------------------------------------------- 56 BackupStoreContext::BackupStoreContext(int32_t ClientID, BackupStoreDaemon &rDaemon) 56 BackupStoreContext::BackupStoreContext(int32_t ClientID, 57 HousekeepingInterface &rDaemon) 57 58 : mClientID(ClientID), 58 59 mrDaemon(rDaemon), box/trunk/bin/bbstored/BackupStoreContext.h
r2226 r2262 27 27 class StreamableMemBlock; 28 28 29 class HousekeepingInterface 30 { 31 public: 32 virtual ~HousekeepingInterface() { } 33 virtual void SendMessageToHousekeepingProcess(const void *Msg, int MsgLen) = 0; 34 }; 35 29 36 // -------------------------------------------------------------------------- 30 37 // … … 38 45 { 39 46 public: 40 BackupStoreContext(int32_t ClientID, BackupStoreDaemon&rDaemon);47 BackupStoreContext(int32_t ClientID, HousekeepingInterface &rDaemon); 41 48 ~BackupStoreContext(); 42 49 private: … … 132 139 private: 133 140 int32_t mClientID; 134 BackupStoreDaemon&mrDaemon;141 HousekeepingInterface &mrDaemon; 135 142 int mProtocolPhase; 136 143 bool mClientHasAccount; box/trunk/bin/bbstored/BackupStoreDaemon.cpp
r2226 r2262 173 173 mExtendedLogging = config.GetKeyValueBool("ExtendedLogging"); 174 174 175 #ifdef WIN32 176 // Housekeeping runs synchronously on Win32 177 #else 178 // Fork off housekeeping daemon -- must only do this the first time Run() is called 179 if(!mHaveForkedHousekeeping) 175 // Fork off housekeeping daemon -- must only do this the first 176 // time Run() is called. Housekeeping runs synchronously on Win32 177 // because IsSingleProcess() is always true 178 179 #ifndef WIN32 180 if(!IsSingleProcess() && !mHaveForkedHousekeeping) 180 181 { 181 182 // Open a socket pair for communication … … 207 208 BOX_INFO("Housekeeping process started"); 208 209 // Ignore term and hup 209 // Parent will handle these and alert the child via the socket, don't want to randomly die 210 // Parent will handle these and alert the 211 // child via the socket, don't want to 212 // randomly die! 210 213 ::signal(SIGHUP, SIG_IGN); 211 214 ::signal(SIGTERM, SIG_IGN); box/trunk/bin/bbstored/BackupStoreDaemon.h
r2226 r2262 29 29 // 30 30 // -------------------------------------------------------------------------- 31 class BackupStoreDaemon : public ServerTLS<BOX_PORT_BBSTORED> 31 class BackupStoreDaemon : public ServerTLS<BOX_PORT_BBSTORED>, 32 HousekeepingInterface 32 33 { 33 34 friend class HousekeepStoreAccount;
