|
Squid Web Cache master
|
#include <fde.h>
Classes | |
| struct | _fde_flags |
Public Member Functions | |
| fde () | |
| void | clear () |
| Clear the fde class back to NULL equivalent. | |
| bool | closing () const |
| True if comm_close for this fd has been called. | |
| void | setIo (READ_HANDLER *, WRITE_HANDLER *) |
| set I/O methods for a freshly opened descriptor | |
| void | useDefaultIo () |
| void | useBufferedIo (READ_HANDLER *, WRITE_HANDLER *) |
| use I/O methods that maintain an internal-to-them buffer | |
| int | read (int fd, char *buf, int len) |
| int | write (int fd, const char *buf, int len) |
| char const * | remoteAddr () const |
| void | dumpStats (StoreEntry &, int) const |
| bool | readPending (int) const |
| void | noteUse () |
| record a transaction on this FD | |
Static Public Member Functions | |
| static void | Init () |
| static void | DumpStats (StoreEntry *) |
Static Public Attributes | |
| static fde * | Table = nullptr |
| global table of FD and their state. | |
Private Attributes | |
| READ_HANDLER * | readMethod_ = nullptr |
| imports bytes into Squid | |
| WRITE_HANDLER * | writeMethod_ = nullptr |
| exports Squid bytes | |
|
inline |
Definition at line 62 of file fde.h.
References desc, ipaddr, read_handler, readMethod_, write_handler, and writeMethod_.
Referenced by clear().
|
inline |
|
inline |
Definition at line 75 of file fde.h.
References fde::_fde_flags::close_request, and flags.
Referenced by _comm_close(), and checkTimeouts().
| void fde::dumpStats | ( | StoreEntry & | dumpEntry, |
| int | fdNumber | ||
| ) | const |
Definition at line 72 of file fde.cc.
References bytes_read, bytes_written, desc, fdTypeStr, flags, fde::_fde_flags::open, PRId64, readPending(), remoteAddr(), squid_curtime, storeAppendPrintf(), timeout, timeoutHandler, type, and write_handler.
Referenced by DumpStats().
|
static |
Definition at line 96 of file fde.cc.
References dumpStats(), Squid_MaxFD, storeAppendPrintf(), and Table.
Referenced by statRegisterWithCacheManager().
|
static |
Configures fd_table (a.k.a. fde::Table). Call once, after learning the number of supported descriptors (i.e. setMaxFD()) and before dereferencing fd_table (e.g., before Comm I/O).
Definition at line 141 of file fde.cc.
References assert, Squid_MaxFD, Table, and xcalloc().
Referenced by TestUfs::commonInit(), and StartUsingConfig().
Definition at line 87 of file fde.h.
References readMethod_.
| bool fde::readPending | ( | int | fdNumber | ) | const |
Definition at line 63 of file fde.cc.
References FD_SOCKET, Comm::MonitorsRead(), read_handler, and type.
Referenced by dumpStats().
| char const * fde::remoteAddr | ( | ) | const |
Definition at line 125 of file fde.cc.
References FD_SOCKET, ipaddr, local_addr, MAX_IPSTRLEN, remote_port, Ip::Address::toUrl(), and type.
Referenced by dumpStats().
| void fde::setIo | ( | READ_HANDLER * | reader, |
| WRITE_HANDLER * | writer | ||
| ) |
Definition at line 22 of file fde.cc.
References assert, flags, fde::_fde_flags::read_pending, readMethod_, and writeMethod_.
Referenced by fd_open().
| void fde::useBufferedIo | ( | READ_HANDLER * | bufferingReader, |
| WRITE_HANDLER * | bufferingWriter | ||
| ) |
Definition at line 49 of file fde.cc.
References assert, debugs, flags, fde::_fde_flags::read_pending, readMethod_, and writeMethod_.
| void fde::useDefaultIo | ( | ) |
Use default I/O methods. When called after useBufferedIo(), the caller is responsible for any (unread or unwritten) buffered data.
Definition at line 33 of file fde.cc.
References debugs, default_read_method(), default_write_method(), flags, fde::_fde_flags::read_pending, readMethod_, and writeMethod_.
Definition at line 88 of file fde.h.
References writeMethod_.
| int64_t fde::bytes_read = 0 |
Definition at line 134 of file fde.h.
Referenced by dumpStats(), fd_bytes(), and fdDumpOpen().
| int64_t fde::bytes_written = 0 |
Definition at line 135 of file fde.h.
Referenced by dumpStats(), fd_bytes(), and fdDumpOpen().
| ClientInfo* fde::clientInfo = nullptr |
Definition at line 143 of file fde.h.
Referenced by BandwidthBucket::SelectBucket().
| AsyncCall::Pointer fde::closeHandler |
Definition at line 157 of file fde.h.
Referenced by commCallCloseHandlers(), and examine_select().
| CodeContextPointer fde::codeContext |
Definition at line 181 of file fde.h.
Referenced by checkTimeouts().
| char fde::desc[FD_DESC_SZ] |
Definition at line 115 of file fde.h.
Referenced by fde(), dumpStats(), examine_select(), fd_close(), fd_note(), and fdDumpOpen().
| _fde_disk fde::disk |
Definition at line 148 of file fde.h.
Referenced by diskHandleRead(), diskHandleWrite(), and file_write().
| Security::ContextPointer fde::dynamicTlsContext |
| struct fde::_fde_flags fde::flags |
Referenced by _comm_close(), Comm::TcpAcceptor::acceptInto(), AlreadyTimedOut(), closing(), comm_connect_addr(), comm_local_port(), commCloseAllSockets(), commSetConnTimeout(), commUnsetFdTimeout(), diskHandleWrite(), Comm::DoSelect(), dumpStats(), fd_close(), fd_open(), fdDumpOpen(), file_close(), file_write(), setIo(), Comm::SetSelect(), useBufferedIo(), and useDefaultIo().
| AsyncCall::Pointer fde::halfClosedReader |
| char fde::ipaddr[MAX_IPSTRLEN] |
Definition at line 114 of file fde.h.
Referenced by fde(), Comm::TcpAcceptor::acceptInto(), comm_connect_addr(), and remoteAddr().
| Ip::Address fde::local_addr |
Definition at line 108 of file fde.h.
Referenced by Comm::TcpAcceptor::acceptInto(), comm_connect_addr(), comm_init_opened(), comm_local_port(), and remoteAddr().
| unsigned int fde::nfConnmarkFromServer = 0 |
Stores the Netfilter mark value of the connection from the remote server. See FwdState::dispatch(). Note that this differs to nfmarkToServer in that this is the value we receive from the, connection, whereas nfmarkToServer is the value to set on packets leaving* Squid.
Definition at line 171 of file fde.h.
Referenced by FwdState::dispatch().
| nfmark_t fde::nfmarkToServer = 0 |
| struct { ... } fde::pconn |
Referenced by noteUse().
| void* fde::read_data = nullptr |
Definition at line 150 of file fde.h.
Referenced by Comm::DoSelect(), file_close(), and Comm::SetSelect().
| PF* fde::read_handler |
Definition at line 149 of file fde.h.
Referenced by fde(), Comm::DoSelect(), examine_select(), fd_close(), file_close(), readPending(), and Comm::SetSelect().
|
private |
Definition at line 185 of file fde.h.
Referenced by fde(), read(), setIo(), useBufferedIo(), and useDefaultIo().
| unsigned short fde::remote_port = 0 |
Definition at line 106 of file fde.h.
Referenced by Comm::TcpAcceptor::acceptInto(), comm_connect_addr(), and remoteAddr().
| int fde::sock_family = 0 |
Definition at line 113 of file fde.h.
Referenced by Comm::TcpAcceptor::acceptInto(), comm_connect_addr(), comm_init_opened(), and comm_local_port().
| Security::SessionPointer fde::ssl |
Definition at line 159 of file fde.h.
Referenced by _comm_close().
|
static |
Definition at line 103 of file fde.h.
Referenced by DumpStats(), and Init().
| time_t fde::timeout = 0 |
Definition at line 154 of file fde.h.
Referenced by AlreadyTimedOut(), Comm::ConnOpener::cleanFd(), commSetConnTimeout(), commUnsetFdTimeout(), dumpStats(), and Comm::SetSelect().
| AsyncCall::Pointer fde::timeoutHandler |
Definition at line 153 of file fde.h.
Referenced by checkTimeouts(), Comm::ConnOpener::cleanFd(), commCloseAllSockets(), commSetConnTimeout(), commUnsetFdTimeout(), dumpStats(), and examine_select().
| tos_t fde::tosFromServer = '\0' |
Stores the TOS flags of the packets from the remote server. See FwdState::dispatch(). Note that this differs to tosToServer in that this is the value we receive from the, connection, whereas tosToServer is the value to set on packets leaving* Squid.
Definition at line 166 of file fde.h.
Referenced by Ip::Qos::getTosFromServer().
| tos_t fde::tosToServer = '\0' |
| unsigned int fde::type = 0 |
Definition at line 105 of file fde.h.
Referenced by _comm_close(), commCloseAllSockets(), dumpStats(), examine_select(), fd_close(), fd_open(), readPending(), and remoteAddr().
| void* fde::write_data = nullptr |
Definition at line 152 of file fde.h.
Referenced by Comm::ConnOpener::cleanFd(), Comm::DoSelect(), and Comm::SetSelect().
| PF* fde::write_handler |
Definition at line 151 of file fde.h.
Referenced by fde(), Comm::ConnOpener::cleanFd(), Comm::DoSelect(), dumpStats(), examine_select(), fd_close(), file_close(), and Comm::SetSelect().
|
private |
Definition at line 186 of file fde.h.
Referenced by fde(), setIo(), useBufferedIo(), useDefaultIo(), and write().
| MessageBucket::Pointer fde::writeQuotaHandler |
Definition at line 144 of file fde.h.
Referenced by checkTimeouts(), MessageBucket::scheduleWrite(), and BandwidthBucket::SelectBucket().