Defines | Functions | Variables

HttpTransact.cc File Reference

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"
Include dependency graph for HttpTransact.cc:

Go to the source code of this file.

Defines

#define RANGE_NUMBERS_LENGTH   60
#define HTTP_INCREMENT_TRANS_STAT(X)   update_stat(s, X, 1);
#define HTTP_SUM_TRANS_STAT(X, S)   update_stat(s, X, (ink_statval_t) S);
#define TRANSACT_REMEMBER(_s, _e, _d)
#define DebugTxn(tag,...)   DebugSpecific((s->state_machine->debug_on), tag, __VA_ARGS__)

Functions

static HTTPKeepAlive is_header_keep_alive (const HTTPVersion &http_version, const HTTPVersion &request_http_version, MIMEField *con_hdr)
static bool is_request_conditional (HTTPHdr *header)
static bool is_port_in_range (int port, HttpConfigPortRange *pr)
static void update_cache_control_information_from_config (HttpTransact::State *s)
static void update_current_info (HttpTransact::CurrentInfo *into, HttpTransact::ConnectionAttributes *from, HttpTransact::LookingUp_t who, int attempts)
static void update_dns_info (HttpTransact::DNSLookupInfo *dns, HttpTransact::CurrentInfo *from, int attempts, Arena *)
static HTTPHdrfind_appropriate_cached_resp (HttpTransact::State *s)
static bool is_negative_caching_appropriate (HttpTransact::State *s)
static HttpTransact::LookingUp_t find_server_and_update_current_info (HttpTransact::State *s)
static bool do_cookies_prevent_caching (int cookies_conf, HTTPHdr *request, HTTPHdr *response, HTTPHdr *cached_request=NULL)
static bool does_method_require_cache_copy_deletion (const HttpConfigParams *http_config_param, const int method)
static
HttpTransact::StateMachineAction_t 
how_to_open_connection (HttpTransact::State *s)
static bool mimefield_value_equal (MIMEField *field, const char *value, const int value_len)
int response_cacheable_indicated_by_cc (HTTPHdr *response)
ink_time_t ink_cluster_time (void)
void forceLinkRegressionHttpTransact ()
void forceLinkRegressionHttpTransactCaller ()

Variables

static char range_type [] = "multipart/byteranges; boundary=RANGE_SEPARATOR"
HttpBodyFactorybody_factory
int cache_config_vary_on_user_agent
static const char local_host_ip_str [] = "127.0.0.1"

Detailed Description

A brief file description.

License

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 Documentation

#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);
#define HTTP_SUM_TRANS_STAT (   X,
  S 
)    update_stat(s, X, (ink_statval_t) S);
#define RANGE_NUMBERS_LENGTH   60

Definition at line 51 of file HttpTransact.cc.

#define TRANSACT_REMEMBER (   _s,
  _e,
  _d 
)
Value:
{ \
    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.


Function Documentation

static bool do_cookies_prevent_caching ( int  cookies_conf,
HTTPHdr request,
HTTPHdr response,
HTTPHdr cached_request = NULL 
) [inline, static]
static bool does_method_require_cache_copy_deletion ( const HttpConfigParams http_config_param,
const int  method 
) [inline, static]
static HTTPHdr* find_appropriate_cached_resp ( HttpTransact::State s  )  [inline, static]
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   ) 
static HTTPKeepAlive is_header_keep_alive ( const HTTPVersion http_version,
const HTTPVersion request_http_version,
MIMEField con_hdr 
) [inline, static]
static bool is_negative_caching_appropriate ( HttpTransact::State s  )  [inline, static]
static bool is_port_in_range ( int  port,
HttpConfigPortRange pr 
) [inline, static]
static bool is_request_conditional ( HTTPHdr header  )  [inline, static]
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  ) 
static void update_cache_control_information_from_config ( HttpTransact::State s  )  [inline, static]
static void update_current_info ( HttpTransact::CurrentInfo into,
HttpTransact::ConnectionAttributes from,
HttpTransact::LookingUp_t  who,
int  attempts 
) [inline, static]
static void update_dns_info ( HttpTransact::DNSLookupInfo dns,
HttpTransact::CurrentInfo from,
int  attempts,
Arena  
) [inline, static]

Variable Documentation

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]
char range_type[] = "multipart/byteranges; boundary=RANGE_SEPARATOR" [static]