/// the remaining unprocessed section of buffer
const SBuf &remaining() const {return buf_;}
+#if USE_HTTP_VIOLATIONS
+ /// the right debugs() level for parsing HTTP violation messages
+ int violationLevel() const;
+#endif
+
/**
* HTTP status code resulting from the parse process.
* to be used on the invalid message handling.
#include "http/ProtocolVersion.h"
#include "MemBuf.h"
#include "Parsing.h"
+#include "SquidConfig.h"
Http::One::TeChunkedParser::TeChunkedParser()
{
theChunkSize = theLeftBodySize = size;
debugs(94,7, "found chunk: " << theChunkSize);
+
+#if USE_HTTP_VIOLATIONS
+ // Bug 4492: IBM_HTTP_Server pads out to 4 bytes with SP characters
+ if (Config.onoff.relaxed_header_parser && tok.skipAll(CharacterSet::SP)) {
+ debugs(94, violationLevel(), "WARNING: skipped invalid whitespace in chunk size");
+ }
+#endif
+
buf_ = tok.remaining(); // parse checkpoint
parsingStage_ = Http1::HTTP_PARSE_CHUNK_EXT;
return true;