Public Member Functions | Data Fields

MIMEHdr Class Reference

#include <MIME.h>

Inherits HdrHeapSDKHandle.

Inherited by HTTPHdr.

Collaboration diagram for MIMEHdr:
Collaboration graph
[legend]

Public Member Functions

 MIMEHdr ()
 ~MIMEHdr ()
int valid () const
void create (HdrHeap *heap=NULL)
void copy (const MIMEHdr *hdr)
int length_get ()
void fields_clear ()
int fields_count ()
MIMEFieldfield_create (const char *name=NULL, int length=-1)
MIMEFieldfield_find (const char *name, int length)
void field_attach (MIMEField *field)
void field_detach (MIMEField *field, bool detach_all_dups=true)
void field_delete (MIMEField *field, bool delete_all_dups=true)
void field_delete (const char *name, int name_length)
MIMEFielditer_get_first (MIMEFieldIter *iter)
MIMEFielditer_get_next (MIMEFieldIter *iter)
uint64_t presence (uint64_t mask)
int print (char *buf, int bufsize, int *bufindex, int *chars_to_skip)
int parse (MIMEParser *parser, const char **start, const char *end, bool must_copy_strs, bool eof)
const char * value_get (const char *name, int name_length, int *value_length)
int32_t value_get_int (const char *name, int name_length)
uint32_t value_get_uint (const char *name, int name_length)
int64_t value_get_int64 (const char *name, int name_length)
time_t value_get_date (const char *name, int name_length)
int value_get_comma_list (const char *name, int name_length, StrList *list)
void value_set (const char *name, int name_length, const char *value, int value_length)
void value_set_int (const char *name, int name_length, int32_t value)
void value_set_uint (const char *name, int name_length, uint32_t value)
void value_set_int64 (const char *name, int name_length, int64_t value)
void value_set_date (const char *name, int name_length, time_t value)
void value_append (const char *name, int name_length, const char *value, int value_length, bool prepend_comma=false, const char separator= ',')
void field_value_set (MIMEField *field, const char *value, int value_length)
void field_value_set_int (MIMEField *field, int32_t value)
void field_value_set_uint (MIMEField *field, uint32_t value)
void field_value_set_int64 (MIMEField *field, int64_t value)
void field_value_set_date (MIMEField *field, time_t value)
void field_value_append (MIMEField *field, const char *value, int value_length, bool prepend_comma=false, const char separator= ',')
time_t get_age ()
int64_t get_content_length ()
time_t get_date ()
time_t get_expires ()
time_t get_if_modified_since ()
time_t get_if_unmodified_since ()
time_t get_last_modified ()
time_t get_if_range_date ()
int32_t get_max_forwards ()
int32_t get_warning (int idx=0)
uint32_t get_cooked_cc_mask ()
int32_t get_cooked_cc_max_age ()
int32_t get_cooked_cc_s_maxage ()
int32_t get_cooked_cc_max_stale ()
int32_t get_cooked_cc_min_fresh ()
bool get_cooked_pragma_no_cache ()
MIMEFieldget_host_port_values (char const **host_ptr, int *host_len, char const **port_ptr, int *port_len)
 Get the value of the host field.
void set_cooked_cc_need_revalidate_once ()
void unset_cooked_cc_need_revalidate_once ()
void set_age (time_t value)
void set_content_length (int64_t value)
void set_date (time_t value)
void set_expires (time_t value)
void set_if_modified_since (time_t value)
void set_if_unmodified_since (time_t value)
void set_last_modified (time_t value)
void set_max_forwards (int32_t value)
void set_warning (int32_t value)
void set_server (const char *server_id_tag, int server_id_tag_size)

Data Fields

MIMEHdrImplm_mime

Detailed Description

Definition at line 873 of file MIME.h.


Constructor & Destructor Documentation

MIMEHdr::MIMEHdr (  )  [inline]

Definition at line 987 of file MIME.h.

MIMEHdr::~MIMEHdr (  )  [inline]

Definition at line 994 of file MIME.h.


Member Function Documentation

void MIMEHdr::copy ( const MIMEHdr hdr  )  [inline]
void MIMEHdr::create ( HdrHeap heap = NULL  )  [inline]

Definition at line 1011 of file MIME.h.

References HdrHeapSDKHandle::m_heap, m_mime, mime_hdr_create(), and new_HdrHeap().

void MIMEHdr::field_attach ( MIMEField field  )  [inline]
MIMEField * MIMEHdr::field_create ( const char *  name = NULL,
int  length = -1 
) [inline]
void MIMEHdr::field_delete ( MIMEField field,
bool  delete_all_dups = true 
) [inline]
void MIMEHdr::field_delete ( const char *  name,
int  name_length 
) [inline]

Definition at line 1117 of file MIME.h.

References field_delete(), and field_find().

void MIMEHdr::field_detach ( MIMEField field,
bool  detach_all_dups = true 
) [inline]

Definition at line 1102 of file MIME.h.

References m_mime, and mime_hdr_field_detach().

MIMEField * MIMEHdr::field_find ( const char *  name,
int  length 
) [inline]

Definition at line 1083 of file MIME.h.

References m_mime, and mime_hdr_field_find().

Referenced by HttpTransact::add_client_ip_to_outgoing_request(), HttpTransactHeaders::add_global_user_agent_header_to_request(), HttpTransactHeaders::add_server_header_to_response(), HttpTransact::AuthenticationNeeded(), HttpTransact::build_response(), HttpTransactCache::calculate_quality_of_match(), HttpTransactCache::CalcVariability(), RangeTransform::change_response_header(), HttpTransact::change_response_header_because_of_range_request(), HttpTransact::check_request_validity(), HttpTransact::delete_all_document_alternates_and_return(), HttpTransact::delete_warning_value(), field_delete(), get_host_port_values(), HttpTransact::handle_cache_operation_on_forward_server_response(), HttpTransact::handle_cache_write_lock(), HttpTransact::handle_upgrade_request(), PrefetchBlaster::handleCookieHeaders(), PrefetchBlaster::httpClient(), PrefetchBlaster::init(), LogAccessHttp::init(), HttpTransact::initialize_state_variables_from_request(), HttpTransact::initialize_state_variables_from_response(), HttpTransactHeaders::insert_supported_methods_in_response(), HttpTransact::is_request_cache_lookupable(), isCookieUnique(), LogAccessHttp::marshal_file_size(), LogAccessHttp::marshal_http_header_field(), LogAccessHttp::marshal_http_header_field_escapify(), HttpTransact::merge_warning_header(), HttpTransact::ModifyRequest(), HttpTransact::perform_accept_encoding_filtering(), value_append(), value_get(), value_get_comma_list(), value_get_date(), value_get_int(), value_get_int64(), value_get_uint(), and HttpTransact::will_this_request_self_loop().

void MIMEHdr::field_value_append ( MIMEField field,
const char *  value,
int  value_length,
bool  prepend_comma = false,
const char  separator = ',' 
) [inline]
void MIMEHdr::field_value_set ( MIMEField field,
const char *  value,
int  value_length 
) [inline]
void MIMEHdr::field_value_set_date ( MIMEField field,
time_t  value 
) [inline]

Definition at line 1288 of file MIME.h.

References HdrHeapSDKHandle::m_heap, m_mime, and MIMEField::value_set_date().

void MIMEHdr::field_value_set_int ( MIMEField field,
int32_t  value 
) [inline]

Definition at line 1270 of file MIME.h.

References HdrHeapSDKHandle::m_heap, m_mime, and MIMEField::value_set_int().

void MIMEHdr::field_value_set_int64 ( MIMEField field,
int64_t  value 
) [inline]

Definition at line 1282 of file MIME.h.

References HdrHeapSDKHandle::m_heap, m_mime, and MIMEField::value_set_int64().

void MIMEHdr::field_value_set_uint ( MIMEField field,
uint32_t  value 
) [inline]

Definition at line 1276 of file MIME.h.

References HdrHeapSDKHandle::m_heap, m_mime, and MIMEField::value_set_uint().

void MIMEHdr::fields_clear (  )  [inline]
int MIMEHdr::fields_count (  )  [inline]

Definition at line 1058 of file MIME.h.

References m_mime, and mime_hdr_fields_count().

time_t MIMEHdr::get_age (  )  [inline]
int64_t MIMEHdr::get_content_length (  )  [inline]
uint32_t MIMEHdr::get_cooked_cc_mask (  )  [inline]
int32_t MIMEHdr::get_cooked_cc_max_age (  )  [inline]
int32_t MIMEHdr::get_cooked_cc_max_stale (  )  [inline]
int32_t MIMEHdr::get_cooked_cc_min_fresh (  )  [inline]
int32_t MIMEHdr::get_cooked_cc_s_maxage (  )  [inline]
bool MIMEHdr::get_cooked_pragma_no_cache (  )  [inline]
time_t MIMEHdr::get_date (  )  [inline]
time_t MIMEHdr::get_expires (  )  [inline]

Definition at line 1405 of file MIME.h.

References value_get_date().

Referenced by HttpTransact::calculate_document_freshness_limit().

MIMEField * MIMEHdr::get_host_port_values ( char const **  host_ptr,
int *  host_len,
char const **  port_ptr,
int *  port_len 
)

Get the value of the host field.

This parses the host field for brackets and port value.

Returns:
The mime HOST field if it has a value, NULL otherwise.
Parameters:
[out] host_ptr Pointer to host.
[out] host_len Length of host.
[out] port_ptr Pointer to port.
[out] port_len Length of port.

Definition at line 2168 of file MIME.cc.

References ts::ConstBuffer::_ptr, ts::ConstBuffer::_size, ts::ConstBuffer::contains(), field_find(), MIMEField::m_len_value, MIMEField::m_ptr_value, MIME_FIELD_HOST, MIME_LEN_HOST, and ts::ConstBuffer::splitOn().

Referenced by HTTPHdr::_fill_target_cache(), and HttpTransact::DecideCacheLookup().

time_t MIMEHdr::get_if_modified_since (  )  [inline]

Definition at line 1414 of file MIME.h.

References value_get_date().

Referenced by HttpTransactCache::match_response_to_request_conditionals().

time_t MIMEHdr::get_if_range_date (  )  [inline]

Definition at line 1441 of file MIME.h.

References value_get_date().

Referenced by HttpTransactCache::match_response_to_request_conditionals().

time_t MIMEHdr::get_if_unmodified_since (  )  [inline]

Definition at line 1423 of file MIME.h.

References value_get_date().

Referenced by HttpTransactCache::match_response_to_request_conditionals().

time_t MIMEHdr::get_last_modified (  )  [inline]
int32_t MIMEHdr::get_max_forwards (  )  [inline]
int32_t MIMEHdr::get_warning ( int  idx = 0  )  [inline]

Definition at line 1459 of file MIME.h.

References ink_release_assert.

MIMEField * MIMEHdr::iter_get_first ( MIMEFieldIter iter  )  [inline]
MIMEField * MIMEHdr::iter_get_next ( MIMEFieldIter iter  )  [inline]
int MIMEHdr::length_get (  )  [inline]

Reimplemented in HTTPHdr.

Definition at line 1040 of file MIME.h.

References m_mime, and mime_hdr_length_get().

int MIMEHdr::parse ( MIMEParser parser,
const char **  start,
const char *  end,
bool  must_copy_strs,
bool  eof 
) [inline]
uint64_t MIMEHdr::presence ( uint64_t  mask  )  [inline]

Definition at line 1161 of file MIME.h.

References m_mime, and MIMEHdrImpl::m_presence_bits.

Referenced by HttpTransact::add_client_ip_to_outgoing_request(), HttpTransact::AuthenticationNeeded(), HttpTransact::build_error_response(), HttpTransact::build_request(), HttpTransact::build_response(), HttpTransact::build_response_from_cache(), HttpTransact::calculate_document_freshness_limit(), HttpTransactCache::calculate_quality_of_match(), HttpTransactCache::CalcVariability(), HttpTransact::check_request_validity(), HttpTransact::check_response_validity(), HttpTransactHeaders::convert_to_1_0_request_header(), do_cookies_prevent_caching(), RemapProcessor::finish_remap(), HttpTransact::handle_cache_operation_on_forward_server_response(), HttpTransact::handle_content_length_header(), HttpTransact::handle_trace_and_options_requests(), HttpTransact::handle_upgrade_request(), HttpTransact::HandleCacheOpenReadMiss(), PrefetchBlaster::handleCookieHeaders(), HttpTransact::initialize_state_variables_from_request(), HttpTransact::initialize_state_variables_from_response(), HttpTransact::is_request_cache_lookupable(), is_request_conditional(), HttpTransact::is_request_likely_cacheable(), HttpTransact::is_response_cacheable(), HttpTransact::issue_revalidate(), HttpTransactCache::match_response_to_request_conditionals(), HttpTransact::merge_and_update_headers_for_cache_update(), HttpTransact::ModifyRequest(), HttpTransact::OSDNSLookup(), PrefetchTransform::redirect(), HttpTransactHeaders::remove_conditional_headers(), and HttpTransact::what_is_document_freshness().

int MIMEHdr::print ( char *  buf,
int  bufsize,
int *  bufindex,
int *  chars_to_skip 
) [inline]

Reimplemented in HTTPHdr.

Definition at line 1170 of file MIME.h.

References HdrHeapSDKHandle::m_heap, m_mime, and mime_hdr_print().

void MIMEHdr::set_age ( time_t  value  )  [inline]
void MIMEHdr::set_content_length ( int64_t  value  )  [inline]
void MIMEHdr::set_cooked_cc_need_revalidate_once (  )  [inline]
void MIMEHdr::set_date ( time_t  value  )  [inline]
void MIMEHdr::set_expires ( time_t  value  )  [inline]
void MIMEHdr::set_if_modified_since ( time_t  value  )  [inline]

Definition at line 1587 of file MIME.h.

References value_set_date().

void MIMEHdr::set_if_unmodified_since ( time_t  value  )  [inline]

Definition at line 1596 of file MIME.h.

References value_set_date().

void MIMEHdr::set_last_modified ( time_t  value  )  [inline]

Definition at line 1605 of file MIME.h.

References value_set_date().

void MIMEHdr::set_max_forwards ( int32_t  value  )  [inline]

Definition at line 1614 of file MIME.h.

References value_set_int().

Referenced by HttpTransact::handle_trace_and_options_requests().

void MIMEHdr::set_server ( const char *  server_id_tag,
int  server_id_tag_size 
) [inline]

Definition at line 1632 of file MIME.h.

References value_set().

Referenced by HttpTransactHeaders::insert_server_header_in_response().

void MIMEHdr::set_warning ( int32_t  value  )  [inline]

Definition at line 1623 of file MIME.h.

References value_set_int().

void MIMEHdr::unset_cooked_cc_need_revalidate_once (  )  [inline]
int MIMEHdr::valid (  )  const [inline]

Reimplemented in HTTPHdr.

Definition at line 1002 of file MIME.h.

References HdrHeapSDKHandle::m_heap, and m_mime.

Referenced by copy().

void MIMEHdr::value_append ( const char *  name,
int  name_length,
const char *  value,
int  value_length,
bool  prepend_comma = false,
const char  separator = ',' 
) [inline]
const char * MIMEHdr::value_get ( const char *  name,
int  name_length,
int *  value_length 
) [inline]
int MIMEHdr::value_get_comma_list ( const char *  name,
int  name_length,
StrList list 
) [inline]

Definition at line 1250 of file MIME.h.

References field_find(), and MIMEField::value_get_comma_list().

Referenced by HttpTransactCache::CalcVariability().

time_t MIMEHdr::value_get_date ( const char *  name,
int  name_length 
) [inline]
int32_t MIMEHdr::value_get_int ( const char *  name,
int  name_length 
) [inline]
int64_t MIMEHdr::value_get_int64 ( const char *  name,
int  name_length 
) [inline]

Definition at line 1228 of file MIME.h.

References field_find(), and mime_field_value_get_int64().

Referenced by get_age(), and get_content_length().

uint32_t MIMEHdr::value_get_uint ( const char *  name,
int  name_length 
) [inline]

Definition at line 1217 of file MIME.h.

References field_find(), and mime_field_value_get_uint().

void MIMEHdr::value_set ( const char *  name,
int  name_length,
const char *  value,
int  value_length 
) [inline]
void MIMEHdr::value_set_date ( const char *  name,
int  name_length,
time_t  value 
) [inline]
void MIMEHdr::value_set_int ( const char *  name,
int  name_length,
int32_t  value 
) [inline]
void MIMEHdr::value_set_int64 ( const char *  name,
int  name_length,
int64_t  value 
) [inline]
void MIMEHdr::value_set_uint ( const char *  name,
int  name_length,
uint32_t  value 
) [inline]

Field Documentation


The documentation for this class was generated from the following files: