|
|
@@ -102,7 +102,9 @@ class FilterChain { |
|
|
|
FilterChain(FilterChain* S) { |
|
|
|
if(NULL==S) throw BadSource("FilterChain: NULL source not valid"); |
|
|
|
else Source = S; |
|
|
|
} |
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~FilterChain() {} // Stop Warns about no virt dtor |
|
|
|
}; |
|
|
|
|
|
|
|
// FilterChainInput |
|
|
@@ -217,8 +219,8 @@ class FilterChainCBFR : public FilterChain { |
|
|
|
private: |
|
|
|
|
|
|
|
unsigned char* InputBuffer; |
|
|
|
int BufferIndex; |
|
|
|
int BufferLength; |
|
|
|
unsigned int BufferLength; |
|
|
|
unsigned int BufferIndex;
|
|
|
|
|
|
|
|
stringstream& PrependedHeaders; |
|
|
|
|
|
|
@@ -348,8 +350,8 @@ class FilterChainBase64 : public FilterChain { |
|
|
|
DECODING // Delivering filtered data. |
|
|
|
} State; |
|
|
|
|
|
|
|
int ScanIx; // Scanning Index. |
|
|
|
int DequeIx; // Dequeing Index. |
|
|
|
unsigned int ScanIx; // Scanning Index. |
|
|
|
unsigned int DequeIx; // Dequeing Index. |
|
|
|
unsigned char Buffer; // Define a buffer. |
|
|
|
|
|
|
|
bool ValidByte(unsigned char y); // True if y can be decoded. |
|
|
@@ -557,13 +559,13 @@ class FilterChainDefunker : public FilterChain { // Class definiti |
|
|
|
|
|
|
|
FilterChainDefunker(FilterChain* S) // Sourced constructor... |
|
|
|
:FilterChain(S), // Call the base constructor. |
|
|
|
InputPosition(0), // Reset both position pointers.
|
|
|
|
OutputPosition(0),
|
|
|
|
LastRawByte(0),
|
|
|
|
LastReadOut(0),
|
|
|
|
LastGetStore(0),
|
|
|
|
Master(&FilterChainDefunker::SkipHeaders), // Set the initial external and |
|
|
|
Internal(&FilterChainDefunker::Preamble), // internal states. |
|
|
|
InputPosition(0), // Reset both position pointers. |
|
|
|
OutputPosition(0), |
|
|
|
LastReadOut(0), |
|
|
|
LastGetStore(0), |
|
|
|
LastRawByte(0) { |
|
|
|
Internal(&FilterChainDefunker::Preamble) { // internal states. |
|
|
|
|
|
|
|
ClearQueue(); // Clear the queue; |
|
|
|
|
|
|
@@ -594,8 +596,8 @@ class FilterChainUrlDecode : public FilterChain { |
|
|
|
private: |
|
|
|
|
|
|
|
unsigned char DecodeBfr[UrlDecodeBfrSize]; // Decoded anchor buffer. |
|
|
|
int DecodeLength; // Decoded anchor length. |
|
|
|
int DecodePosition; // Read (Inject) Position. |
|
|
|
unsigned int DecodeLength; // Decoded anchor length. |
|
|
|
unsigned int DecodePosition; // Read (Inject) Position. |
|
|
|
bool DecodeFlag; // True if the URL was decoded. |
|
|
|
|
|
|
|
void Clear() { // Function to clear the bfr. |
|
|
@@ -742,6 +744,7 @@ class FilterChainHeaderAnalysis : public FilterChain { |
|
|
|
|
|
|
|
FilterChainHeaderAnalysis(FilterChain* S, FilterChainIPTester& T) : // Construct with the chain and a tester. |
|
|
|
FilterChain(S), // Capture the chain. |
|
|
|
Mode(&FilterChainHeaderAnalysis::doSeekDispatch), // Start in SeekDispatch() mode
|
|
|
|
IPTester(T), // Capture the tester. |
|
|
|
IPToTest(""), // IPToTest and |
|
|
|
IPTestResult(""), // IPTestResult are both empty to start. |
|
|
@@ -751,8 +754,7 @@ class FilterChainHeaderAnalysis : public FilterChain { |
|
|
|
FoundMessageID(false), |
|
|
|
FoundDate(false), |
|
|
|
FoundSubject(false), |
|
|
|
FoundHighBitCharacters(false), |
|
|
|
Mode(&FilterChainHeaderAnalysis::doSeekDispatch) { // Start in SeekDispatch() mode |
|
|
|
FoundHighBitCharacters(false) { |
|
|
|
} // -- first byte of a new line ;-) |
|
|
|
|
|
|
|
bool MissingFrom() { return (!FoundFrom); } // True if missing From header. |