A brief file description. More...
#include "libts.h"
#include <strings.h>
#include <math.h>
#include "HttpTransact.h"
#include "HttpTransactHeaders.h"
#include "HttpSM.h"
#include "HttpCacheSM.h"
#include "HttpDebugNames.h"
#include "time.h"
#include "ParseRules.h"
#include "HTTP.h"
#include "HdrUtils.h"
#include "MimeTable.h"
#include "logging/Log.h"
#include "logging/LogUtils.h"
#include "Error.h"
#include "CacheControl.h"
#include "ControlMatcher.h"
#include "ReverseProxy.h"
#include "HttpBodyFactory.h"
#include "StatPages.h"
#include "HttpClientSession.h"
#include "I_Machine.h"
Go to the source code of this file.
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file HttpTransact.cc.
#define DebugTxn | ( | tag, | ||
... | ||||
) | DebugSpecific((s->state_machine->debug_on), tag, __VA_ARGS__) |
Definition at line 66 of file HttpTransact.cc.
Referenced by HttpTransact::add_client_ip_to_outgoing_request(), HttpTransact::add_new_stat_block(), HttpTransact::BadRequest(), HttpTransact::build_redirect_response(), HttpTransact::build_request(), HttpTransact::build_response_from_cache(), HttpTransact::calculate_document_freshness_limit(), HttpTransact::calculate_freshness_fuzz(), HttpTransact::check_request_validity(), HttpTransact::check_response_validity(), HttpTransact::client_result_stat(), HttpTransact::DecideCacheLookup(), HttpTransact::delete_all_document_alternates_and_return(), HttpTransact::delete_server_rr_entry(), HttpTransact::EndRemapRequest(), find_server_and_update_current_info(), HttpTransact::handle_cache_operation_on_forward_server_response(), HttpTransact::handle_content_length_header(), HttpTransact::handle_forward_server_connection_open(), HttpTransact::handle_no_cache_operation_on_forward_server_response(), HttpTransact::handle_response_from_icp_suggested_host(), HttpTransact::handle_response_from_parent(), HttpTransact::handle_response_from_server(), HttpTransact::handle_response_keep_alive_headers(), HttpTransact::handle_server_connection_not_open(), HttpTransact::handle_server_died(), HttpTransact::handle_trace_and_options_requests(), HttpTransact::handle_upgrade_request(), HttpTransact::handle_websocket_connection(), HttpTransact::handle_websocket_upgrade_post_remap(), HttpTransact::handle_websocket_upgrade_pre_remap(), HttpTransact::HandleApiErrorJump(), HttpTransact::HandleBlindTunnel(), HttpTransact::HandleCacheOpenRead(), HttpTransact::HandleCacheOpenReadHit(), HttpTransact::HandleCacheOpenReadHitFreshness(), HttpTransact::HandleCacheOpenReadMiss(), HttpTransact::HandleFiltering(), HttpTransact::HandleICPLookup(), HttpTransact::HandleRequest(), HttpTransact::HandleResponse(), how_to_open_connection(), HttpTransact::initialize_state_variables_from_request(), HttpTransact::initialize_state_variables_from_response(), HttpTransact::is_request_valid(), HttpTransact::is_response_cacheable(), HttpTransact::is_response_valid(), HttpTransact::is_stale_cache_response_returnable(), HttpTransact::issue_revalidate(), HttpTransact::ModifyRequest(), HttpTransact::need_to_revalidate(), HttpTransact::OriginServerRawOpen(), HttpTransact::OSDNSLookup(), HttpTransact::perform_accept_encoding_filtering(), HttpTransact::PerformRemap(), HttpTransact::PPDNSLookup(), HttpTransact::ReDNSRoundRobin(), HttpTransact::retry_server_connection_not_open(), HttpTransact::StartRemapRequest(), HttpTransact::what_is_document_freshness(), and HttpTransact::will_this_request_self_loop().
#define HTTP_INCREMENT_TRANS_STAT | ( | X | ) | update_stat(s, X, 1); |
Definition at line 53 of file HttpTransact.cc.
Referenced by HttpTransact::build_request(), HttpTransact::check_request_validity(), HttpTransact::client_result_stat(), HttpTransact::DecideCacheLookup(), HttpTransact::EndRemapRequest(), HttpTransact::handle_cache_operation_on_forward_server_response(), HttpTransact::handle_server_connection_not_open(), HttpTransact::handle_trace_and_options_requests(), HttpTransact::HandleICPLookup(), HttpTransact::HandleRequest(), HttpTransact::HandleResponse(), HttpTransact::histogram_request_document_size(), HttpTransact::histogram_response_document_size(), HttpTransact::initialize_state_variables_from_request(), HttpTransact::origin_server_connection_speed(), HttpTransact::setup_plugin_request_intercept(), HttpTransact::update_size_and_time_stats(), and HttpTransact::user_agent_connection_speed().
#define HTTP_SUM_TRANS_STAT | ( | X, | ||
S | ||||
) | update_stat(s, X, (ink_statval_t) S); |
Definition at line 54 of file HttpTransact.cc.
Referenced by HttpTransact::client_result_stat(), and HttpTransact::update_size_and_time_stats().
#define RANGE_NUMBERS_LENGTH 60 |
Definition at line 51 of file HttpTransact.cc.
#define TRANSACT_REMEMBER | ( | _s, | ||
_e, | ||||
_d | ||||
) |
{ \ HttpSM *sm = (_s)->state_machine; \ sm->history[sm->history_pos % HISTORY_SIZE].file = __FILE__; \ sm->history[sm->history_pos % HISTORY_SIZE].line = __LINE__; \ sm->history[sm->history_pos % HISTORY_SIZE].event = _e; \ sm->history[sm->history_pos % HISTORY_SIZE].data = (void *)_d; \ sm->history_pos += 1; \ }
Definition at line 56 of file HttpTransact.cc.
static bool do_cookies_prevent_caching | ( | int | cookies_conf, | |
HTTPHdr * | request, | |||
HTTPHdr * | response, | |||
HTTPHdr * | cached_request = NULL | |||
) | [inline, static] |
Definition at line 377 of file HttpTransact.cc.
References HTTP_VALUE_PUBLIC, ink_assert, HTTPHdr::is_cache_control_set(), MIME_FIELD_CONTENT_TYPE, MIME_LEN_CONTENT_TYPE, MIME_PRESENCE_COOKIE, MIME_PRESENCE_SET_COOKIE, MIMEHdr::presence(), HTTPHdr::type_get(), and MIMEHdr::value_get().
Referenced by HttpTransact::is_cache_response_returnable(), and HttpTransact::is_response_cacheable().
static bool does_method_require_cache_copy_deletion | ( | const HttpConfigParams * | http_config_param, | |
const int | method | |||
) | [inline, static] |
Definition at line 458 of file HttpTransact.cc.
References HttpConfigParams::cache_post_method, HTTP_WKSIDX_DELETE, HTTP_WKSIDX_GET, HTTP_WKSIDX_POST, HTTP_WKSIDX_PURGE, and HTTP_WKSIDX_PUT.
Referenced by HttpTransact::HandleCacheOpenReadMiss(), and HttpTransact::issue_revalidate().
static HTTPHdr* find_appropriate_cached_resp | ( | HttpTransact::State * | s | ) | [inline, static] |
Definition at line 242 of file HttpTransact.cc.
References HttpTransact::State::cache_info, ink_assert, and HTTPHdr::valid().
Referenced by HttpTransact::issue_revalidate().
static HttpTransact::LookingUp_t find_server_and_update_current_info | ( | HttpTransact::State * | s | ) | [inline, static] |
Definition at line 284 of file HttpTransact.cc.
References ParentConfigParams::apiParentExists(), HttpTransact::State::arena, ats_is_ip(), ParentRecord::bypass_ok(), HttpTransact::State::current, DebugTxn, HttpConfigParams::disable_ssl_parenting, HttpTransact::State::dns_info, ParentConfigParams::findParent(), HttpTransact::State::hdr_info, ParentResult::hostname, HttpTransact::State::http_config_param, HTTP_WKSIDX_CONNECT, ink_assert, HttpTransact::is_request_cache_lookupable(), local_host_ip_str, HttpTransact::State::method, HttpTransact::State::next_hop_scheme, ParentConfigParams::nextParent(), HttpConfigParams::no_dns_forward_to_parent, HttpTransact::ORIGIN_SERVER, PARENT_DIRECT, PARENT_FAIL, HttpTransact::State::parent_info, HttpTransact::State::parent_params, HttpTransact::PARENT_PROXY, HttpTransact::State::parent_result, PARENT_SPECIFIED, PARENT_UNDEFINED, ParentResult::port, ptr_len_cmp(), ParentResult::r, ParentResult::rec, HttpTransact::State::request_data, HttpTransact::State::scheme, URL::scheme_get_wksidx(), HttpTransact::State::server_info, Arena::str_store(), HttpConfigParams::uncacheable_requests_bypass_parent, update_current_info(), update_dns_info(), URL_WKSIDX_HTTP, and URL_WKSIDX_HTTPS.
Referenced by HttpTransact::handle_response_from_icp_suggested_host(), HttpTransact::handle_response_from_parent(), HttpTransact::HandleCacheOpenReadHit(), HttpTransact::HandleCacheOpenReadMiss(), HttpTransact::HandleICPLookup(), HttpTransact::LookupSkipOpenServer(), and HttpTransact::PPDNSLookup().
void forceLinkRegressionHttpTransact | ( | ) |
Definition at line 28 of file RegressionHttpTransact.cc.
Referenced by forceLinkRegressionHttpTransactCaller().
void forceLinkRegressionHttpTransactCaller | ( | ) |
Definition at line 8839 of file HttpTransact.cc.
References forceLinkRegressionHttpTransact().
static HttpTransact::StateMachineAction_t how_to_open_connection | ( | HttpTransact::State * | s | ) | [inline, static] |
Definition at line 469 of file HttpTransact.cc.
References HttpTransact::State::already_downgraded, ats_free(), HttpTransact::State::cache_info, HttpTransact::CACHE_PREPARE_TO_DELETE, HttpTransact::CACHE_PREPARE_TO_UPDATE, HttpTransact::CACHE_PREPARE_TO_WRITE, HttpTransact::State::cdn_remap_complete, HttpTransact::State::cdn_saved_next_action, HttpTransactHeaders::convert_request(), HttpTransact::State::current, DebugTxn, HttpTransact::State::hdr_info, URL::host_get(), HTTP_WKSIDX_CONNECT, HttpTransact::initialize_state_variables_for_origin_server(), ink_assert, is_debug_tag_set, memcpy, HttpTransact::State::method, MIME_FIELD_HOST, MIME_LEN_HOST, MIME_PRESENCE_HOST, HttpTransact::State::next_action, HttpTransact::State::next_hop_scheme, HttpTransact::ORIGIN_SERVER, HttpTransact::State::parent_result, PARENT_SPECIFIED, HttpTransact::State::pending_work, URL::port_get(), ParentResult::r, HttpTransactHeaders::remove_host_name_from_url(), request_url_remap(), HttpTransact::State::server_info, HttpTransact::SM_ACTION_ORIGIN_SERVER_OPEN, HttpTransact::SM_ACTION_ORIGIN_SERVER_RAW_OPEN, HttpTransact::State::transact_return_point, url_canonicalize_port(), HttpTransact::URL_REMAP_FOR_OS, url_remap_mode, URL_TYPE_HTTP, and URL_WKSIDX_HTTP.
Referenced by HttpTransact::handle_cache_operation_on_forward_server_response(), HttpTransact::handle_cache_write_lock(), HttpTransact::handle_no_cache_operation_on_forward_server_response(), HttpTransact::handle_response_from_icp_suggested_host(), HttpTransact::handle_response_from_parent(), HttpTransact::handle_response_from_server(), HttpTransact::HandleCacheOpenReadHit(), HttpTransact::HandleCacheOpenReadMiss(), HttpTransact::HandleICPLookup(), HttpTransact::LookupSkipOpenServer(), HttpTransact::OSDNSLookup(), HttpTransact::PPDNSLookup(), and HttpTransact::ReDNSRoundRobin().
ink_time_t ink_cluster_time | ( | void | ) |
Definition at line 8239 of file HttpTransact.cc.
References Debug, ink_assert, ink_get_hrtime(), ink_mutex_acquire(), ink_mutex_release(), and HttpConfig::m_master.
Referenced by HttpTransact::bootstrap_state_variables_from_request(), HttpTransact::build_request(), HttpTransact::handle_cache_operation_on_forward_server_response(), HttpTransact::HandlePushResponseHdr(), HttpTransact::HandleResponse(), HttpSM::mark_host_failure(), HttpSM::process_hostdb_info(), HttpSM::process_srv_info(), and HttpTransactCache::SelectFromAlternates().
static HTTPKeepAlive is_header_keep_alive | ( | const HTTPVersion & | http_version, | |
const HTTPVersion & | request_http_version, | |||
MIMEField * | con_hdr | |||
) | [inline, static] |
Definition at line 77 of file HttpTransact.cc.
References HdrCsvIter::get_first(), HdrCsvIter::get_next(), MIMEField::has_dups(), HTTP_KEEPALIVE, HTTP_NO_KEEPALIVE, ptr_len_casecmp(), val, and MIMEField::value_get().
Referenced by HttpTransact::initialize_state_variables_from_request(), and HttpTransact::initialize_state_variables_from_response().
static bool is_negative_caching_appropriate | ( | HttpTransact::State * | s | ) | [inline, static] |
Definition at line 257 of file HttpTransact.cc.
References HttpTransact::State::hdr_info, HTTP_STATUS_BAD_GATEWAY, HTTP_STATUS_BAD_REQUEST, HTTP_STATUS_FORBIDDEN, HTTP_STATUS_GATEWAY_TIMEOUT, HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_METHOD_NOT_ALLOWED, HTTP_STATUS_NO_CONTENT, HTTP_STATUS_NOT_FOUND, HTTP_STATUS_NOT_IMPLEMENTED, HTTP_STATUS_REQUEST_URI_TOO_LONG, HTTP_STATUS_SERVICE_UNAVAILABLE, HTTP_STATUS_USE_PROXY, OverridableHttpConfigParams::negative_caching_enabled, and HttpTransact::State::txn_conf.
Referenced by HttpTransact::handle_cache_operation_on_forward_server_response().
static bool is_port_in_range | ( | int | port, | |
HttpConfigPortRange * | pr | |||
) | [inline, static] |
Definition at line 159 of file HttpTransact.cc.
References HttpConfigPortRange::high, HttpConfigPortRange::low, and HttpConfigPortRange::next.
Referenced by HttpTransact::check_request_validity().
static bool is_request_conditional | ( | HTTPHdr * | header | ) | [inline, static] |
Definition at line 149 of file HttpTransact.cc.
References HTTP_WKSIDX_GET, HTTP_WKSIDX_HEAD, HTTPHdr::method_get_wksidx(), MIME_PRESENCE_IF_MATCH, MIME_PRESENCE_IF_MODIFIED_SINCE, MIME_PRESENCE_IF_RANGE, MIME_PRESENCE_IF_UNMODIFIED_SINCE, and MIMEHdr::presence().
Referenced by HttpTransact::handle_cache_operation_on_forward_server_response(), and HttpTransact::handle_no_cache_operation_on_forward_server_response().
static bool mimefield_value_equal | ( | MIMEField * | field, | |
const char * | value, | |||
const int | value_len | |||
) | [static] |
Definition at line 1115 of file HttpTransact.cc.
References MIMEField::value_get().
Referenced by HttpTransact::ModifyRequest().
int response_cacheable_indicated_by_cc | ( | HTTPHdr * | response | ) |
Definition at line 5983 of file HttpTransact.cc.
References MIMEHdr::get_cooked_cc_mask(), MIME_COOKED_MASK_CC_MAX_AGE, MIME_COOKED_MASK_CC_MUST_REVALIDATE, MIME_COOKED_MASK_CC_NO_STORE, MIME_COOKED_MASK_CC_PUBLIC, and MIME_COOKED_MASK_CC_S_MAXAGE.
Referenced by HttpTransact::is_response_cacheable().
static void update_cache_control_information_from_config | ( | HttpTransact::State * | s | ) | [inline, static] |
Definition at line 175 of file HttpTransact.cc.
References HttpTransact::State::cache_control, HttpTransact::State::cache_info, OverridableHttpConfigParams::cache_responses_to_cookies, CacheControlResult::cache_responses_to_cookies, HttpTransact::State::client_info, HttpTransact::does_client_request_permit_cached_response(), HttpTransact::does_client_request_permit_dns_caching(), HttpTransact::does_client_request_permit_storing(), getCacheControl(), HttpTransact::State::hdr_info, CacheControlResult::never_cache, HttpTransact::State::request_data, HttpTransact::State::txn_conf, and HttpTransact::State::via_string.
Referenced by HttpTransact::HandleRequest().
static void update_current_info | ( | HttpTransact::CurrentInfo * | into, | |
HttpTransact::ConnectionAttributes * | from, | |||
HttpTransact::LookingUp_t | who, | |||
int | attempts | |||
) | [inline, static] |
Definition at line 224 of file HttpTransact.cc.
References HttpTransact::_CurrentInfo::attempts, HttpTransact::_CurrentInfo::request_to, and HttpTransact::_CurrentInfo::server.
Referenced by find_server_and_update_current_info(), HttpTransact::HandleCacheOpenReadHit(), HttpTransact::HandleICPLookup(), and HttpTransact::setup_plugin_request_intercept().
static void update_dns_info | ( | HttpTransact::DNSLookupInfo * | dns, | |
HttpTransact::CurrentInfo * | from, | |||
int | attempts, | |||
Arena * | ||||
) | [inline, static] |
Definition at line 233 of file HttpTransact.cc.
References HttpTransact::_DNSLookupInfo::attempts, HttpTransact::_DNSLookupInfo::looking_up, HttpTransact::_DNSLookupInfo::lookup_name, HttpTransact::_CurrentInfo::request_to, and HttpTransact::_CurrentInfo::server.
Referenced by HttpTransact::delete_server_rr_entry(), and find_server_and_update_current_info().
Definition at line 67 of file LogStandalone.cc.
Referenced by config_callback().
Definition at line 67 of file Cache.cc.
Referenced by ink_cache_init().
const char local_host_ip_str[] = "127.0.0.1" [static] |
Definition at line 71 of file HttpTransact.cc.
Referenced by find_server_and_update_current_info(), and HttpTransact::StartRemapRequest().
char range_type[] = "multipart/byteranges; boundary=RANGE_SEPARATOR" [static] |
Definition at line 50 of file HttpTransact.cc.
Referenced by HttpTransact::change_response_header_because_of_range_request().