MCPcopy Create free account
hub / github.com/apache/trafficserver / init_by_action

Method init_by_action

src/proxy/http/HttpTunnel.cc:78–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void
79ChunkedHandler::init_by_action(IOBufferReader *buffer_in, Action action, bool drop_chunked_trailers, bool parse_chunk_strictly)
80{
81 running_sum = 0;
82 num_digits = 0;
83 cur_chunk_size = 0;
84 cur_chunk_bytes_left = 0;
85 truncation = false;
86 this->action = action;
87 this->strict_chunk_parsing = parse_chunk_strictly;
88
89 switch (action) {
90 case ACTION_DOCHUNK:
91 dechunked_reader = buffer_in->mbuf->clone_reader(buffer_in);
92 dechunked_reader->mbuf->water_mark = min_block_transfer_bytes;
93 chunked_buffer = new_MIOBuffer(CHUNK_IOBUFFER_SIZE_INDEX);
94 chunked_size = 0;
95 break;
96 case ACTION_DECHUNK:
97 chunked_reader = buffer_in->mbuf->clone_reader(buffer_in);
98 dechunked_buffer = new_MIOBuffer(BUFFER_SIZE_INDEX_256);
99 dechunked_size = 0;
100 break;
101 case ACTION_PASSTHRU:
102 chunked_reader = buffer_in->mbuf->clone_reader(buffer_in);
103 if (drop_chunked_trailers) {
104 // Note that dropping chunked trailers only applies in the passthrough
105 // case in which we are filtering out chunked trailers as we proxy.
106 this->drop_chunked_trailers = drop_chunked_trailers;
107
108 // We only need an intermediate buffer when modifying the chunks by
109 // filtering out the trailers. Otherwise, a simple passthrough needs no
110 // intermediary buffer as consumers will simply read directly from
111 // chunked_reader.
112 chunked_buffer = new_MIOBuffer(CHUNK_IOBUFFER_SIZE_INDEX);
113 chunked_size = 0;
114 }
115 break;
116 default:
117 ink_release_assert(!"Unknown action");
118 }
119
120 return;
121}
122
123void
124ChunkedHandler::clear()

Callers 1

check_chunkedMethod · 0.80

Calls 1

clone_readerMethod · 0.80

Tested by

no test coverage detected