vector<hypercache::para> hypercache::delayedParaAdd;
vector<hypercache::para> hypercache::delayedParaSet;
string hypercache::activeCFile = "";
-vector<string> hypercache::parentConfigs;
+vector<unsigned long> hypercache::parentConfigs;
writeout *hypercache::out = NULL;
void hypercache::initCache(configcache **cache,
}
void hypercache::writeO() {
- if ( activeCFile != "" )
- O->writeHeader("concurrent_cfile", activeCFile.c_str(), (activeCFile.length()+1)*sizeof(char));
+ if ( activeCFile != "" ) {
+ unsigned long afilehash = configcache::hash(activeCFile);
+ O->writeHeader("concurrent_cfile", (char*)(&afilehash), sizeof(unsigned long));
+ }
O->writeConfig();
}
bool readret;
if ( readret = O->readConfig() ) {
- char *parentconfig = (char*)O->getHeader("concurrent_cfile");
+ unsigned long *parentconfig = (unsigned long*)O->getHeader("concurrent_cfile");
if ( parentconfig != NULL )
addParentConfig(parentconfig);
}
return readret;
}
-void hypercache::addParentConfig(const char* parentconfig) {
- for (vector<string>::iterator parit = parentConfigs.begin(); parit != parentConfigs.end(); ++parit)
- if ( *parit == parentconfig )
+void hypercache::addParentConfig(const unsigned long *parentconfig) {
+ for (vector<unsigned long>::iterator parit = parentConfigs.begin(); parit != parentConfigs.end(); ++parit)
+ if ( *parit == *parentconfig )
return;
- parentConfigs.push_back(parentconfig);
+ parentConfigs.push_back(*parentconfig);
}