|
Squid Web Cache master
|
Public Member Functions | |
| Connection (const char *aSide) | |
| ~Connection () | |
| template<typename Method > | |
| void | initConnection (const Comm::ConnectionPointer &aConn, Method method, const char *name, TunnelStateData *tunnelState) |
| initiates Comm::Connection ownership, including closure monitoring | |
| void | noteClosure () |
| reacts to the external closure of our connection | |
| void | noteEof () |
| reacts to a successful zero-size read(2) | |
| int | bytesWanted (int lower=0, int upper=INT_MAX) const |
| void | bytesIn (int const &) |
| void | setDelayId (DelayId const &) |
| void | error (int const xerrno) |
| int | debugLevelForError (int const xerrno) const |
| void | dataSent (size_t amount) |
| void | write (const char *b, int size, AsyncCall::Pointer &callback, FREE *free_func) |
| writes 'b' buffer, setting the 'writer' member to 'callback'. | |
Public Attributes | |
| int | len |
| const char *const | side |
| char * | buf |
| AsyncCall::Pointer | writer |
| pending Comm::Write callback | |
| uint64_t * | size_ptr |
| Comm::ConnectionPointer | conn |
| The currently connected connection. | |
| uint8_t | delayedLoops |
| how many times a read on this connection has been postponed. | |
| bool | dirty |
| whether write() has been called (at least once) | |
| bool | receivedEof = false |
| whether read() has returned zero bytes | |
| TunnelStateData * | readPending |
| EVH * | readPendingFunc |
| DelayId | delayId |
Private Attributes | |
| AsyncCall::Pointer | closer |
| the registered close handler for the connection | |
|
explicit |
| TunnelStateData::Connection::~Connection | ( | ) |
Definition at line 494 of file tunnel.cc.
References eventDelete(), and safe_free.
| void TunnelStateData::Connection::bytesIn | ( | int const & | count | ) |
Definition at line 572 of file tunnel.cc.
References debugs.
Referenced by TunnelStateData::copyClientBytes(), TunnelStateData::copyServerBytes(), TunnelStateData::readClient(), and TunnelStateData::readServer().
Definition at line 561 of file tunnel.cc.
Referenced by TunnelStateData::copyRead().
| void TunnelStateData::Connection::dataSent | ( | size_t | amount | ) |
Definition at line 834 of file tunnel.cc.
References assert, and debugs.
Referenced by TunnelStateData::writeClientDone(), and TunnelStateData::writeServerDone().
Definition at line 607 of file tunnel.cc.
References ignoreErrno().
| void TunnelStateData::Connection::error | ( | int const | xerrno | ) |
Definition at line 659 of file tunnel.cc.
References debugs, ignoreErrno(), and xstrerr().
Referenced by TunnelStateData::keepGoingAfterRead(), TunnelStateData::writeClientDone(), and TunnelStateData::writeServerDone().
| void TunnelStateData::Connection::initConnection | ( | const Comm::ConnectionPointer & | aConn, |
| Method | method, | ||
| const char * | name, | ||
| TunnelStateData * | tunnelState | ||
| ) |
Definition at line 856 of file tunnel.cc.
References comm_add_close_handler(), commCbCall(), debugs, Comm::IsConnOpen(), and Must.
Referenced by TunnelStateData::TunnelStateData(), and TunnelStateData::commitToServer().
| void TunnelStateData::Connection::noteClosure | ( | ) |
Definition at line 868 of file tunnel.cc.
References debugs.
Referenced by TunnelStateData::clientClosed(), and TunnelStateData::serverClosed().
| void TunnelStateData::Connection::noteEof | ( | ) |
| void TunnelStateData::Connection::setDelayId | ( | DelayId const & | newDelay | ) |
Definition at line 1588 of file tunnel.cc.
Referenced by TunnelStateData::connectDone(), switchToTunnel(), and tunnelStart().
| void TunnelStateData::Connection::write | ( | const char * | b, |
| int | size, | ||
| AsyncCall::Pointer & | callback, | ||
| FREE * | free_func | ||
| ) |
Definition at line 847 of file tunnel.cc.
References size, and Comm::Write().
Referenced by TunnelStateData::copy(), and TunnelStateData::notePeerReadyToShovel().
| char* TunnelStateData::Connection::buf |
Definition at line 166 of file tunnel.cc.
Referenced by TunnelStateData::copy(), TunnelStateData::copyClientBytes(), TunnelStateData::copyRead(), TunnelStateData::copyServerBytes(), and tunnelStartShoveling().
|
private |
| Comm::ConnectionPointer TunnelStateData::Connection::conn |
Definition at line 170 of file tunnel.cc.
Referenced by TunnelStateData::TunnelStateData(), TunnelStateData::closeConnections(), TunnelStateData::closePendingConnection(), TunnelStateData::copyRead(), TunnelStateData::finishWritingAndDelete(), TunnelStateData::getHost(), TunnelStateData::keepGoingAfterRead(), TunnelStateData::noConnections(), operator<<(), TunnelStateData::retryOrBail(), TunnelStateData::sendError(), tunnelErrorComplete(), tunnelStartShoveling(), TunnelStateData::writeClientDone(), and TunnelStateData::writeServerDone().
| uint8_t TunnelStateData::Connection::delayedLoops |
Definition at line 171 of file tunnel.cc.
Referenced by TunnelStateData::copyRead(), operator<<(), TunnelStateData::readClient(), and TunnelStateData::readServer().
| DelayId TunnelStateData::Connection::delayId |
Definition at line 183 of file tunnel.cc.
Referenced by TunnelStateData::establishTunnelThruProxy().
| bool TunnelStateData::Connection::dirty |
Definition at line 173 of file tunnel.cc.
Referenced by TunnelStateData::notePeerReadyToShovel(), operator<<(), and TunnelStateData::retryOrBail().
| int TunnelStateData::Connection::len |
Definition at line 160 of file tunnel.cc.
Referenced by TunnelStateData::copyRead(), TunnelStateData::keepGoingAfterRead(), operator<<(), TunnelStateData::tunnelEstablishmentDone(), and tunnelStartShoveling().
| TunnelStateData* TunnelStateData::Connection::readPending |
Definition at line 178 of file tunnel.cc.
Referenced by TunnelStateData::copyRead(), operator<<(), tunnelDelayedClientRead(), and tunnelDelayedServerRead().
| EVH* TunnelStateData::Connection::readPendingFunc |
Definition at line 179 of file tunnel.cc.
Referenced by TunnelStateData::TunnelStateData(), and TunnelStateData::copyRead().
| bool TunnelStateData::Connection::receivedEof = false |
Definition at line 175 of file tunnel.cc.
Referenced by operator<<().
| const char* const TunnelStateData::Connection::side |
The role of the agent we are communicating with. This string literal is only used for debugging.
Definition at line 164 of file tunnel.cc.
Referenced by operator<<().
| uint64_t* TunnelStateData::Connection::size_ptr |
Definition at line 168 of file tunnel.cc.
Referenced by TunnelStateData::TunnelStateData().
| AsyncCall::Pointer TunnelStateData::Connection::writer |
Definition at line 167 of file tunnel.cc.
Referenced by TunnelStateData::finishWritingAndDelete(), operator<<(), tunnelConnectedWriteDone(), TunnelStateData::WriteClientDone(), and TunnelStateData::WriteServerDone().