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

Function compress_transform_init

plugins/compress/compress.cc:339–365  ·  view source on GitHub ↗

FIXME: some things are potentially compressible. those responses

Source from the content-addressed store, hash-verified

337
338// FIXME: some things are potentially compressible. those responses
339static void
340compress_transform_init(TSCont contp, Data *data)
341{
342 // update the vary, content-encoding, and etag response headers
343 // prepare the downstream for transforming
344
345 TSVConn downstream_conn;
346 TSMBuffer bufp;
347 TSMLoc hdr_loc;
348
349 data->state = transform_state_output;
350
351 if (TSHttpTxnTransformRespGet(data->txn, &bufp, &hdr_loc) != TS_SUCCESS) {
352 error("Error TSHttpTxnTransformRespGet");
353 return;
354 }
355
356 if (content_encoding_header(bufp, hdr_loc, data->compression_type, data->compression_algorithms) == TS_SUCCESS &&
357 etag_header(bufp, hdr_loc) == TS_SUCCESS) {
358 downstream_conn = TSTransformOutputVConnGet(contp);
359 data->downstream_buffer = TSIOBufferCreate();
360 data->downstream_reader = TSIOBufferReaderAlloc(data->downstream_buffer);
361 data->downstream_vio = TSVConnWrite(downstream_conn, contp, data->downstream_reader, INT64_MAX);
362 }
363
364 TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
365}
366
367static void
368gzip_transform_one(Data *data, const char *upstream_buffer, int64_t upstream_length)

Callers 1

compress_transform_doFunction · 0.85

Calls 9

errorFunction · 0.85
content_encoding_headerFunction · 0.85
etag_headerFunction · 0.85
TSIOBufferCreateFunction · 0.85
TSIOBufferReaderAllocFunction · 0.85
TSVConnWriteFunction · 0.85
TSHandleMLocReleaseFunction · 0.85

Tested by

no test coverage detected