From: Amos Jeffries Date: Mon, 1 Jun 2015 21:41:37 +0000 (-0700) Subject: Rename ChunkedCodingParser to TeChunkedParser X-Git-Tag: merge-candidate-3-v1~86^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db1720f867fe9b38ec40c35ca10f8e469f2e8434;p=thirdparty%2Fsquid.git Rename ChunkedCodingParser to TeChunkedParser --- diff --git a/src/adaptation/icap/ModXact.cc b/src/adaptation/icap/ModXact.cc index d45339402f..5c51e37622 100644 --- a/src/adaptation/icap/ModXact.cc +++ b/src/adaptation/icap/ModXact.cc @@ -25,7 +25,7 @@ #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" @@ -1104,7 +1104,7 @@ void Adaptation::Icap::ModXact::decideOnParsingBody() 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 { diff --git a/src/adaptation/icap/ModXact.h b/src/adaptation/icap/ModXact.h index 56e4bc9d1a..bd86881fd9 100644 --- a/src/adaptation/icap/ModXact.h +++ b/src/adaptation/icap/ModXact.h @@ -249,7 +249,7 @@ private: 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 diff --git a/src/client_side.cc b/src/client_side.cc index 0b0d430f00..b1ec85d2a7 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -85,8 +85,8 @@ #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" @@ -4702,7 +4702,7 @@ ConnStateData::startDechunkingRequest() 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 diff --git a/src/client_side.h b/src/client_side.h index cda233eb75..cd86fa4c69 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -207,7 +207,7 @@ public: ~In(); bool maybeMakeSpaceAvailable(); - Http1::ChunkedCodingParser *bodyParser; ///< parses chunked request body + Http1::TeChunkedParser *bodyParser; ///< parses chunked request body SBuf buf; } in; diff --git a/src/http.cc b/src/http.cc index 6cf06412ad..7baec9ed5d 100644 --- a/src/http.cc +++ b/src/http.cc @@ -30,8 +30,8 @@ #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" @@ -788,7 +788,7 @@ HttpStateData::processReplyHeader() 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()) diff --git a/src/http.h b/src/http.h index 6b812838a9..afa045807f 100644 --- a/src/http.h +++ b/src/http.h @@ -120,7 +120,7 @@ private: /// 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; diff --git a/src/http/one/Makefile.am b/src/http/one/Makefile.am index 25dc303c57..33edb01dc6 100644 --- a/src/http/one/Makefile.am +++ b/src/http/one/Makefile.am @@ -11,12 +11,12 @@ include $(top_srcdir)/src/TestHeaders.am 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 diff --git a/src/http/one/ChunkedCodingParser.cc b/src/http/one/TeChunkedParser.cc similarity index 91% rename from src/http/one/ChunkedCodingParser.cc rename to src/http/one/TeChunkedParser.cc index 41d50ff10f..5fdfd7f0c5 100644 --- a/src/http/one/ChunkedCodingParser.cc +++ b/src/http/one/TeChunkedParser.cc @@ -9,13 +9,13 @@ #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); @@ -24,7 +24,7 @@ Http::One::ChunkedCodingParser::ChunkedCodingParser() } void -Http::One::ChunkedCodingParser::clear() +Http::One::TeChunkedParser::clear() { parsingStage_ = Http1::HTTP_PARSE_NONE; buf_.clear(); @@ -34,7 +34,7 @@ Http::One::ChunkedCodingParser::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. @@ -71,7 +71,7 @@ Http::One::ChunkedCodingParser::parse(const SBuf &aBuf) } bool -Http::One::ChunkedCodingParser::needsMoreSpace() const +Http::One::TeChunkedParser::needsMoreSpace() const { assert(theOut); return parsingStage_ == Http1::HTTP_PARSE_CHUNK && !theOut->hasPotentialSpace(); @@ -79,7 +79,7 @@ Http::One::ChunkedCodingParser::needsMoreSpace() const /// 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 @@ -114,7 +114,7 @@ Http::One::ChunkedCodingParser::parseChunkSize(::Parser::Tokenizer &tok) * 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(); @@ -170,7 +170,7 @@ Http::One::ChunkedCodingParser::parseChunkExtension(::Parser::Tokenizer &tok, bo } bool -Http::One::ChunkedCodingParser::parseChunkBody(::Parser::Tokenizer &tok) +Http::One::TeChunkedParser::parseChunkBody(::Parser::Tokenizer &tok) { Must(theLeftBodySize > 0); // Should, really @@ -195,7 +195,7 @@ Http::One::ChunkedCodingParser::parseChunkBody(::Parser::Tokenizer &tok) } bool -Http::One::ChunkedCodingParser::parseChunkEnd(::Parser::Tokenizer &tok) +Http::One::TeChunkedParser::parseChunkEnd(::Parser::Tokenizer &tok) { Must(theLeftBodySize == 0); // Should(), really diff --git a/src/http/one/ChunkedCodingParser.h b/src/http/one/TeChunkedParser.h similarity index 79% rename from src/http/one/ChunkedCodingParser.h rename to src/http/one/TeChunkedParser.h index 9b22dcbb85..3ce25ed3cb 100644 --- a/src/http/one/ChunkedCodingParser.h +++ b/src/http/one/TeChunkedParser.h @@ -6,8 +6,8 @@ * 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" @@ -19,7 +19,7 @@ namespace One { /** - * 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 * @@ -28,11 +28,11 @@ namespace One * 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;} @@ -61,5 +61,5 @@ public: } // namespace One } // namespace Http -#endif /* SQUID_SRC_HTTP_ONE_CHUNKEDCODINGPARSER_H */ +#endif /* SQUID_SRC_HTTP_ONE_TeChunkedParser_H */ diff --git a/src/http/one/forward.h b/src/http/one/forward.h index afb4b5b88f..678bc2c0de 100644 --- a/src/http/one/forward.h +++ b/src/http/one/forward.h @@ -17,7 +17,7 @@ namespace One { class Parser; typedef RefCount ParserPointer; -class ChunkedCodingParser; +class TeChunkedParser; class RequestParser; typedef RefCount RequestParserPointer;