Public Member Functions | Data Fields

HttpClientSession Class Reference

#include <HttpClientSession.h>

Inherits ProxyClientSession.

Collaboration diagram for HttpClientSession:
Collaboration graph
[legend]

Public Member Functions

 HttpClientSession ()
virtual void destroy ()
virtual void start ()
void new_connection (NetVConnection *new_vc, MIOBuffer *iobuf, IOBufferReader *reader, bool backdoor)
virtual VIOdo_io_read (Continuation *c, int64_t nbytes=INT64_MAX, MIOBuffer *buf=0)
 Read data from the VConnection.
virtual VIOdo_io_write (Continuation *c=NULL, int64_t nbytes=INT64_MAX, IOBufferReader *buf=0, bool owner=false)
 Write data to the VConnection.
virtual void do_io_close (int lerrno=-1)
 Indicate that the VConnection is no longer needed.
virtual void do_io_shutdown (ShutdownHowTo_t howto)
 Terminate one or both directions of the VConnection.
virtual void reenable (VIO *vio)
void new_transaction ()
void set_half_close_flag ()
virtual void release (IOBufferReader *r)
NetVConnectionget_netvc () const
virtual void attach_server_session (HttpServerSession *ssession, bool transaction_done=true)
HttpServerSessionget_server_session () const
HttpServerSessionget_bound_ss ()
void ssn_hook_append (TSHttpHookID id, INKContInternal *cont)
void ssn_hook_prepend (TSHttpHookID id, INKContInternal *cont)
int get_transact_count () const

Data Fields

IpAddr outbound_ip4
 Local address for outbound connection.
IpAddr outbound_ip6
 Local address for outbound connection.
uint16_t outbound_port
 Local port for outbound connection.
bool f_outbound_transparent
 Set outbound connection to transparent.
bool f_transparent_passthrough
 Transparently pass-through non-HTTP traffic.
HostResStyle host_res_style
 DNS resolution preferences.
const AclRecordacl_record
 acl record - cache IpAllow::match() call
bool m_active

Detailed Description

Definition at line 50 of file HttpClientSession.h.


Constructor & Destructor Documentation

HttpClientSession::HttpClientSession (  ) 

Definition at line 61 of file HttpClientSession.cc.


Member Function Documentation

void HttpClientSession::attach_server_session ( HttpServerSession ssession,
bool  transaction_done = true 
) [virtual]
void HttpClientSession::destroy (  )  [virtual]
void HttpClientSession::do_io_close ( int  lerrno = -1  )  [virtual]

Indicate that the VConnection is no longer needed.

Once the state machine has finished using this VConnection, it must call this function to indicate that the VConnection can be deallocated. After a close has been called, the VConnection and underlying processor must not send any more events related to this VConnection to the state machine. Likeswise, the state machine must not access the VConnection or any VIOs obtained from it after calling this method.

Parameters:
lerrno indicates where a close is a normal close or an abort. The difference between a normal close and an abort depends on the underlying type of the VConnection.

Implements VConnection.

Definition at line 245 of file HttpClientSession.cc.

References IOBufferReader::consume(), DebugHttpSsn, ProxyClientSession::do_api_callout(), NetVConnection::do_io_close(), NetVConnection::do_io_read(), NetVConnection::do_io_shutdown(), HRTIME_SECONDS, http_current_active_client_connections_stat, http_current_client_connections_stat, http_current_client_transactions_stat, HTTP_DECREMENT_DYN_STAT, HTTP_SUM_DYN_STAT, http_transactions_per_client_con, ink_assert, ink_release_assert, INT64_MAX, IO_SHUTDOWN_WRITE, OverridableHttpConfigParams::keep_alive_no_activity_timeout_out, m_active, IOBufferReader::read_avail(), HttpServerSession::release(), NetVConnection::set_active_timeout(), SET_HANDLER, HttpSM::t_state, TS_HTTP_SSN_CLOSE_HOOK, and HttpTransact::State::txn_conf.

Referenced by release(), and HttpSM::tunnel_handler_ua().

VIO * HttpClientSession::do_io_read ( Continuation c,
int64_t  nbytes = INT64_MAX,
MIOBuffer buf = 0 
) [virtual]

Read data from the VConnection.

Called by a state machine to read data from the VConnection. Processors implementing read functionality take out lock, put new bytes on the buffer and call the continuation back before releasing the lock in order to enable the state machine to handle transfer schemes where the end of a given transaction is marked by a special character (ie: NNTP).

Possible Event Codes

On the callback to the continuation, the VConnection may use on of the following values for the event code:

Event code Meaning
VC_EVENT_READ_READY Data has been added to the buffer or the buffer is full
VC_EVENT_READ_COMPLETE The amount of data indicated by 'nbytes' has been read into the buffer
VC_EVENT_EOS The stream being read from has been shutdown
VC_EVENT_ERROR An error occurred during the read
Parameters:
c Continuation to be called back with events.
nbytes Number of bytes to read. If unknown, nbytes must be set to INT64_MAX.
buf buffer to read into.
Returns:
VIO representing the scheduled IO operation.

Implements VConnection.

Definition at line 210 of file HttpClientSession.cc.

References NetVConnection::do_io_read().

Referenced by HttpSM::attach_client_session(), HttpSM::handle_post_failure(), release(), HttpSM::setup_client_read_request_header(), and HttpSM::setup_push_read_response_header().

void HttpClientSession::do_io_shutdown ( ShutdownHowTo_t  howto  )  [virtual]

Terminate one or both directions of the VConnection.

Indicates that one or both sides of the VConnection should be terminated. After this call is issued, no further I/O can be done on the specified direction of the connection. The processor must not send any further events (including timeout events) to the state machine, and the state machine must not use any VIOs from a shutdown direction of the connection. Even if both sides of a connection are shutdown, the state machine must still call do_io_close() when it wishes the VConnection to be deallocated.

Possible howto values

Value Meaning
IO_SHUTDOWN_READ Indicates that this VConnection should not generate any more read events
IO_SHUTDOWN_WRITE Indicates that this VConnection should not generate any more write events
IO_SHUTDOWN_READWRITE Indicates that this VConnection should not generate any more read nor write events
Parameters:
howto Specifies which direction of the VConnection to shutdown.

Implements VConnection.

Definition at line 239 of file HttpClientSession.cc.

References NetVConnection::do_io_shutdown().

VIO * HttpClientSession::do_io_write ( Continuation c = NULL,
int64_t  nbytes = INT64_MAX,
IOBufferReader buf = 0,
bool  owner = false 
) [virtual]

Write data to the VConnection.

This method is called by a state machine to write data to the VConnection.

Possible Event Codes

On the callback to the continuation, the VConnection may use on of the following event codes:

Event code Meaning
VC_EVENT_WRITE_READY Data was written from the reader or there are no bytes available for the reader to write.
VC_EVENT_WRITE_COMPLETE The amount of data indicated by 'nbytes' has been written to the VConnection
VC_EVENT_INACTIVITY_TIMEOUT No activity was performed for a certain period.
VC_EVENT_ACTIVE_TIMEOUT Write operation continued beyond a time limit.
VC_EVENT_ERROR An error occurred during the write
Parameters:
c Continuation to be called back with events.
nbytes Number of bytes to write. If unknown, nbytes must be set to INT64_MAX.
buf Reader whose data is to be read from.
owner 
Returns:
VIO representing the scheduled IO operation.

Implements VConnection.

Definition at line 216 of file HttpClientSession.cc.

References DebugHttpSsn, and NetVConnection::do_io_write().

Referenced by HttpSM::state_send_server_request_header().

HttpServerSession * HttpClientSession::get_bound_ss (  ) 

Definition at line 508 of file HttpClientSession.cc.

Referenced by HttpSM::tunnel_handler_ua().

NetVConnection* HttpClientSession::get_netvc (  )  const [inline]
HttpServerSession* HttpClientSession::get_server_session (  )  const [inline]
int HttpClientSession::get_transact_count (  )  const [inline]
void HttpClientSession::new_connection ( NetVConnection new_vc,
MIOBuffer iobuf,
IOBufferReader reader,
bool  backdoor 
) [virtual]
void HttpClientSession::new_transaction (  ) 
void HttpClientSession::reenable ( VIO vio  )  [virtual]

Reimplemented from VConnection.

Definition at line 417 of file HttpClientSession.cc.

References NetVConnection::reenable().

void HttpClientSession::release ( IOBufferReader r  )  [virtual]
void HttpClientSession::set_half_close_flag (  )  [inline]
void HttpClientSession::ssn_hook_append ( TSHttpHookID  id,
INKContInternal cont 
) [virtual]

Reimplemented from ProxyClientSession.

Definition at line 104 of file HttpClientSession.cc.

References HttpSM::hooks_set.

Referenced by TSHttpSsnHookAdd().

void HttpClientSession::ssn_hook_prepend ( TSHttpHookID  id,
INKContInternal cont 
) [virtual]

Reimplemented from ProxyClientSession.

Definition at line 113 of file HttpClientSession.cc.

References HttpSM::hooks_set.

virtual void HttpClientSession::start (  )  [inline, virtual]

Implements ProxyClientSession.

Definition at line 58 of file HttpClientSession.h.

References new_transaction().


Field Documentation

acl record - cache IpAllow::match() call

Definition at line 141 of file HttpClientSession.h.

Referenced by HttpSessionAccept::accept(), and HttpTransact::process_quick_http_filter().

Transparently pass-through non-HTTP traffic.

Definition at line 137 of file HttpClientSession.h.

Referenced by HttpSessionAccept::accept(), and HttpSM::is_transparent_passthrough_allowed().

Local address for outbound connection.

Definition at line 129 of file HttpClientSession.h.

Referenced by HttpSessionAccept::accept(), HttpSM::do_http_server_open(), and TSHttpTxnOutgoingAddrSet().

Local address for outbound connection.

Definition at line 131 of file HttpClientSession.h.

Referenced by HttpSessionAccept::accept(), HttpSM::do_http_server_open(), and TSHttpTxnOutgoingAddrSet().

Local port for outbound connection.

Definition at line 133 of file HttpClientSession.h.

Referenced by HttpSessionAccept::accept(), HttpSM::do_http_server_open(), and TSHttpTxnOutgoingAddrSet().


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