#include "Debug.h"
#include "http/one/Parser.h"
#include "parser/Tokenizer.h"
+#include "SquidConfig.h"
/// RFC 7230 section 2.6 - 7 magic octets
const SBuf Http::One::Parser::Http1magic("HTTP/1.");
mimeHeaderBlock_.clear();
}
+bool
+Http::One::Parser::skipLineTerminator(::Parser::Tokenizer &tok) const
+{
+ static const SBuf crlf("\r\n");
+ if (tok.skip(crlf))
+ return true;
+
+ if (Config.onoff.relaxed_header_parser && tok.skipOne(CharacterSet::LF))
+ return true;
+
+ return false;
+}
+
// arbitrary maximum-length for headers which can be found by Http1Parser::getHeaderField()
#define GET_HDR_SZ 1024
#include "http/one/forward.h"
#include "SBuf.h"
+namespace Parser {
+class Tokenizer;
+}
+
namespace Http {
namespace One {
const SBuf &remaining() const {return buf_;}
protected:
+ /// detect and skip the CRLF or (if tolerant) LF line terminator
+ /// consume from the tokenizer and return true only if found
+ bool skipLineTerminator(::Parser::Tokenizer &tok) const;
+
/// RFC 7230 section 2.6 - 7 magic octets
static const SBuf Http1magic;
}
}
-/// detect and skip the CRLF or LF line terminator
-/// consume from the tokenizer and return true only if found
-bool
-Http::One::RequestParser::skipLineTerminator(::Parser::Tokenizer &tok) const
-{
- static const SBuf crlf("\r\n");
- if (tok.skip(crlf))
- return true;
-
- if (Config.onoff.relaxed_header_parser && tok.skipOne(CharacterSet::LF))
- return true;
-
- return false;
-}
-
/**
* Attempt to parse the method field out of an HTTP message request-line.
*
int parseMethodField(::Parser::Tokenizer &, const CharacterSet &);
int parseUriField(::Parser::Tokenizer &, const CharacterSet &);
int parseHttpVersionField(::Parser::Tokenizer &);
- bool skipLineTerminator(::Parser::Tokenizer &) const;
/// what request method has been found on the first line
HttpRequestMethod method_;