#include <HttpServerSession.h>
Inherits VConnection.
Definition at line 68 of file HttpServerSession.h.
HttpServerSession::HttpServerSession | ( | ) | [inline] |
Definition at line 71 of file HttpServerSession.h.
References server_ip.
void HttpServerSession::attach_hostname | ( | const char * | hostname | ) | [inline] |
Definition at line 176 of file HttpServerSession.h.
References ats::CRYPTO_HASH_ZERO, hostname_hash, and ink_code_md5().
Referenced by HttpSM::release_server_session(), and HttpSM::tunnel_handler_server().
void HttpServerSession::destroy | ( | ) |
Definition at line 42 of file HttpServerSession.cc.
References Ptr< T >::clear(), free_MIOBuffer(), httpServerSessionAllocator, ink_assert, ink_release_assert, Continuation::mutex, read_buffer, server_trans_stat, sharing_pool, this_thread(), THREAD_FREE, and TS_SERVER_SESSION_SHARING_POOL_THREAD.
Referenced by do_io_close().
void HttpServerSession::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.
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 115 of file HttpServerSession.cc.
References ats_ip_ntop(), con_id, connection_count, Debug, destroy(), NetVConnection::do_io_close(), enable_origin_connection_limiting, Error, ConnectionCount::getCount(), HSS_ACTIVE, http_current_parent_proxy_connections_stat, http_current_server_connections_stat, http_current_server_transactions_stat, HTTP_DECREMENT_DYN_STAT, HTTP_SUM_DYN_STAT, HTTP_SUM_GLOBAL_DYN_STAT, http_transactions_per_server_con, ConnectionCount::incrementCount(), IpEndpoint::sa, server_ip, server_trans_stat, state, to_parent_proxy, and transact_count.
Referenced by ServerSessionPool::eventHandler(), release(), and HttpSM::release_server_session().
VIO * HttpServerSession::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 |
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. |
Implements VConnection.
Definition at line 97 of file HttpServerSession.cc.
References NetVConnection::do_io_read().
Referenced by HttpSM::attach_server_session(), HttpClientSession::attach_server_session(), ServerSessionPool::releaseSession(), and HttpSM::setup_server_read_response_header().
void HttpServerSession::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 |
howto | Specifies which direction of the VConnection to shutdown. |
Implements VConnection.
Definition at line 109 of file HttpServerSession.cc.
References NetVConnection::do_io_shutdown().
VIO * HttpServerSession::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 |
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 |
Implements VConnection.
Definition at line 103 of file HttpServerSession.cc.
References NetVConnection::do_io_write().
Referenced by HttpSM::attach_server_session(), HttpClientSession::attach_server_session(), and ServerSessionPool::releaseSession().
NetVConnection* HttpServerSession::get_netvc | ( | ) | [inline] |
Definition at line 114 of file HttpServerSession.h.
Referenced by HttpSM::attach_server_session(), HttpClientSession::attach_server_session(), ServerSessionPool::eventHandler(), HttpSM::handle_http_server_open(), HttpSM::handle_server_setup_error(), ServerSessionPool::releaseSession(), HttpSM::state_read_server_response_header(), TSHttpTxnServerPacketMarkSet(), TSHttpTxnServerPacketTosSet(), and HttpSM::tunnel_handler_ua().
IOBufferReader* HttpServerSession::get_reader | ( | ) | [inline] |
Definition at line 98 of file HttpServerSession.h.
Referenced by HttpSM::attach_server_session(), and HttpClientSession::attach_server_session().
HttpServerSession::LINK | ( | HttpServerSession | , | |
host_hash_link | ||||
) |
HttpServerSession::LINK | ( | HttpServerSession | , | |
ip_hash_link | ||||
) |
void HttpServerSession::new_connection | ( | NetVConnection * | new_vc | ) |
Definition at line 61 of file HttpServerSession.cc.
References MIOBuffer::alloc_reader(), ats_ip_ntop(), con_id, connection_count, Debug, enable_origin_connection_limiting, ConnectionCount::getCount(), ConnectionCount::getInstance(), http_current_server_connections_stat, HTTP_INCREMENT_DYN_STAT, HTTP_SERVER_RESP_HDR_BUFFER_INDEX, HTTP_SUM_GLOBAL_DYN_STAT, http_total_server_connections_stat, ConnectionCount::incrementCount(), ink_assert, Continuation::mutex, new_empty_MIOBuffer, new_MIOBuffer, next_ss_id, read_buffer, IpEndpoint::sa, server_ip, and state.
Referenced by HttpSM::state_http_server_open().
void HttpServerSession::reenable | ( | VIO * | vio | ) | [virtual] |
Reimplemented from VConnection.
Definition at line 153 of file HttpServerSession.cc.
References NetVConnection::reenable().
void HttpServerSession::release | ( | ) |
Definition at line 163 of file HttpServerSession.cc.
References Debug, do_io_close(), HSM_DONE, HSM_RETRY, httpSessionManager, ink_assert, private_session, HttpSessionManager::release_session(), sharing_match, state, and TS_SERVER_SESSION_SHARING_MATCH_NONE.
Referenced by HttpSessionManager::acquire_session(), HttpSM::do_http_server_open(), HttpClientSession::do_io_close(), HttpSM::release_server_session(), and HttpSM::tunnel_handler_server().
void HttpServerSession::reset_read_buffer | ( | void | ) | [inline] |
Definition at line 89 of file HttpServerSession.h.
References MIOBuffer::_writer, MIOBuffer::alloc_reader(), MIOBuffer::dealloc_all_readers(), ink_assert, and read_buffer.
Referenced by HttpSM::server_transfer_init().
int64_t HttpServerSession::con_id |
Definition at line 123 of file HttpServerSession.h.
Referenced by HttpSessionManager::acquire_session(), HttpClientSession::attach_server_session(), do_io_close(), ServerSessionPool::eventHandler(), new_connection(), HttpSessionManager::release_session(), and ServerSessionPool::releaseSession().
Definition at line 153 of file HttpServerSession.h.
Referenced by do_io_close(), ServerSessionPool::eventHandler(), and new_connection().
Definition at line 152 of file HttpServerSession.h.
Referenced by do_io_close(), ServerSessionPool::eventHandler(), new_connection(), and HttpSM::state_http_server_open().
Definition at line 121 of file HttpServerSession.h.
Referenced by attach_hostname(), ServerSessionPool::HostHashing::key(), and ServerSessionPool::match().
Definition at line 140 of file HttpServerSession.h.
Referenced by HttpSM::attach_server_session(), HttpSM::is_private(), release(), HttpSM::set_server_session_private(), and HttpSM::setup_server_send_request().
Definition at line 162 of file HttpServerSession.h.
Referenced by HttpSM::attach_server_session(), HttpClientSession::attach_server_session(), destroy(), new_connection(), ServerSessionPool::releaseSession(), and reset_read_buffer().
Definition at line 117 of file HttpServerSession.h.
Referenced by HttpSM::do_http_server_open(), do_io_close(), ServerSessionPool::eventHandler(), HttpServerSession(), ServerSessionPool::IPHashing::key(), ServerSessionPool::match(), new_connection(), and HttpSM::state_http_server_open().
Definition at line 136 of file HttpServerSession.h.
Referenced by HttpSM::attach_server_session(), destroy(), do_io_close(), HttpSM::release_server_session(), and HttpSM::tunnel_handler_server().
Definition at line 143 of file HttpServerSession.h.
Referenced by release(), and HttpSM::state_http_server_open().
Definition at line 144 of file HttpServerSession.h.
Referenced by destroy(), HttpSessionManager::release_session(), and HttpSM::state_http_server_open().
Definition at line 125 of file HttpServerSession.h.
Referenced by HttpSessionManager::acquire_session(), HttpSM::attach_server_session(), HttpClientSession::attach_server_session(), HttpSM::do_http_server_open(), do_io_close(), ServerSessionPool::eventHandler(), new_connection(), release(), ServerSessionPool::releaseSession(), and HttpSM::state_http_server_open().
Definition at line 132 of file HttpServerSession.h.
Referenced by do_io_close(), and HttpSM::state_http_server_open().
Definition at line 124 of file HttpServerSession.h.
Referenced by HttpSM::attach_server_session(), do_io_close(), and HttpSM::state_read_server_response_header().