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

Method setup_cache_transfer_to_transform

src/proxy/http/HttpSM.cc:6846–6875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6844}
6845
6846HttpTunnelProducer *
6847HttpSM::setup_cache_transfer_to_transform()
6848{
6849 int64_t alloc_index;
6850 int64_t doc_size;
6851
6852 ink_assert(cache_sm.cache_read_vc != nullptr);
6853 ink_assert(transform_info.vc != nullptr);
6854 ink_assert(transform_info.entry->vc == transform_info.vc);
6855
6856 // grab this here
6857 cache_response_hdr_bytes = t_state.hdr_info.cache_response.length_get();
6858
6859 doc_size = t_state.cache_info.object_read->object_size_get();
6860 alloc_index = buffer_size_to_index(doc_size, t_state.http_config_param->max_payload_iobuf_index);
6861 MIOBuffer *buf = new_MIOBuffer(alloc_index);
6862 IOBufferReader *buf_start = buf->alloc_reader();
6863
6864 HTTP_SM_SET_DEFAULT_HANDLER(&HttpSM::state_response_wait_for_transform_read);
6865
6866 HttpTunnelProducer *p = tunnel.add_producer(cache_sm.cache_read_vc, doc_size, buf_start, &HttpSM::tunnel_handler_cache_read,
6867 HT_CACHE_READ, "cache read");
6868
6869 tunnel.add_consumer(transform_info.vc, cache_sm.cache_read_vc, &HttpSM::tunnel_handler_transform_write, HT_TRANSFORM,
6870 "transform write");
6871 transform_info.entry->in_tunnel = true;
6872 cache_sm.cache_read_vc = nullptr;
6873
6874 return p;
6875}
6876
6877void
6878HttpSM::setup_cache_write_transfer(HttpCacheSM *c_sm, VConnection *source_vc, HTTPInfo *store_info, int64_t skip_bytes,

Callers

nothing calls this directly

Calls 6

buffer_size_to_indexFunction · 0.85
object_size_getMethod · 0.80
alloc_readerMethod · 0.80
add_producerMethod · 0.80
add_consumerMethod · 0.80
length_getMethod · 0.45

Tested by

no test coverage detected