| 7163 | } |
| 7164 | |
| 7165 | HttpTunnelProducer * |
| 7166 | HttpSM::setup_transfer_from_transform() |
| 7167 | { |
| 7168 | int64_t alloc_index = find_server_buffer_size(); |
| 7169 | |
| 7170 | // TODO change this call to new_empty_MIOBuffer() |
| 7171 | MIOBuffer *buf = new_MIOBuffer(alloc_index); |
| 7172 | buf->water_mark = static_cast<int>(t_state.txn_conf->default_buffer_water_mark); |
| 7173 | IOBufferReader *buf_start = buf->alloc_reader(); |
| 7174 | |
| 7175 | HttpTunnelConsumer *c = tunnel.get_consumer(transform_info.vc); |
| 7176 | ink_assert(c != nullptr); |
| 7177 | ink_assert(c->vc == transform_info.vc); |
| 7178 | ink_assert(c->vc_type == HT_TRANSFORM); |
| 7179 | |
| 7180 | // Now dump the header into the buffer |
| 7181 | ink_assert(t_state.hdr_info.client_response.status_get() != HTTP_STATUS_NOT_MODIFIED); |
| 7182 | client_response_hdr_bytes = write_response_header_into_buffer(&t_state.hdr_info.client_response, buf); |
| 7183 | |
| 7184 | HTTP_SM_SET_DEFAULT_HANDLER(&HttpSM::tunnel_handler); |
| 7185 | |
| 7186 | HttpTunnelProducer *p = tunnel.add_producer(transform_info.vc, INT64_MAX, buf_start, &HttpSM::tunnel_handler_transform_read, |
| 7187 | HT_TRANSFORM, "transform read"); |
| 7188 | tunnel.chain(c, p); |
| 7189 | |
| 7190 | tunnel.add_consumer(_ua.get_entry()->vc, transform_info.vc, &HttpSM::tunnel_handler_ua, HT_HTTP_CLIENT, "user agent"); |
| 7191 | |
| 7192 | transform_info.entry->in_tunnel = true; |
| 7193 | _ua.get_entry()->in_tunnel = true; |
| 7194 | |
| 7195 | this->setup_client_response_plugin_agents(p, client_response_hdr_bytes); |
| 7196 | |
| 7197 | if (t_state.client_info.receive_chunked_response) { |
| 7198 | bool const drop_chunked_trailers = t_state.http_config_param->oride.http_drop_chunked_trailers == 1; |
| 7199 | bool const parse_chunk_strictly = t_state.http_config_param->oride.http_strict_chunk_parsing == 1; |
| 7200 | tunnel.set_producer_chunking_action(p, client_response_hdr_bytes, TCA_CHUNK_CONTENT, drop_chunked_trailers, |
| 7201 | parse_chunk_strictly); |
| 7202 | tunnel.set_producer_chunking_size(p, t_state.txn_conf->http_chunking_size); |
| 7203 | } |
| 7204 | |
| 7205 | return p; |
| 7206 | } |
| 7207 | |
| 7208 | HttpTunnelProducer * |
| 7209 | HttpSM::setup_server_transfer() |
nothing calls this directly
no test coverage detected