Data Structures | Defines | Typedefs | Functions | Variables

Prefetch.cc File Reference

A brief file description. More...

#include "Prefetch.h"
#include "HdrUtils.h"
#include "HttpCompat.h"
#include <records/I_RecHttp.h>
#include <ts/IpMapConf.h>
Include dependency graph for Prefetch.cc:

Go to the source code of this file.

Data Structures

struct  PrefetchConfigCont
struct  PrefetchConfigFreerCont

Defines

#define PrefetchEstablishStaticConfigStringAlloc(_ix, _n)
#define PrefetchEstablishStaticConfigLongLong(_ix, _n)
#define PrefetchEstablishStaticConfigFloat(_ix, _n)
#define PrefetchEstablishStaticConfigByte(_ix, _n)
#define IS_STATUS_REDIRECT(status)
#define IS_RECURSIVE_PREFETCH(req_ip)   (prefetch_config->max_recursion > 0 && ats_is_ip_loopback(&req_ip))
#define CONN_ARR_SIZE   256

Typedefs

typedef int(PrefetchConfigCont::* PrefetchConfigContHandler )(int, void *)
typedef int(PrefetchConfigFreerCont::* PrefetchConfigFreerContHandler )(int, void *)

Functions

static uint32_t get_udp_seq_no ()
static void setup_udp_header (char *header, uint32_t seq_no, uint32_t pkt_no, bool last_pkt)
static void setup_object_header (char *header, int64_t size, bool url_promise)
const char * findDomainFromHost (const char *host, int host_len, bool &no_dot)
static int normalize_url (char *url, int *len)
static int prefetch_config_cb (const char *, RecDataT, RecData, void *)
static void check_n_attach_prefetch_transform (HttpSM *sm, HTTPHdr *resp, bool from_cache)
static int PrefetchPlugin (TSCont, TSEvent event, void *edata)
bool isCookieUnique (HTTPHdr *req, const char *move_cookie, int move_cookie_len)
void cookie_debug (const char *level, const char *value, int value_len)
static int copy_header (MIOBuffer *buf, HTTPHdr *hdr, const char *hdr_tail)
static int config_read_proto (TSPrefetchBlastData &blast, const char *str)
int TSPrefetchHookSet (int hook_no, TSPrefetchHook hook)

Variables

struct html_tag prefetch_allowable_html_tags []
struct html_tag prefetch_allowable_html_attrs []
static const char * PREFETCH_FIELD_RECURSION
static int PREFETCH_FIELD_LEN_RECURSION
PrefetchProcessor prefetchProcessor
KeepAliveConnTableg_conn_table
static int prefetch_udp_fd = 0
static int32_t udp_seq_no
TSPrefetchBlastData const UDP_BLAST_DATA = { TS_PREFETCH_UDP_BLAST }
TSPrefetchBlastData const TCP_BLAST_DATA = { TS_PREFETCH_TCP_BLAST }
static PrefetchConfigurationprefetch_config
ClassAllocator< PrefetchUrlEntryprefetchUrlEntryAllocator ("prefetchUrlEntryAllocator")
static Ptr< ProxyMutexprefetch_reconfig_mutex
ClassAllocator< BlasterUrlListblasterUrlListAllocator ("blasterUrlList")
ClassAllocator
< PrefetchUrlBlaster
prefetchUrlBlasterAllocator ("prefetchUrlBlaster")
ClassAllocator< PrefetchBlasterprefetchBlasterAllocator ("PrefetchBlasterAllocator")
ClassAllocator
< KeepAliveLockHandler
prefetchLockHandlerAllocator ("prefetchLockHandlerAllocator")

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 Prefetch.cc.


Define Documentation

#define CONN_ARR_SIZE   256

Definition at line 2039 of file Prefetch.cc.

Referenced by KeepAliveConnTable::ip_hash().

#define IS_RECURSIVE_PREFETCH (   req_ip  )     (prefetch_config->max_recursion > 0 && ats_is_ip_loopback(&req_ip))

Definition at line 655 of file Prefetch.cc.

Referenced by check_n_attach_prefetch_transform(), and PrefetchBlaster::init().

#define IS_STATUS_REDIRECT (   status  ) 
Value:

Definition at line 298 of file Prefetch.cc.

Referenced by PrefetchTransform::redirect().

#define PrefetchEstablishStaticConfigByte (   _ix,
  _n 
)
Value:

Definition at line 96 of file Prefetch.cc.

#define PrefetchEstablishStaticConfigFloat (   _ix,
  _n 
)
Value:

Definition at line 92 of file Prefetch.cc.

#define PrefetchEstablishStaticConfigLongLong (   _ix,
  _n 
)
Value:

Definition at line 88 of file Prefetch.cc.

#define PrefetchEstablishStaticConfigStringAlloc (   _ix,
  _n 
)

Typedef Documentation

typedef int(PrefetchConfigCont::* PrefetchConfigContHandler)(int, void *)

Definition at line 305 of file Prefetch.cc.

typedef int(PrefetchConfigFreerCont::* PrefetchConfigFreerContHandler)(int, void *)

Definition at line 321 of file Prefetch.cc.


Function Documentation

static void check_n_attach_prefetch_transform ( HttpSM sm,
HTTPHdr resp,
bool  from_cache 
) [static]
static int config_read_proto ( TSPrefetchBlastData blast,
const char *  str 
) [static]
void cookie_debug ( const char *  level,
const char *  value,
int  value_len 
) [inline]

Definition at line 1184 of file Prefetch.cc.

References ats_free(), ats_malloc(), Debug, is_debug_tag_set, and memcpy.

Referenced by PrefetchBlaster::handleCookieHeaders().

static int copy_header ( MIOBuffer buf,
HTTPHdr hdr,
const char *  hdr_tail 
) [static]
const char* findDomainFromHost ( const char *  host,
int  host_len,
bool &  no_dot 
) [inline]

Definition at line 126 of file Prefetch.cc.

Referenced by PrefetchTransform::PrefetchTransform().

static uint32_t get_udp_seq_no (  )  [inline, static]

Definition at line 101 of file Prefetch.cc.

References udp_seq_no.

Referenced by PrefetchBlaster::blastObject(), and PrefetchUrlBlaster::udpUrlBlaster().

bool isCookieUnique ( HTTPHdr req,
const char *  move_cookie,
int  move_cookie_len 
)
static int normalize_url ( char *  url,
int *  len 
) [static]

Definition at line 190 of file Prefetch.cc.

References ink_assert.

Referenced by PrefetchTransform::hash_add().

static int prefetch_config_cb ( const char *  ,
RecDataT  ,
RecData  ,
void *   
) [static]

Definition at line 360 of file Prefetch.cc.

References ET_TASK, eventProcessor, HRTIME_SECONDS, and EventProcessor::schedule_in().

Referenced by PrefetchProcessor::start().

static int PrefetchPlugin ( TSCont  ,
TSEvent  event,
void *  edata 
) [static]
static void setup_object_header ( char *  header,
int64_t  size,
bool  url_promise 
) [inline, static]
static void setup_udp_header ( char *  header,
uint32_t  seq_no,
uint32_t  pkt_no,
bool  last_pkt 
) [inline, static]
int TSPrefetchHookSet ( int  hook_no,
TSPrefetchHook  hook 
)

Variable Documentation

Definition at line 76 of file Prefetch.cc.

Initial value:
 {
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {NULL, NULL},
  {"rel", "stylesheet"},        
  {NULL, NULL}
}

Definition at line 56 of file Prefetch.cc.

Initial value:
 {
  
  
  
  {"img", "src"},
  {"body", "background"},
  {"frame", "src"},
  {"fig", "src"},
  {"applet", "code"},
  {"script", "src"},
  {"embed", "src"},
  {"td", "background"},
  {"base", "href"},             
  {"meta", "content"},          
  
  {"input", "src"},
  {"link", "href"},
  {NULL, NULL}
}

Definition at line 34 of file Prefetch.cc.

Definition at line 295 of file Prefetch.cc.

const char* PREFETCH_FIELD_RECURSION [static]

Definition at line 317 of file Prefetch.cc.

int prefetch_udp_fd = 0 [static]

Definition at line 75 of file Prefetch.cc.

Referenced by TransformProcessor::start().

TSPrefetchBlastData const TCP_BLAST_DATA = { TS_PREFETCH_TCP_BLAST }

Definition at line 82 of file Prefetch.cc.

TSPrefetchBlastData const UDP_BLAST_DATA = { TS_PREFETCH_UDP_BLAST }

Definition at line 81 of file Prefetch.cc.

int32_t udp_seq_no [static]

Definition at line 79 of file Prefetch.cc.

Referenced by get_udp_seq_no(), and PrefetchProcessor::start().