#include "comm.h"
#include "comm/Connection.h"
#include "err_detail_type.h"
-#include "http/one/ChunkedCodingParser.h"
+#include "http/one/TeChunkedParser.h"
#include "HttpHeaderTools.h"
#include "HttpMsg.h"
#include "HttpReply.h"
debugs(93, 5, HERE << "expecting a body");
state.parsing = State::psBody;
replyHttpBodySize = 0;
- bodyParser = new Http1::ChunkedCodingParser;
+ bodyParser = new Http1::TeChunkedParser;
makeAdaptedBodyPipe("adapted response from the ICAP server");
Must(state.sending == State::sendingAdapted);
} else {
uint64_t virginConsumed; // virgin data consumed so far
Preview preview; // use for creating (writing) the preview
- Http1::ChunkedCodingParser *bodyParser; // ICAP response body parser
+ Http1::TeChunkedParser *bodyParser; // ICAP response body parser
bool canStartBypass; // enables bypass of transaction failures
bool protectGroupBypass; // protects ServiceGroup-wide bypass of failures
#include "helper.h"
#include "helper/Reply.h"
#include "http.h"
-#include "http/one/ChunkedCodingParser.h"
#include "http/one/RequestParser.h"
+#include "http/one/TeChunkedParser.h"
#include "HttpHdrContRange.h"
#include "HttpHeaderTools.h"
#include "HttpReply.h"
Must(bodyPipe != NULL);
debugs(33, 5, HERE << "start dechunking" << bodyPipe->status());
assert(!in.bodyParser);
- in.bodyParser = new Http1::ChunkedCodingParser;
+ in.bodyParser = new Http1::TeChunkedParser;
}
/// put parsed content into input buffer and clean up
~In();
bool maybeMakeSpaceAvailable();
- Http1::ChunkedCodingParser *bodyParser; ///< parses chunked request body
+ Http1::TeChunkedParser *bodyParser; ///< parses chunked request body
SBuf buf;
} in;
#include "fde.h"
#include "globals.h"
#include "http.h"
-#include "http/one/ChunkedCodingParser.h"
#include "http/one/ResponseParser.h"
+#include "http/one/TeChunkedParser.h"
#include "HttpControlMsg.h"
#include "HttpHdrCc.h"
#include "HttpHdrContRange.h"
flags.chunked = false;
if (newrep->sline.protocol == AnyP::PROTO_HTTP && newrep->header.chunked()) {
flags.chunked = true;
- httpChunkDecoder = new Http1::ChunkedCodingParser;
+ httpChunkDecoder = new Http1::TeChunkedParser;
}
if (!peerSupportsConnectionPinning())
/// Parser being used at present to parse the HTTP/ICY server response.
Http1::ResponseParserPointer hp;
- Http1::ChunkedCodingParser *httpChunkDecoder;
+ Http1::TeChunkedParser *httpChunkDecoder;
/// amount of message payload/body received so far.
int64_t payloadSeen;
noinst_LTLIBRARIES = libhttp1.la
libhttp1_la_SOURCES = \
- ChunkedCodingParser.cc \
- ChunkedCodingParser.h \
forward.h \
Parser.cc \
Parser.h \
RequestParser.cc \
RequestParser.h \
ResponseParser.cc \
- ResponseParser.h
+ ResponseParser.h \
+ TeChunkedParser.cc \
+ TeChunkedParser.h
#include "squid.h"
#include "base/TextException.h"
#include "Debug.h"
-#include "http/one/ChunkedCodingParser.h"
+#include "http/one/TeChunkedParser.h"
#include "http/ProtocolVersion.h"
#include "MemBuf.h"
#include "parser/Tokenizer.h"
#include "Parsing.h"
-Http::One::ChunkedCodingParser::ChunkedCodingParser()
+Http::One::TeChunkedParser::TeChunkedParser()
{
// chunked encoding only exists in HTTP/1.1
Http1::Parser::msgProtocol_ = Http::ProtocolVersion(1,1);
}
void
-Http::One::ChunkedCodingParser::clear()
+Http::One::TeChunkedParser::clear()
{
parsingStage_ = Http1::HTTP_PARSE_NONE;
buf_.clear();
}
bool
-Http::One::ChunkedCodingParser::parse(const SBuf &aBuf)
+Http::One::TeChunkedParser::parse(const SBuf &aBuf)
{
buf_ = aBuf; // sync buffers first so calls to remaining() work properly if nothing done.
}
bool
-Http::One::ChunkedCodingParser::needsMoreSpace() const
+Http::One::TeChunkedParser::needsMoreSpace() const
{
assert(theOut);
return parsingStage_ == Http1::HTTP_PARSE_CHUNK && !theOut->hasPotentialSpace();
/// RFC 7230 section 4.1 chunk-size
bool
-Http::One::ChunkedCodingParser::parseChunkSize(::Parser::Tokenizer &tok)
+Http::One::TeChunkedParser::parseChunkSize(::Parser::Tokenizer &tok)
{
Must(theChunkSize <= 0); // Should(), really
* ICAP 'use-original-body=N' extension is supported.
*/
bool
-Http::One::ChunkedCodingParser::parseChunkExtension(::Parser::Tokenizer &tok, bool skipKnown)
+Http::One::TeChunkedParser::parseChunkExtension(::Parser::Tokenizer &tok, bool skipKnown)
{
// TODO implement a proper quoted-string Tokenizer method
static const CharacterSet qString = CharacterSet("qString","\"\r\n").add('\0').complement();
}
bool
-Http::One::ChunkedCodingParser::parseChunkBody(::Parser::Tokenizer &tok)
+Http::One::TeChunkedParser::parseChunkBody(::Parser::Tokenizer &tok)
{
Must(theLeftBodySize > 0); // Should, really
}
bool
-Http::One::ChunkedCodingParser::parseChunkEnd(::Parser::Tokenizer &tok)
+Http::One::TeChunkedParser::parseChunkEnd(::Parser::Tokenizer &tok)
{
Must(theLeftBodySize == 0); // Should(), really
* Please see the COPYING and CONTRIBUTORS files for details.
*/
-#ifndef SQUID_SRC_HTTP_ONE_CHUNKEDCODINGPARSER_H
-#define SQUID_SRC_HTTP_ONE_CHUNKEDCODINGPARSER_H
+#ifndef SQUID_SRC_HTTP_ONE_TeChunkedParser_H
+#define SQUID_SRC_HTTP_ONE_TeChunkedParser_H
#include "http/one/Parser.h"
{
/**
- * ChunkedCodingParser is an incremental parser for chunked transfer coding
+ * An incremental parser for chunked transfer coding
* defined in RFC 7230 section 4.1.
* http://tools.ietf.org/html/rfc7230#section-4.1
*
* Ignores chunk extensions except for ICAP's ieof.
* Trailers are available via mimeHeader() if wanted.
*/
-class ChunkedCodingParser : public Http1::Parser
+class TeChunkedParser : public Http1::Parser
{
public:
- ChunkedCodingParser();
- virtual ~ChunkedCodingParser() {theOut=NULL;/* we dont own this object */}
+ TeChunkedParser();
+ virtual ~TeChunkedParser() {theOut=NULL;/* we dont own this object */}
/// set the buffer to be used to store decoded chunk data
void setPayloadBuffer(MemBuf *parsedContent) {theOut = parsedContent;}
} // namespace One
} // namespace Http
-#endif /* SQUID_SRC_HTTP_ONE_CHUNKEDCODINGPARSER_H */
+#endif /* SQUID_SRC_HTTP_ONE_TeChunkedParser_H */
class Parser;
typedef RefCount<Http::One::Parser> ParserPointer;
-class ChunkedCodingParser;
+class TeChunkedParser;
class RequestParser;
typedef RefCount<Http::One::RequestParser> RequestParserPointer;