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

Method check_chunked

src/proxy/FetchSM.cc:225–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225bool
226FetchSM::check_chunked()
227{
228 static const char CHUNKED_TEXT[] = "chunked";
229 static size_t const CHUNKED_LEN = sizeof(CHUNKED_TEXT) - 1;
230
231 if (resp_is_chunked < 0) {
232 resp_is_chunked = static_cast<int>(
233 this->check_for_field_value(MIME_FIELD_TRANSFER_ENCODING, MIME_LEN_TRANSFER_ENCODING, CHUNKED_TEXT, CHUNKED_LEN));
234
235 if (resp_is_chunked && (fetch_flags & TS_FETCH_FLAGS_DECHUNK)) {
236 ChunkedHandler *ch = &chunked_handler;
237 ch->init_by_action(resp_reader, ChunkedHandler::ACTION_DECHUNK, HttpTunnel::DROP_CHUNKED_TRAILERS,
238 HttpTunnel::PARSE_CHUNK_STRICTLY);
239 ch->dechunked_reader = ch->dechunked_buffer->alloc_reader();
240 ch->state = ChunkedHandler::CHUNK_READ_SIZE;
241 resp_reader->dealloc();
242 }
243 }
244 return resp_is_chunked > 0;
245}
246
247bool
248FetchSM::check_connection_close()

Callers

nothing calls this directly

Calls 4

check_for_field_valueMethod · 0.95
init_by_actionMethod · 0.80
alloc_readerMethod · 0.80
deallocMethod · 0.45

Tested by

no test coverage detected