#include <RemapProcessor.h>
Inherits Processor.
Public Member Functions | |
RemapProcessor () | |
~RemapProcessor () | |
bool | setup_for_remap (HttpTransact::State *s) |
Most of this comes from UrlRewrite::Remap(). | |
bool | finish_remap (HttpTransact::State *s) |
Action * | perform_remap (Continuation *cont, HttpTransact::State *s) |
int | start (int num_threads, size_t stacksize) |
Starts execution of the processor. | |
bool | LessThan (HttpTransact::State *, HttpTransact::State *) |
void | setUseSeparateThread () |
bool | using_separate_thread () |
Definition at line 43 of file RemapProcessor.h.
RemapProcessor::RemapProcessor | ( | ) | [inline] |
Definition at line 47 of file RemapProcessor.h.
RemapProcessor::~RemapProcessor | ( | ) | [inline] |
Definition at line 51 of file RemapProcessor.h.
bool RemapProcessor::finish_remap | ( | HttpTransact::State * | s | ) |
Definition at line 144 of file RemapProcessor.cc.
References referer_info::any, ats_free(), ats_strdup, ats_strndup, redirect_tag_str::chunk_str, Debug, url_mapping::default_redirect_url, MIMEHdr::field_delete(), HttpTransact::State::filter_mask, url_mapping::filter_redirect_url, url_mapping::fromURL, UrlMappingContainer::getMapping(), HttpTransact::State::hdr_info, URL::host_get(), UrlRewrite::http_default_redirect_url, is_debug_tag_set, OverridableHttpConfigParams::maintain_pristine_host_hdr, map, HTTPHdr::mark_target_dirty(), memcpy, MIME_FIELD_HOST, MIME_FIELD_REFERER, MIME_LEN_HOST, MIME_LEN_REFERER, MIME_PRESENCE_REFERER, referer_info::negative, url_mapping::negative_referer, redirect_tag_str::next, referer_info::next, url_mapping::optional_referer, UrlRewrite::PerformACLFiltering(), URL::port_get_raw(), MIMEHdr::presence(), HttpTransact::State::pristine_url, url_mapping::redir_chunk_list, url_mapping::referer_list, referer_info::regx, referer_info::regx_valid, HttpTransact::State::remap_redirect, rewrite_table, URL::string_get_buf(), URL::string_get_ref(), TS_MAX_HOST_NAME_LEN, HttpTransact::State::txn_conf, redirect_tag_str::type, HTTPHdr::url_get(), HttpTransact::State::url_map, URL_REMAP_FILTER_REDIRECT_FMT, URL_REMAP_FILTER_REFERER, MIMEHdr::value_get(), and MIMEHdr::value_set().
Referenced by HttpSM::set_next_state(), and HttpSM::state_remap_request().
bool RemapProcessor::LessThan | ( | HttpTransact::State * | , | |
HttpTransact::State * | ||||
) |
Action * RemapProcessor::perform_remap | ( | Continuation * | cont, | |
HttpTransact::State * | s | |||
) |
Definition at line 294 of file RemapProcessor.cc.
References RemapPlugins::action, ClassAllocator< C >::alloc(), Debug, Error, EVENT_REMAP_ERROR, eventProcessor, UrlMappingContainer::getMapping(), Continuation::handleEvent(), HttpTransact::State::hdr_info, HttpTransact::State::hh_info, ink_assert, map, Continuation::mutex, RemapPlugins::run_remap(), RemapPlugins::run_single_remap(), EventProcessor::schedule_imm(), SET_CONTINUATION_HANDLER, RemapPlugins::setHostHeaderInfo(), RemapPlugins::setRequestHeader(), RemapPlugins::setRequestUrl(), RemapPlugins::setState(), this_ethread(), HTTPHdr::url_get(), and HttpTransact::State::url_map.
Referenced by HttpSM::do_remap_request().
bool RemapProcessor::setup_for_remap | ( | HttpTransact::State * | s | ) |
Most of this comes from UrlRewrite::Remap().
Generally, all this does is set "map" to the appropriate entry from the global rewrite_table such that we will then have access to the correct url_mapping inside perform_remap.
Definition at line 46 of file RemapProcessor.cc.
References HttpTransact::State::client_info, Debug, Error, UrlRewrite::forward_mappings, UrlRewrite::forward_mappings_with_recv_port, UrlRewrite::forwardMappingLookup(), UrlRewrite::forwardMappingWithRecvPortLookup(), HttpTransact::State::hdr_info, HttpTransact::State::hh_info, HTTPHdr::host_get(), host_hdr_info::host_len, ink_assert, HTTPHdr::is_target_in_url(), HTTPHdr::mark_target_dirty(), UrlRewrite::nohost_rules, UrlRewrite::num_rules_forward, UrlRewrite::num_rules_forward_with_recv_port, HTTPHdr::port_get(), HttpTransact::State::remap_redirect, host_hdr_info::request_host, host_hdr_info::request_port, UrlRewrite::reverse_proxy, HttpTransact::State::reverse_proxy, rewrite_table, UrlMappingContainer::set(), HTTPHdr::set_url_target_from_host_field(), unlikely, HTTPHdr::url_get(), HttpTransact::State::url_map, and URL::valid().
Referenced by HttpSM::do_remap_request().
void RemapProcessor::setUseSeparateThread | ( | ) | [inline] |
Definition at line 59 of file RemapProcessor.h.
Referenced by main().
int RemapProcessor::start | ( | int | number_of_threads, | |
size_t | stacksize | |||
) | [virtual] |
Starts execution of the processor.
Attempts to start the number of threads specified for the processor, initializes their states and sets them running. On failure it returns a negative value.
number_of_threads | Positive value indicating the number of threads to spawn for the processor. | |
stacksize | The thread stack size to use for this processor. |
Reimplemented from Processor.
Definition at line 30 of file RemapProcessor.cc.
References eventProcessor, and EventProcessor::spawn_event_threads().
Referenced by main().
bool RemapProcessor::using_separate_thread | ( | ) | [inline] |
Definition at line 60 of file RemapProcessor.h.
Referenced by HttpSM::set_next_state().