#include <HttpTunnel.h>
Inherits Continuation.
Definition at line 279 of file HttpTunnel.h.
HttpTunnel::HttpTunnel | ( | ) |
Definition at line 465 of file HttpTunnel.cc.
void HttpTunnel::abort_cache_write_finish_others | ( | HttpTunnelProducer * | p | ) | [inline] |
Definition at line 401 of file HttpTunnel.h.
References chain_abort_cache_write(), and local_finish_all().
Referenced by HttpSM::tunnel_handler_post_ua(), HttpSM::tunnel_handler_server(), and HttpSM::tunnel_handler_transform_read().
HttpTunnelConsumer * HttpTunnel::add_consumer | ( | VConnection * | vc, | |
VConnection * | producer, | |||
HttpConsumerHandler | sm_handler, | |||
HttpTunnelType_t | vc_type, | |||
const char * | name, | |||
int64_t | skip_bytes = 0 | |||
) |
Definition at line 670 of file HttpTunnel.cc.
References HttpTunnelConsumer::alive, HttpTunnelProducer::alive, HttpTunnelProducer::consumer_list, Debug, get_producer(), ink_release_assert, HttpTunnelConsumer::name, HttpTunnelProducer::num_consumers, HttpTunnelConsumer::producer, DLL< C, L >::push(), HttpTunnelProducer::read_success, HttpTunnelConsumer::skip_bytes, HttpSM::sm_id, HttpTunnelConsumer::vc, HttpTunnelConsumer::vc_handler, and HttpTunnelConsumer::vc_type.
Referenced by HttpSM::do_setup_post_tunnel(), HttpSM::setup_100_continue_transfer(), HttpSM::setup_blind_tunnel(), HttpSM::setup_cache_read_transfer(), HttpSM::setup_cache_transfer_to_transform(), HttpSM::setup_cache_write_transfer(), HttpSM::setup_internal_transfer(), HttpSM::setup_plugin_agents(), HttpSM::setup_server_transfer(), HttpSM::setup_server_transfer_to_transform(), HttpSM::setup_transfer_from_transform(), and HttpSM::setup_transform_to_server_transfer().
HttpTunnelProducer * HttpTunnel::add_producer | ( | VConnection * | vc, | |
int64_t | nbytes, | |||
IOBufferReader * | reader_start, | |||
HttpProducerHandler | sm_handler, | |||
HttpTunnelType_t | vc_type, | |||
const char * | name | |||
) |
Definition at line 611 of file HttpTunnel.cc.
References HttpTunnelProducer::alive, HttpTunnelProducer::buffer_start, HttpTunnelProducer::chunking_action, Debug, HttpTunnelProducer::do_chunked_passthru, HttpTunnelProducer::do_chunking, HttpTunnelProducer::do_dechunking, HTTP_TUNNEL_STATIC_PRODUCER, HttpTunnelProducer::init_bytes_done, ink_assert, IOBufferReader::mbuf, HttpTunnelProducer::name, HttpTunnelProducer::nbytes, HttpTunnelProducer::ntodo, IOBufferReader::read_avail(), HttpTunnelProducer::read_buffer, HttpTunnelProducer::read_success, HttpSM::sm_id, HttpTunnelProducer::vc, HttpTunnelProducer::vc_handler, and HttpTunnelProducer::vc_type.
Referenced by HttpSM::do_setup_post_tunnel(), HttpSM::setup_100_continue_transfer(), HttpSM::setup_blind_tunnel(), HttpSM::setup_cache_read_transfer(), HttpSM::setup_cache_transfer_to_transform(), HttpSM::setup_internal_transfer(), HttpSM::setup_push_transfer_to_cache(), HttpSM::setup_server_transfer(), HttpSM::setup_server_transfer_to_cache_only(), HttpSM::setup_server_transfer_to_transform(), HttpSM::setup_transfer_from_transform(), HttpSM::setup_transfer_from_transform_to_cache_only(), and HttpSM::setup_transform_to_server_transfer().
void HttpTunnel::allocate_redirect_postdata_buffers | ( | IOBufferReader * | ua_reader | ) |
Definition at line 1589 of file HttpTunnel.cc.
References MIOBuffer::alloc_reader(), allocate_redirect_postdata_producer_buffer(), buffer_size_to_index(), Debug, HttpTransact::State::hdr_info, new_MIOBuffer, postbuf, PostDataBuffers::postdata_copy_buffer, PostDataBuffers::postdata_copy_buffer_start, HttpSM::t_state, and PostDataBuffers::ua_buffer_reader.
void HttpTunnel::allocate_redirect_postdata_producer_buffer | ( | ) |
Definition at line 1576 of file HttpTunnel.cc.
References MIOBuffer::alloc_reader(), buffer_size_to_index(), HttpTransact::State::hdr_info, ink_release_assert, new_MIOBuffer, postbuf, PostDataBuffers::postdata_producer_buffer, PostDataBuffers::postdata_producer_reader, and HttpSM::t_state.
Referenced by allocate_redirect_postdata_buffers(), and HttpSM::tunnel_handler_for_partial_post().
void HttpTunnel::append_message_to_producer_buffer | ( | HttpTunnelProducer * | p, | |
const char * | msg, | |||
int64_t | msg_len | |||
) | [inline] |
Definition at line 499 of file HttpTunnel.h.
References HttpTunnelProducer::bytes_read, HttpTunnelProducer::nbytes, HttpTunnelProducer::read_buffer, and MIOBuffer::write().
void HttpTunnel::chain | ( | HttpTunnelConsumer * | c, | |
HttpTunnelProducer * | p | |||
) |
Mark a producer and consumer as the same underlying object.
This is use to chain producer/consumer pairs together to indicate the data flows through them sequentially. The primary example is a transform which serves as a consumer on the server side and a producer on the cache/client side.
c | Flow goes in here | |
p | Flow comes back out here |
Definition at line 704 of file HttpTunnel.cc.
References HttpTunnelProducer::flow_control_source, HttpTunnelProducer::is_throttled(), HttpTunnelConsumer::producer, HttpTunnelProducer::self_consumer, HttpTunnelConsumer::self_producer, and HttpTunnelProducer::set_throttle_src().
Referenced by HttpSM::setup_blind_tunnel(), HttpSM::setup_transfer_from_transform(), HttpSM::setup_transfer_from_transform_to_cache_only(), and HttpSM::setup_transform_to_server_transfer().
void HttpTunnel::chain_abort_all | ( | HttpTunnelProducer * | p | ) |
Definition at line 1340 of file HttpTunnel.cc.
References HttpTunnelProducer::alive, HttpTunnelConsumer::alive, HttpTunnelProducer::bytes_read, HttpTunnelProducer::consumer_list, VConnection::do_io_close(), EHTTP_ERROR, DLL< C, L >::head, VIO::ndone, HttpTunnelProducer::read_vio, HttpTunnelProducer::self_consumer, HttpTunnelConsumer::self_producer, HttpTunnelProducer::vc, HttpTunnelConsumer::vc, HttpTunnelProducer::vc_type, HttpTunnelConsumer::vc_type, and HttpTunnelConsumer::write_vio.
Referenced by kill_tunnel(), HttpSM::tunnel_handler_cache_read(), HttpSM::tunnel_handler_cache_write(), HttpSM::tunnel_handler_post_ua(), HttpSM::tunnel_handler_server(), HttpSM::tunnel_handler_transform_read(), HttpSM::tunnel_handler_transform_write(), HttpSM::tunnel_handler_ua(), and HttpSM::tunnel_handler_ua_push().
void HttpTunnel::chain_abort_cache_write | ( | HttpTunnelProducer * | p | ) |
Definition at line 1439 of file HttpTunnel.cc.
References HttpTunnelConsumer::alive, HttpTunnelProducer::consumer_list, VConnection::do_io_close(), EHTTP_ERROR, DLL< C, L >::head, HT_CACHE_WRITE, http_current_cache_connections_stat, HTTP_DECREMENT_DYN_STAT, ink_assert, HttpTunnelConsumer::self_producer, HttpTunnelConsumer::vc, HttpTunnelConsumer::vc_type, and HttpTunnelConsumer::write_vio.
Referenced by abort_cache_write_finish_others().
void HttpTunnel::chain_finish_all | ( | HttpTunnelProducer * | p | ) | [inline] |
Definition at line 425 of file HttpTunnel.h.
void HttpTunnel::close_vc | ( | HttpTunnelProducer * | p | ) |
Definition at line 1465 of file HttpTunnel.cc.
References HttpTunnelConsumer::alive, HttpTunnelProducer::alive, HttpTunnelConsumer::bytes_written, VConnection::do_io_close(), ink_assert, VIO::ndone, HttpTunnelProducer::self_consumer, HttpTunnelProducer::vc, and HttpTunnelConsumer::write_vio.
Referenced by HttpSM::tunnel_handler_ssl_consumer(), and HttpSM::tunnel_handler_ssl_producer().
void HttpTunnel::close_vc | ( | HttpTunnelConsumer * | c | ) |
Definition at line 1486 of file HttpTunnel.cc.
References HttpTunnelProducer::alive, HttpTunnelConsumer::alive, HttpTunnelProducer::bytes_read, VConnection::do_io_close(), ink_assert, VIO::ndone, HttpTunnelProducer::read_vio, HttpTunnelConsumer::self_producer, and HttpTunnelConsumer::vc.
bool HttpTunnel::consumer_handler | ( | int | event, | |
HttpTunnelConsumer * | c | |||
) |
Definition at line 1263 of file HttpTunnel.cc.
References HttpTunnelProducer::alive, HttpTunnelConsumer::alive, HttpTunnelConsumer::buffer_reader, HttpTunnelConsumer::bytes_written, consumer_reenable(), MIOBuffer::dealloc_reader(), Debug, HttpDebugNames::get_event_name(), ink_assert, ink_release_assert, HttpTunnelProducer::is_throttled(), LAZY_BUF_ALLOC, IOBufferReader::mbuf, HttpTunnelConsumer::name, VIO::ndone, HttpTunnelConsumer::producer, HttpTunnelProducer::read_buffer, HttpTunnelProducer::read_vio, VIO::reenable(), HttpSM::sm_id, VC_EVENT_ACTIVE_TIMEOUT, VC_EVENT_EOS, VC_EVENT_ERROR, VC_EVENT_INACTIVITY_TIMEOUT, VC_EVENT_READ_COMPLETE, VC_EVENT_READ_READY, VC_EVENT_WRITE_COMPLETE, VC_EVENT_WRITE_READY, HttpTunnelConsumer::vc_handler, MIOBuffer::write_avail(), and HttpTunnelConsumer::write_vio.
Referenced by main_handler().
bool HttpTunnel::consumer_reenable | ( | HttpTunnelConsumer * | c | ) |
Definition at line 1207 of file HttpTunnel.cc.
References HttpTunnelProducer::alive, HttpTunnelProducer::backlog(), Debug, HttpTunnelProducer::flow_control_source, is_debug_tag_set, HttpTunnelConsumer::is_sink(), HttpTunnelProducer::is_source(), HttpTunnelProducer::is_throttled(), LAZY_BUF_ALLOC, HttpTunnelConsumer::producer, producer_handler(), HttpTunnelProducer::read_buffer, HttpTunnelProducer::read_vio, VIO::reenable(), HttpTunnelProducer::throttle(), HttpTunnelProducer::unthrottle(), VC_EVENT_READ_READY, and MIOBuffer::write_avail().
Referenced by consumer_handler().
void HttpTunnel::copy_partial_post_data | ( | ) |
Definition at line 1565 of file HttpTunnel.cc.
References IOBufferReader::consume(), Debug, postbuf, PostDataBuffers::postdata_copy_buffer, PostDataBuffers::postdata_copy_buffer_start, IOBufferReader::read_avail(), PostDataBuffers::ua_buffer_reader, and MIOBuffer::write().
Referenced by producer_handler().
int HttpTunnel::deallocate_buffers | ( | ) |
Definition at line 550 of file HttpTunnel.cc.
References HttpTunnelProducer::buffer_start, ChunkedHandler::chunked_buffer, HttpTunnelProducer::chunked_handler, ChunkedHandler::dechunked_buffer, free_MIOBuffer(), ink_assert, ink_release_assert, ChunkedHandler::max_chunk_header_len, and HttpTunnelProducer::read_buffer.
Referenced by HttpSM::handle_post_failure(), HttpSM::handle_server_setup_error(), HttpSM::kill_this(), kill_tunnel(), HttpSM::tunnel_handler_100_continue(), HttpSM::tunnel_handler_cache_fill(), HttpSM::tunnel_handler_for_partial_post(), HttpSM::tunnel_handler_post_or_put(), and HttpSM::tunnel_handler_push().
void HttpTunnel::deallocate_redirect_postdata_buffers | ( | ) |
Definition at line 1610 of file HttpTunnel.cc.
References Debug, free_MIOBuffer(), postbuf, PostDataBuffers::postdata_copy_buffer, PostDataBuffers::postdata_copy_buffer_start, PostDataBuffers::postdata_producer_buffer, and PostDataBuffers::postdata_producer_reader.
Referenced by HttpSM::do_redirect(), HttpSM::handle_post_failure(), HttpSM::kill_this(), kill_tunnel(), producer_handler(), HttpSM::state_read_server_response_header(), HttpSM::tunnel_handler_100_continue(), HttpSM::tunnel_handler_cache_fill(), and HttpSM::tunnel_handler_push().
HttpTunnelConsumer * HttpTunnel::get_consumer | ( | VConnection * | vc | ) | [inline] |
Definition at line 466 of file HttpTunnel.h.
Referenced by HttpUpdateSM::handle_api_return(), HttpSM::handle_server_setup_error(), main_handler(), HttpSM::setup_transfer_from_transform(), HttpSM::setup_transfer_from_transform_to_cache_only(), HttpSM::setup_transform_to_server_transfer(), HttpSM::state_common_wait_for_transform_read(), HttpSM::state_watch_for_client_abort(), HttpSM::tunnel_handler_100_continue(), and HttpSM::tunnel_handler_post_or_put().
DLL<HttpTunnelConsumer>* HttpTunnel::get_consumers | ( | VConnection * | vc | ) |
HttpTunnelProducer * HttpTunnel::get_producer | ( | VConnection * | vc | ) | [inline] |
Definition at line 455 of file HttpTunnel.h.
Referenced by add_consumer(), main_handler(), HttpSM::tunnel_handler_post(), and HttpSM::tunnel_handler_push().
bool HttpTunnel::has_cache_writer | ( | ) | const [inline] |
Definition at line 510 of file HttpTunnel.h.
References HT_CACHE_WRITE.
Referenced by HttpSM::do_cache_prepare_write_transform().
void HttpTunnel::init | ( | HttpSM * | sm_arg, | |
ProxyMutex * | amutex | |||
) |
Definition at line 471 of file HttpTunnel.cc.
References OverridableHttpConfigParams::flow_control_enabled, OverridableHttpConfigParams::flow_high_water_mark, OverridableHttpConfigParams::flow_low_water_mark, HttpTransact::State::http_config_param, ink_assert, main_handler(), Continuation::mutex, HttpConfigParams::oride, SET_HANDLER, and HttpSM::t_state.
Referenced by HttpSM::start_sub_sm().
bool HttpTunnel::is_tunnel_active | ( | ) | const [inline] |
Definition at line 309 of file HttpTunnel.h.
Referenced by HttpUpdateSM::handle_api_return(), HttpSM::handle_server_setup_error(), HttpSM::kill_this(), HttpUpdateSM::set_next_state(), and HttpSM::state_watch_for_client_abort().
bool HttpTunnel::is_tunnel_alive | ( | ) | const [inline] |
Definition at line 431 of file HttpTunnel.h.
Referenced by main_handler(), HttpSM::tunnel_handler_post_server(), and tunnel_run().
void HttpTunnel::kill_tunnel | ( | ) |
Definition at line 507 of file HttpTunnel.cc.
References chain_abort_all(), deallocate_buffers(), deallocate_redirect_postdata_buffers(), ink_assert, and reset().
Referenced by HttpSM::state_common_wait_for_transform_read(), and HttpSM::state_watch_for_client_abort().
void HttpTunnel::local_finish_all | ( | HttpTunnelProducer * | p | ) | [inline] |
Definition at line 413 of file HttpTunnel.h.
Referenced by abort_cache_write_finish_others(), HttpSM::tunnel_handler_cache_read(), HttpSM::tunnel_handler_post_ua(), HttpSM::tunnel_handler_server(), HttpSM::tunnel_handler_ssl_consumer(), HttpSM::tunnel_handler_ssl_producer(), and HttpSM::tunnel_handler_transform_read().
int HttpTunnel::main_handler | ( | int | event, | |
void * | data | |||
) |
Definition at line 1508 of file HttpTunnel.cc.
References consumer_handler(), get_consumer(), get_producer(), Continuation::handleEvent(), HTTP_SM_MAGIC_ALIVE, HTTP_TUNNEL_EVENT_DONE, ink_assert, is_tunnel_alive(), HttpSM::magic, producer_handler(), and HttpTunnelConsumer::write_vio.
Referenced by init().
bool HttpTunnel::producer_handler | ( | int | event, | |
HttpTunnelProducer * | p | |||
) |
Definition at line 1076 of file HttpTunnel.cc.
References HttpTunnelConsumer::alive, HttpTunnelProducer::alive, HttpTunnelProducer::bytes_read, HttpTunnelProducer::consumer_list, copy_partial_post_data(), deallocate_redirect_postdata_buffers(), Debug, HttpTunnelProducer::do_chunked_passthru, HttpTunnelProducer::do_chunking, HttpTunnelProducer::do_dechunking, HttpSM::enable_redirection, HttpDebugNames::get_event_name(), DLL< C, L >::head, HT_HTTP_CLIENT, HTTP_TUNNEL_EVENT_CONSUMER_DETACH, HTTP_TUNNEL_EVENT_PRECOMPLETE, HTTP_WKSIDX_POST, ink_assert, ink_release_assert, HttpTunnelProducer::last_event, HttpConfig::m_master, HttpTransact::State::method, HttpTunnelProducer::name, VIO::ndone, HttpConfigParams::post_copy_size, postbuf, PostDataBuffers::postdata_copy_buffer_start, producer_handler_chunked(), producer_handler_dechunked(), IOBufferReader::read_avail(), HttpTunnelProducer::read_vio, VIO::reenable(), HttpTunnelProducer::self_consumer, HttpSM::sm_id, HttpSM::t_state, PostDataBuffers::ua_buffer_reader, VC_EVENT_ACTIVE_TIMEOUT, VC_EVENT_EOS, VC_EVENT_ERROR, VC_EVENT_INACTIVITY_TIMEOUT, VC_EVENT_READ_COMPLETE, VC_EVENT_READ_READY, VC_EVENT_WRITE_COMPLETE, VC_EVENT_WRITE_READY, HttpTunnelProducer::vc_handler, HttpTunnelProducer::vc_type, and HttpTunnelConsumer::write_vio.
Referenced by consumer_reenable(), main_handler(), HttpSM::tunnel_handler_plugin_agent(), and HttpSM::tunnel_handler_transform_write().
int HttpTunnel::producer_handler_chunked | ( | int | event, | |
HttpTunnelProducer * | p | |||
) |
Definition at line 1015 of file HttpTunnel.cc.
References ChunkedHandler::CHUNK_READ_ERROR, HttpTunnelProducer::chunked_handler, Debug, HttpTunnelProducer::do_chunked_passthru, HttpTunnelProducer::do_dechunking, HttpDebugNames::get_event_name(), HTTP_TUNNEL_EVENT_PRECOMPLETE, ink_assert, HttpTunnelProducer::last_event, ChunkedHandler::last_server_event, HttpTunnelProducer::name, ChunkedHandler::process_chunked_content(), HttpSM::sm_id, ChunkedHandler::state, ChunkedHandler::truncation, VC_EVENT_EOS, VC_EVENT_READ_COMPLETE, and VC_EVENT_READ_READY.
Referenced by producer_handler().
int HttpTunnel::producer_handler_dechunked | ( | int | event, | |
HttpTunnelProducer * | p | |||
) |
Definition at line 984 of file HttpTunnel.cc.
References HttpTunnelProducer::chunked_handler, Debug, HttpTunnelProducer::do_chunking, ChunkedHandler::generate_chunked_content(), HttpDebugNames::get_event_name(), HTTP_TUNNEL_EVENT_PRECOMPLETE, ink_assert, HttpTunnelProducer::last_event, ChunkedHandler::last_server_event, HttpTunnelProducer::name, HttpSM::sm_id, VC_EVENT_EOS, VC_EVENT_READ_COMPLETE, and VC_EVENT_READ_READY.
Referenced by producer_handler().
void HttpTunnel::reset | ( | ) |
Definition at line 488 of file HttpTunnel.cc.
References ink_assert.
Referenced by HttpSM::handle_post_failure(), HttpSM::handle_server_setup_error(), kill_tunnel(), HttpSM::tunnel_handler_100_continue(), HttpSM::tunnel_handler_cache_fill(), HttpSM::tunnel_handler_for_partial_post(), HttpSM::tunnel_handler_post_or_put(), and HttpSM::tunnel_handler_push().
void HttpTunnel::set_producer_chunking_action | ( | HttpTunnelProducer * | p, | |
int64_t | skip_bytes, | |||
TunnelChunkingAction_t | action | |||
) |
Definition at line 582 of file HttpTunnel.cc.
References ChunkedHandler::CHUNK_READ_SIZE, ChunkedHandler::CHUNK_WRITE_CHUNK, HttpTunnelProducer::chunked_handler, HttpTunnelProducer::chunking_action, ChunkedHandler::skip_bytes, ChunkedHandler::state, TCA_CHUNK_CONTENT, TCA_DECHUNK_CONTENT, and TCA_PASSTHRU_CHUNKED_CONTENT.
Referenced by HttpSM::do_setup_post_tunnel(), HttpSM::setup_cache_read_transfer(), HttpSM::setup_server_transfer(), HttpSM::setup_server_transfer_to_cache_only(), HttpSM::setup_server_transfer_to_transform(), and HttpSM::setup_transfer_from_transform().
void HttpTunnel::set_producer_chunking_size | ( | HttpTunnelProducer * | producer, | |
int64_t | size | |||
) |
Set the maximum (preferred) chunk size of chunked output for producer.
Definition at line 601 of file HttpTunnel.cc.
References HttpTunnelProducer::chunked_handler, and ChunkedHandler::set_max_chunk_size().
Referenced by HttpSM::setup_cache_read_transfer(), HttpSM::setup_server_transfer(), HttpSM::setup_server_transfer_to_cache_only(), and HttpSM::setup_transfer_from_transform().
void HttpTunnel::tunnel_run | ( | HttpTunnelProducer * | p = NULL |
) |
Definition at line 718 of file HttpTunnel.cc.
References Debug, Continuation::handleEvent(), HTTP_TUNNEL_EVENT_DONE, ink_assert, is_tunnel_alive(), and HttpTunnelProducer::vc.
Referenced by HttpSM::do_setup_post_tunnel(), HttpUpdateSM::handle_api_return(), HttpSM::handle_api_return(), HttpSM::set_next_state(), HttpSM::setup_100_continue_transfer(), HttpSM::setup_blind_tunnel(), HttpSM::setup_internal_transfer(), HttpSM::setup_transform_to_server_transfer(), and HttpSM::tunnel_handler_cache_fill().
friend class CoreUtils [friend] |
Definition at line 282 of file HttpTunnel.h.
friend class HttpPagesHandler [friend] |
Definition at line 281 of file HttpTunnel.h.
Definition at line 392 of file HttpTunnel.h.
Referenced by allocate_redirect_postdata_buffers(), allocate_redirect_postdata_producer_buffer(), copy_partial_post_data(), deallocate_redirect_postdata_buffers(), HttpSM::do_setup_post_tunnel(), and producer_handler().