|
Squid Web Cache master
|
Namespaces | |
| namespace | Mem |
Classes | |
| class | BaseMultiQueue |
| class | Coordinator |
| Coordinates shared activities of Strands (Squid processes or threads) More... | |
| class | FewToFewBiQueue |
| class | Forwarder |
| class | Inquirer |
| class | MemMap |
| A map of MemMapSlots indexed by their keys, with read/write slot locking. More... | |
| class | MemMapCleaner |
| API for adjusting external state when dirty map slot is being freed. More... | |
| class | MemMapSlot |
| a MemMap basic element, holding basic shareable memory block info More... | |
| class | MultiQueue |
| class | OneToOneUniQueue |
| class | OneToOneUniQueues |
| shared array of OneToOneUniQueues More... | |
| class | OpenListenerParams |
| "shared listen" is when concurrent processes are listening on the same fd More... | |
| class | Port |
| Waits for and receives incoming IPC messages; kids handle the messages. More... | |
| class | QuestionerId |
| class | QueueReader |
| class | QueueReaders |
| shared array of QueueReaders More... | |
| class | ReadWriteLock |
| class | ReadWriteLockStats |
| approximate stats of a set of ReadWriteLocks More... | |
| class | Request |
| IPC request. More... | |
| class | RequestId |
| class | Response |
| A response to Ipc::Request. More... | |
| class | SharedListenRequest |
| a request for a listen socket with given parameters More... | |
| class | SharedListenResponse |
| a response to SharedListenRequest More... | |
| class | StartListeningAnswer |
| StartListening() result. More... | |
| class | StoreMap |
| class | StoreMapAnchor |
| class | StoreMapAnchors |
| class | StoreMapCleaner |
| API for adjusting external state when dirty map slice is being freed. More... | |
| class | StoreMapItems |
| class | StoreMapSlice |
| class | StoreMapUpdate |
| Aggregates information required for updating entry metadata and headers. More... | |
| class | Strand |
| Receives coordination messages on behalf of its process or thread. More... | |
| class | StrandCoord |
| Strand location details. More... | |
| class | StrandMessage |
| an IPC message carrying StrandCoord More... | |
| class | StrandSearchRequest |
| asynchronous strand search request More... | |
| class | TypedMsgHdr |
| struct msghdr with a known type, fixed-size I/O and control buffers More... | |
| class | UdsOp |
| class | UdsSender |
| attempts to send an IPC message a few times, with a timeout More... | |
Typedefs | |
| using | InquirerPointer = CbcPointer< Inquirer > |
| maps request->id to the Inquirer waiting for the response to that request | |
| using | WaitingInquiriesItem = std::pair< const RequestId::Index, InquirerPointer > |
| using | WaitingInquiries = std::unordered_map< RequestId::Index, InquirerPointer, std::hash< RequestId::Index >, std::equal_to< RequestId::Index >, PoolingAllocator< WaitingInquiriesItem > > |
| using | StartListeningCallback = AsyncCallback< StartListeningAnswer > |
| typedef int32_t | StoreMapSliceId |
| typedef StoreMapItems< StoreMapSlice > | StoreMapSlices |
| StoreMapSlices indexed by their slice ID. | |
| typedef StoreMapItems< std::atomic< sfileno > > | StoreMapFileNos |
| StoreMapAnchor positions, indexed by entry "name" (i.e., the entry key hash) | |
| typedef std::vector< StrandCoord > | StrandCoords |
| a collection of strand coordinates; the order, if any, is owner-dependent | |
Enumerations | |
| enum | FdNoteId { fdnNone , fdnHttpSocket , fdnHttpsSocket , fdnFtpSocket , fdnInSnmpSocket , fdnOutSnmpSocket , fdnInIcpSocket , fdnInHtcpSocket , fdnEnd } |
| We cannot send char* FD notes to other processes. Pass int IDs and convert. More... | |
| enum | MessageType { mtNone = 0 , mtRegisterStrand , mtStrandRegistered , mtFindStrand , mtStrandReady , mtSharedListenRequest , mtSharedListenResponse , mtIpcIoNotification , mtCollapsedForwardingNotification , mtCacheMgrRequest , mtCacheMgrResponse , mtSnmpRequest , mtSnmpResponse , mtEnd } |
| message class identifier More... | |
Functions | |
| const char * | FdNote (int fdNodeId) |
| converts FdNoteId into a string | |
| static InquirerPointer | DequeueRequest (const RequestId::Index requestId) |
| returns and forgets the Inquirer waiting for the given requests | |
| QuestionerId | MyQuestionerId () |
| the questioner ID of the current/calling process | |
| template<class Answer > | |
| const Answer & | Mine (const Answer &answer) |
| std::ostream & | operator<< (std::ostream &os, const QuestionerId &qid) |
| std::ostream & | operator<< (std::ostream &, const ReadWriteLock &) |
| dumps approximate lock state (for debugging) | |
| void | AssertFlagIsSet (std::atomic_flag &flag) |
| std::ostream & | operator<< (std::ostream &, const RequestId &) |
| void | JoinSharedListen (const OpenListenerParams &, StartListeningCallback &) |
| prepare and send SharedListenRequest to Coordinator | |
| void | SharedListenJoined (const SharedListenResponse &response) |
| process Coordinator response to SharedListenRequest | |
| void | StartListening (int sock_type, int proto, const Comm::ConnectionPointer &listenConn, FdNoteId, StartListeningCallback &) |
| std::ostream & | operator<< (std::ostream &, const StartListeningAnswer &) |
| struct sockaddr_un | PathToAddress (const String &pathAddr) |
| converts human-readable filename path into UDS address | |
| void | SendMessage (const String &toAddress, const TypedMsgHdr &message) |
| const Comm::ConnectionPointer & | ImportFdIntoComm (const Comm::ConnectionPointer &conn, int socktype, int protocol, FdNoteId noteId) |
| import socket fd from another strand into our Comm state | |
Variables | |
| static WaitingInquiries | TheWaitingInquirers |
| pending Inquirer requests for this process | |
| const char | strandAddrLabel [] = "-kid" |
| strand's listening address unique label | |
Declarations used by various IPC messages
| using Ipc::InquirerPointer = typedef CbcPointer<Inquirer> |
Definition at line 29 of file Inquirer.cc.
| using Ipc::StartListeningCallback = typedef AsyncCallback<StartListeningAnswer> |
Definition at line 34 of file StartListening.h.
| typedef StoreMapItems< std::atomic<sfileno> > Ipc::StoreMapFileNos |
Definition at line 178 of file StoreMap.h.
| typedef int32_t Ipc::StoreMapSliceId |
Definition at line 24 of file StoreMap.h.
Definition at line 156 of file StoreMap.h.
| typedef std::vector<StrandCoord> Ipc::StrandCoords |
Definition at line 19 of file StrandCoords.h.
| using Ipc::WaitingInquiries = typedef std::unordered_map< RequestId::Index, InquirerPointer, std::hash<RequestId::Index>, std::equal_to<RequestId::Index>, PoolingAllocator<WaitingInquiriesItem> > |
Definition at line 31 of file Inquirer.cc.
| using Ipc::WaitingInquiriesItem = typedef std::pair<const RequestId::Index, InquirerPointer> |
Definition at line 30 of file Inquirer.cc.
| enum Ipc::FdNoteId |
| enum Ipc::MessageType |
| Enumerator | |
|---|---|
| mtNone | unspecified or unknown message kind; unused on the wire |
| mtRegisterStrand | notifies about our strand existence |
| mtStrandRegistered | acknowledges mtRegisterStrand acceptance |
| mtFindStrand | a worker requests a strand from Coordinator |
| mtStrandReady | an mtFindStrand answer: the strand exists and should be usable |
| mtSharedListenRequest | |
| mtSharedListenResponse | |
| mtIpcIoNotification | |
| mtCollapsedForwardingNotification | |
| mtCacheMgrRequest | |
| mtCacheMgrResponse | |
| mtSnmpRequest | |
| mtSnmpResponse | |
| mtEnd | for message kind range checks; unused on the wire |
Definition at line 20 of file Messages.h.
| void Ipc::AssertFlagIsSet | ( | std::atomic_flag & | flag | ) |
Same as assert(flag is set): The process assert()s if flag is not set. Side effect: The unset flag becomes set just before we assert(). Needed because atomic_flag cannot be compared with a boolean.
Definition at line 15 of file ReadWriteLock.cc.
References assert.
Referenced by Ipc::StoreMap::abortUpdating(), Ipc::StoreMap::closeForUpdating(), and Ipc::ReadWriteLock::unlockHeaders().
|
static |
Definition at line 43 of file Inquirer.cc.
References Assure, debugs, and TheWaitingInquirers.
Referenced by Ipc::Inquirer::HandleRemoteAck(), Ipc::Forwarder::HandleRemoteAck(), Ipc::Inquirer::requestTimedOut(), Ipc::Forwarder::swanSong(), and Ipc::Inquirer::swanSong().
| const char * Ipc::FdNote | ( | int | fdNodeId | ) |
Definition at line 16 of file FdNotes.cc.
References DBG_IMPORTANT, debugs, fdnEnd, and fdnNone.
Referenced by ImportFdIntoComm(), Ipc::Coordinator::openListenSocket(), SharedListenJoined(), and StartListening().
| const Comm::ConnectionPointer & Ipc::ImportFdIntoComm | ( | const Comm::ConnectionPointer & | conn, |
| int | socktype, | ||
| int | protocol, | ||
| Ipc::FdNoteId | noteId | ||
| ) |
Definition at line 195 of file UdsOp.cc.
References Comm::Connection::close(), comm_import_opened(), DBG_CRITICAL, debugs, Comm::Connection::fd, FdNote(), Ip::Address::FreeAddr(), Ip::Address::getAddrInfo(), Comm::Connection::remote, xgetsockname(), and xstrerr().
Referenced by Mgr::Inquirer::Inquirer(), Mgr::FunAction::respond(), and Mgr::InfoAction::respond().
| void Ipc::JoinSharedListen | ( | const OpenListenerParams & | params, |
| StartListeningCallback & | cb | ||
| ) |
Definition at line 143 of file SharedListen.cc.
References PendingOpenRequest::callback, debugs, PendingOpenRequest::params, SendSharedListenRequest(), TheDelayedRequests, and TheSharedListenRequestMap.
Referenced by StartListening().
| const Answer & Ipc::Mine | ( | const Answer & | answer | ) |
Convenience wrapper for rejecting (freshly parsed) stale answers. All answers are assumed to have a "QuestionerId intendedRecepient()" member.
Definition at line 56 of file QuestionerId.h.
Referenced by Ipc::Coordinator::receive(), and Ipc::Strand::receive().
| Ipc::QuestionerId Ipc::MyQuestionerId | ( | ) |
Definition at line 18 of file QuestionerId.cc.
Referenced by Ipc::RequestId::RequestId(), Ipc::StrandSearchRequest::StrandSearchRequest(), Ipc::StrandMessage::NotifyCoordinator(), and Ipc::QuestionerId::rejectAnswerIfStale().
| std::ostream & Ipc::operator<< | ( | std::ostream & | os, |
| const ReadWriteLock & | lock | ||
| ) |
Definition at line 196 of file ReadWriteLock.cc.
References Ipc::ReadWriteLock::appending, Ipc::ReadWriteLock::readers, and Ipc::ReadWriteLock::writing.
| std::ostream & Ipc::operator<< | ( | std::ostream & | os, |
| const RequestId & | requestId | ||
| ) |
Definition at line 22 of file RequestId.cc.
References Ipc::RequestId::index(), and Ipc::RequestId::questioner().
| std::ostream & Ipc::operator<< | ( | std::ostream & | os, |
| const StartListeningAnswer & | answer | ||
| ) |
Definition at line 22 of file StartListening.cc.
References Ipc::StartListeningAnswer::conn, and Ipc::StartListeningAnswer::errNo.
|
inline |
Definition at line 62 of file QuestionerId.h.
References Ipc::QuestionerId::print().
| struct sockaddr_un Ipc::PathToAddress | ( | const String & | pathAddr | ) |
Definition at line 74 of file UdsOp.cc.
References AF_LOCAL, assert, sockaddr_un::sun_family, sockaddr_un::sun_path, and xstrncpy().
Referenced by Ipc::UdsOp::UdsOp().
| void Ipc::SendMessage | ( | const String & | toAddress, |
| const TypedMsgHdr & | message | ||
| ) |
Definition at line 189 of file UdsOp.cc.
References AsyncJob::Start().
Referenced by Ipc::Coordinator::handleCacheMgrRequest(), Ipc::Coordinator::handleRegistrationRequest(), Ipc::Coordinator::handleSharedListenRequest(), Ipc::Coordinator::handleSnmpRequest(), Ipc::Inquirer::inquire(), IpcIoFile::Notify(), CollapsedForwarding::Notify(), Ipc::StrandMessage::NotifyCoordinator(), Ipc::Coordinator::notifySearcher(), IpcIoFile::open(), Mgr::Action::sendResponse(), Snmp::SendResponse(), SendSharedListenRequest(), and Ipc::Forwarder::start().
| void Ipc::SharedListenJoined | ( | const SharedListenResponse & | response | ) |
Definition at line 159 of file SharedListen.cc.
References Ipc::OpenListenerParams::addr, Assure, comm_import_opened(), debugs, Ipc::SharedListenResponse::errNo, Ipc::SharedListenResponse::fd, FdNote(), Ipc::OpenListenerParams::fdNote, Ipc::OpenListenerParams::flags, Ip::Address::FreeAddr(), Ip::Address::getAddrInfo(), Ipc::RequestId::index(), Comm::IsConnOpen(), kickDelayedRequest(), Ipc::SharedListenResponse::mapId, Must, Ipc::OpenListenerParams::proto, ScheduleCallHere, Ipc::OpenListenerParams::sock_type, TheDelayedRequests, and TheSharedListenRequestMap.
Referenced by Ipc::Strand::receive().
| void Ipc::StartListening | ( | int | sock_type, |
| int | proto, | ||
| const Comm::ConnectionPointer & | listenConn, | ||
| FdNoteId | fdNote, | ||
| StartListeningCallback & | callback | ||
| ) |
Depending on whether SMP is on, either ask Coordinator to send us the listening FD or open a listening socket directly.
Definition at line 32 of file StartListening.cc.
References Ipc::OpenListenerParams::addr, AsyncCallback< Answer >::answer(), comm_open_listener(), COMM_REUSEPORT, debugs, enter_suid(), FdNote(), Ipc::OpenListenerParams::fdNote, Comm::Connection::flags, Ipc::OpenListenerParams::flags, Comm::IsConnOpen(), JoinSharedListen(), leave_suid(), Comm::Connection::local, Ipc::OpenListenerParams::proto, AsyncCallback< Answer >::release(), ScheduleCallHere, Ipc::OpenListenerParams::sock_type, and UsingSmp().
Referenced by clientStartListeningOn(), htcpOpenPorts(), icpOpenPorts(), and snmpOpenPorts().
|
extern |
Definition at line 24 of file Port.cc.
Referenced by Ipc::Strand::Strand(), Ipc::Coordinator::handleCacheMgrRequest(), Ipc::Coordinator::handleRegistrationRequest(), Ipc::Coordinator::handleSharedListenRequest(), Ipc::Coordinator::handleSnmpRequest(), Ipc::Inquirer::inquire(), IpcIoFile::Notify(), CollapsedForwarding::Notify(), and Ipc::Coordinator::notifySearcher().
|
static |
Definition at line 39 of file Inquirer.cc.
Referenced by DequeueRequest(), and Ipc::Inquirer::inquire().