|
|
@@ -211,11 +211,11 @@ void snf_Reloader::myTask() { |
|
|
|
const ThreadType snf_Reloader::Type("snf_Reloader"); // The thread's type. |
|
|
|
|
|
|
|
snf_Reloader::snf_Reloader(snf_RulebaseHandler& R) : // When we are created, we |
|
|
|
Thread(snf_Reloader::Type, "Reloader"), // brand and name our thread, |
|
|
|
RulebaseGetterIsTurnedOn(false), // rulebase getter is off at first, |
|
|
|
RulebaseGetter("RulebaseGetter"), // setup our ScriptCaller thread, |
|
|
|
MyRulebase(R), // capture the rulebase handler. |
|
|
|
TimeToStop(false) { // It's not time to stop yet. |
|
|
|
Thread(snf_Reloader::Type, "Reloader"), // brand and name our thread. |
|
|
|
MyRulebase(R), // Capture the rulebase handler.
|
|
|
|
TimeToStop(false), // It's not time to stop yet.
|
|
|
|
RulebaseGetter("RulebaseGetter"), // Setup our ScriptCaller thread. |
|
|
|
RulebaseGetterIsTurnedOn(false) { // Rulebase getter is off at first.
|
|
|
|
captureFileStats(); // Set up the initial stats. |
|
|
|
captureGetterConfig(); // Set up RulebaseGetter config. |
|
|
|
run(); // Run our maintenenace thread. |
|
|
@@ -285,9 +285,9 @@ string FileUTC(string FileName) { |
|
|
|
struct tm FileNameTime; // Allocate a time structure. |
|
|
|
FileNameTime = *(gmtime(&FileNameStat.st_mtime)); // Copy the file time to it as UTC. |
|
|
|
|
|
|
|
char TimestampBfr[20]; // Timestamp buffer. |
|
|
|
char TimestampBfr[20]; // Timestamp buffer. |
|
|
|
|
|
|
|
sprintf(TimestampBfr,"%04d%02d%02d%02d%02d%02d\0", // Format yyyymmddhhmmss |
|
|
|
sprintf(TimestampBfr,"%04d%02d%02d%02d%02d%02d", // Format yyyymmddhhmmss |
|
|
|
FileNameTime.tm_year+1900, |
|
|
|
FileNameTime.tm_mon+1, |
|
|
|
FileNameTime.tm_mday, |
|
|
@@ -587,7 +587,7 @@ void snf_RulebaseHandler::grab(snfCFGPacket& CP) { |
|
|
|
|
|
|
|
void snf_RulebaseHandler::drop(snfCFGPacket& CP) { // Deactiveate this Rulebase. |
|
|
|
const TokenMatrix* t = CP.MyTokenMatrix; // Grab the token matrix pointer. |
|
|
|
CP.MyCFGData == NULL; // Null the configuration pointer. |
|
|
|
CP.MyCFGData = NULL; // Null the configuration pointer. |
|
|
|
ScopeMutex HoldStillPlease(MyMutex); // Lock the rulebase until we're done. |
|
|
|
if(t==Rulebase) { // If we're dropping the current rulebase |
|
|
|
CurrentCount--; // then reduce the current count. |
|
|
@@ -1019,7 +1019,7 @@ int snf_EngineHandler::scanMessageFile( |
|
|
|
// *nix like systems if the software and/or scripting involved isn't |
|
|
|
// quite up to spec. We are reading a file, after all. |
|
|
|
|
|
|
|
int ipt = 0; // Insert search point. |
|
|
|
unsigned int ipt = 0; // Insert search point. |
|
|
|
|
|
|
|
if(MessageBuffer.size() != MyScanData.ScanSize) { // If our scanner skipped data at |
|
|
|
ipt = MessageBuffer.size() - MyScanData.ScanSize; // the top of the message buffer then |
|
|
@@ -1715,7 +1715,7 @@ int snf_EngineHandler::scanMessage( |
|
|
|
break; // That's all. |
|
|
|
} |
|
|
|
|
|
|
|
case New: { |
|
|
|
case New: {
|
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
@@ -1785,6 +1785,11 @@ int snf_EngineHandler::scanMessage( |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
}
|
|
|
|
|
|
|
|
case Unknown: // Unknown - most likely we couldn't
|
|
|
|
default: { // find a usable source.
|
|
|
|
break; // Do nothing.
|
|
|
|
} |
|
|
|
} |
|
|
|
} // End of IP source depended work (GBUdbOverrides) |