#include <Prefetch.h>
Inherits INKVConnInternal, and RefCountObj.
Public Member Functions | |
PrefetchTransform (HttpSM *sm, HTTPHdr *resp) | |
~PrefetchTransform () | |
void | free () |
PrefetchTransform * | assign () |
int | handle_event (int event, void *edata) |
int | parse_data (IOBufferReader *reader) |
int | redirect (HTTPHdr *resp) |
PrefetchUrlEntry * | hash_add (char *url) |
Data Fields | |
MIOBuffer * | m_output_buf |
IOBufferReader * | m_output_reader |
VIO * | m_output_vio |
HttpSM * | m_sm |
char * | url |
HtmlParser | html_parser |
PrefetchUrlEntry * | hash_table [HASH_TABLE_LENGTH] |
BlasterUrlList * | udp_url_list |
BlasterUrlList * | tcp_url_list |
const char * | domain_start |
const char * | domain_end |
const char * | host_start |
int | host_len |
bool | no_dot_in_host |
Definition at line 143 of file Prefetch.h.
Definition at line 369 of file Prefetch.cc.
References blasterUrlListAllocator, Debug, domain_end, domain_start, findDomainFromHost(), handle_event(), hash_table, HttpTransact::State::hdr_info, URL::host_get(), host_len, host_start, PrefetchConfiguration::html_attrs_table, html_parser, PrefetchConfiguration::html_tags_table, BlasterUrlList::init(), HtmlParser::Init(), MIME_FIELD_HOST, MIME_LEN_HOST, no_dot_in_host, redirect(), RefCountObj::refcount_inc(), SET_HANDLER, URL::string_get(), HttpSM::t_state, tcp_url_list, udp_url_list, url, PrefetchConfiguration::url_buffer_size, PrefetchConfiguration::url_buffer_timeout, HTTPHdr::url_get(), and MIMEHdr::value_get().
PrefetchTransform::~PrefetchTransform | ( | ) |
Definition at line 409 of file Prefetch.cc.
References ats_free(), Debug, PrefetchUrlEntry::free(), free_MIOBuffer(), PrefetchUrlEntry::hash_link, hash_table, m_output_buf, EThread::schedule_imm_local(), tcp_url_list, this_ethread(), udp_url_list, PrefetchUrlEntry::url, and url.
PrefetchTransform* PrefetchTransform::assign | ( | ) | [inline] |
Definition at line 156 of file Prefetch.h.
References RefCountObj::refcount_inc().
Referenced by PrefetchBlaster::init().
void PrefetchTransform::free | ( | void | ) | [inline, virtual] |
Reimplemented from RefCountObj.
Definition at line 151 of file Prefetch.h.
References RefCountObj::refcount_dec().
Referenced by PrefetchBlaster::free(), handle_event(), and PrefetchBlaster::handleEvent().
int PrefetchTransform::handle_event | ( | int | event, | |
void * | edata | |||
) |
Definition at line 436 of file Prefetch.cc.
References VIO::_cont, MIOBuffer::alloc_reader(), Debug, VConnection::do_io_shutdown(), VConnection::do_io_write(), free(), free_MIOBuffer(), VIO::get_reader(), INKContInternal::handle_event_count(), Continuation::handleEvent(), ink_assert, INT64_MAX, IO_SHUTDOWN_WRITE, INKContInternal::m_closed, INKContInternal::m_deletable, m_output_buf, m_output_reader, INKVConnInternal::m_output_vc, m_output_vio, INKVConnInternal::m_write_vio, VIO::mutex, MUTEX_TRY_LOCK, VIO::nbytes, VIO::ndone, new_empty_MIOBuffer, VIO::NONE, VIO::ntodo(), VIO::op, parse_data(), IOBufferReader::read_avail(), VIO::reenable(), INKVConnInternal::retry(), this_ethread(), VC_EVENT_ERROR, VC_EVENT_WRITE_COMPLETE, VC_EVENT_WRITE_READY, and MIOBuffer::write().
Referenced by PrefetchTransform().
PrefetchUrlEntry * PrefetchTransform::hash_add | ( | char * | url | ) |
Definition at line 630 of file Prefetch.cc.
References ats_strdup, Debug, PrefetchUrlEntry::hash_link, hash_table, normalize_url(), prefetchUrlEntryAllocator, and ats::CryptoHash::slice32().
Referenced by parse_data(), and redirect().
int PrefetchTransform::parse_data | ( | IOBufferReader * | reader | ) |
Definition at line 607 of file Prefetch.cc.
References ats_ip_copy(), HttpTransact::State::client_info, hash_add(), HttpTransact::State::hdr_info, html_parser, PrefetchBlaster::init(), m_sm, HtmlParser::ParseHtml(), prefetchBlasterAllocator, PrefetchUrlEntry::req_ip, and HttpSM::t_state.
Referenced by handle_event().
int PrefetchTransform::redirect | ( | HTTPHdr * | resp | ) |
Definition at line 538 of file Prefetch.cc.
References ats_free(), HttpTransact::State::client_info, Debug, hash_add(), HttpTransact::State::hdr_info, PrefetchBlaster::init(), ink_strlcpy(), IS_STATUS_REDIRECT, m_sm, MIME_FIELD_LOCATION, MIME_LEN_LOCATION, MIME_PRESENCE_LOCATION, prefetchBlasterAllocator, MIMEHdr::presence(), PrefetchUrlEntry::req_ip, HTTPHdr::status_get(), URL::string_get(), HttpSM::t_state, HTTPHdr::url_get(), HTTPHdr::valid(), and MIMEHdr::value_get().
Referenced by PrefetchTransform().
const char* PrefetchTransform::domain_end |
Definition at line 185 of file Prefetch.h.
Referenced by PrefetchBlaster::init(), and PrefetchTransform().
const char* PrefetchTransform::domain_start |
Definition at line 184 of file Prefetch.h.
Referenced by PrefetchBlaster::init(), and PrefetchTransform().
PrefetchUrlEntry* PrefetchTransform::hash_table[HASH_TABLE_LENGTH] |
Definition at line 179 of file Prefetch.h.
Referenced by hash_add(), PrefetchTransform(), and ~PrefetchTransform().
Definition at line 187 of file Prefetch.h.
Referenced by PrefetchBlaster::init(), and PrefetchTransform().
const char* PrefetchTransform::host_start |
Definition at line 186 of file Prefetch.h.
Referenced by PrefetchBlaster::init(), and PrefetchTransform().
Definition at line 177 of file Prefetch.h.
Referenced by parse_data(), and PrefetchTransform().
Definition at line 169 of file Prefetch.h.
Referenced by handle_event(), and ~PrefetchTransform().
Definition at line 170 of file Prefetch.h.
Referenced by handle_event().
Definition at line 171 of file Prefetch.h.
Referenced by handle_event().
Definition at line 173 of file Prefetch.h.
Referenced by PrefetchBlaster::init(), parse_data(), and redirect().
Definition at line 188 of file Prefetch.h.
Referenced by PrefetchBlaster::init(), and PrefetchTransform().
Definition at line 182 of file Prefetch.h.
Referenced by PrefetchBlaster::invokeBlaster(), PrefetchTransform(), and ~PrefetchTransform().
Definition at line 181 of file Prefetch.h.
Referenced by PrefetchBlaster::invokeBlaster(), PrefetchTransform(), and ~PrefetchTransform().
char* PrefetchTransform::url |
Definition at line 175 of file Prefetch.h.
Referenced by PrefetchTransform(), and ~PrefetchTransform().