|
|
@@ -6,6 +6,8 @@ |
|
|
|
#include "Command.hpp"
|
|
|
|
#include "ScannerPool.hpp"
|
|
|
|
|
|
|
|
#include "../SNFMulti/SNFMulti.hpp"
|
|
|
|
|
|
|
|
#include "../CodeDweller/threading.hpp"
|
|
|
|
#include "../CodeDweller/faults.hpp"
|
|
|
|
|
|
|
@@ -14,8 +16,43 @@ |
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
//// Tuning Constants //////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
const int ReadBufferSize = snf_ScanHorizon;
|
|
|
|
const int StringReserveSize = 2048;
|
|
|
|
|
|
|
|
//// Job ///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Job::emitCommentPrefix() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::emitComment(string Comment) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::emitResponsePrevix() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::emitOK() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::emitINTF() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::emitFAIL() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::emitADDHEADER(string Headers) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::emitERROR() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::emitDISCARD() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void job::finalize() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::doWakeUp() {
|
|
|
|
}
|
|
|
|
|
|
|
@@ -28,6 +65,9 @@ void Job::doFAIL() { |
|
|
|
void Job::doFILE() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::readTopOfMessage(ifstream& Reader) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::doRead() {
|
|
|
|
}
|
|
|
|
|
|
|
@@ -49,37 +89,53 @@ void Job::doReject() { |
|
|
|
void Job::doDelete() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::doHold() {
|
|
|
|
void Job::moveMessageToHoldPath(ifstream& Reader) {
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
ScannerPool& Scanners; // Knows where to get scanners.
|
|
|
|
OutputProcessor& Output;
|
|
|
|
Command CurrentCommand; // Has a current comand.
|
|
|
|
string OutputBuffer; // Preserves an output buffer.
|
|
|
|
vector<unsigned char> ReadBuffer; // Preserves a file read buffer.
|
|
|
|
unsigned int ReadLength; // How much data in the buffer.
|
|
|
|
*/
|
|
|
|
void Job::doHold() {
|
|
|
|
}
|
|
|
|
|
|
|
|
Job::Job(ScannerPool& S, OutputProcessor& O) : // Construct with important links.
|
|
|
|
Scanners(S),
|
|
|
|
Output(O),
|
|
|
|
ReadLength(0) {
|
|
|
|
ScanResultCode(0),
|
|
|
|
ReadLength(0) { // Minimize heap thrashing.
|
|
|
|
OutputBuffer.reserve(StringReserveSize);
|
|
|
|
HeadersToInject.researve(StringReserveSize);
|
|
|
|
ReadBuffer.reserve(ReadBufferSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
Job::~Job() { // Cleanup when destructing.
|
|
|
|
try { clear(); }
|
|
|
|
catch(...) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::clear() { // Cleanup for the next command.
|
|
|
|
CurrentCommand.clear();
|
|
|
|
ScanResultCode = 0;
|
|
|
|
OutputBuffer.clear();
|
|
|
|
HeadersToInject.clear();
|
|
|
|
MessageMoveFilePath.clear();
|
|
|
|
ReadBuffer.clear();
|
|
|
|
ReadLength = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::setCommand(Command& C) { // Assign a command for this job.
|
|
|
|
CurrentCommand = C;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::doIt() { // Get the job done.
|
|
|
|
switch(CurrentCommand.Type) {
|
|
|
|
case Command::WAKE: { doWakeUp(); break; }
|
|
|
|
case Command::INTF: { doINTF(); break; }
|
|
|
|
case Command::FILE: { doFILE(); break; }
|
|
|
|
default: { doFAIL(); break; }
|
|
|
|
}
|
|
|
|
finalize();
|
|
|
|
}
|
|
|
|
|
|
|
|
string& Job::Responses() { // Read the job's report.
|
|
|
|
}
|
|
|
|
|
|
|
|
void Job::clear() { // Cleanup for the next command.
|
|
|
|
return OutputBuffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
//// JobPool ///////////////////////////////////////////////////////////////////
|