TcpAcceptor.cc
Go to the documentation of this file.
43Comm::TcpAcceptor::TcpAcceptor(const Comm::ConnectionPointer &newConn, const char *, const Subscription::Pointer &aSub) :
51Comm::TcpAcceptor::TcpAcceptor(const AnyP::PortCfgPointer &p, const char *, const Subscription::Pointer &aSub) :
156 debugs(50, DBG_CRITICAL, "ERROR: listen(..., " << (Squid_MaxFD >> 2) << ") system call failed: " << xstrerr(errcode));
164 debugs(5, DBG_IMPORTANT, "Installing accept filter '" << Config.accept_filter << "' on " << conn);
168 debugs(5, DBG_CRITICAL, "WARNING: SO_ACCEPTFILTER '" << Config.accept_filter << "': '" << xstrerr(xerrno));
176 debugs(5, DBG_CRITICAL, "WARNING: TCP_DEFER_ACCEPT '" << Config.accept_filter << "': '" << xstrerr(xerrno));
321Comm::TcpAcceptor::notify(const Comm::Flag flag, const Comm::ConnectionPointer &newConnDetails) const
362 throw TextException(ToSBuf("Failed to accept an incoming connection: ", xstrerr(errcode)), Here());
384 throw TextException(ToSBuf("getsockname() failed to locate local-IP on ", details, ": ", xstrerr(xerrno)), Here());
389 if (conn->flags & COMM_TRANSPARENT) { // the real client/dest IP address must be already available via getsockname()
392 debugs(50, DBG_IMPORTANT, "ERROR: Cannot use transparent " << details << " because TPROXY mode became inactive");
396 } else if (conn->flags & COMM_INTERCEPTION) { // request the real client/dest IP address from NAT
418 debugs(50, DBG_IMPORTANT, "WARNING: " << details->remote << " attempting more than " << Config.client_ip_max_connections << " connections.");
436 F->flags.transparent = fd_table[conn->fd].flags.transparent; // XXX: can we remove this line yet?
void accessLogLog(const AccessLogEntryPointer &, ACLChecklist *)
Definition: access_log.cc:136
#define JobCallback(dbgSection, dbgLevel, Dialer, job, method)
Convenience macro to create a Dialer-based job callback.
Definition: AsyncJobCalls.h:69
void CallBack(const CodeContext::Pointer &callbackContext, Fun &&callback)
Definition: CodeContext.h:116
CBDATA_NAMESPACED_CLASS_INIT(Comm, TcpAcceptor)
std::ostream & CurrentException(std::ostream &os)
prints active (i.e., thrown but not yet handled) exception
Definition: TextException.cc:88
Definition: FilledChecklist.h:32
Definition: AccessLogEntry.h:41
Comm::ConnectionPointer tcpClient
TCP/IP level details about the client connection.
Definition: AccessLogEntry.h:83
void setVirginUrlForMissingRequest(const SBuf &vu)
Remember Client URI (or equivalent) when there is no HttpRequest.
Definition: AccessLogEntry.h:264
Definition: AsyncJob.h:32
virtual const char * status() const
internal cleanup; do not call directly
Definition: AsyncJob.cc:182
Definition: CommCalls.h:93
AnyP::PortCfgPointer port
the configuration listening port this call relates to (may be nil)
Definition: CommCalls.h:100
Definition: CommCalls.h:166
Definition: CommCalls.h:128
void defer(const TcpAcceptor::Pointer &afd)
Definition: AcceptLimiter.cc:25
void removeDead(const TcpAcceptor::Pointer &afd)
Definition: AcceptLimiter.cc:32
void enterOrphanage()
close the still-open connection when its last reference is gone
Definition: Connection.h:90
Definition: TcpAcceptor.h:39
static void doAccept(int fd, void *data)
Method callback for whenever an FD is ready to accept a client connection.
Definition: TcpAcceptor.cc:211
TcpAcceptor(const TcpAcceptor &)
void handleClosure(const CommCloseCbParams &io)
Definition: TcpAcceptor.cc:191
const char * status() const override
internal cleanup; do not call directly
Definition: TcpAcceptor.cc:124
bool acceptInto(Comm::ConnectionPointer &)
Definition: TcpAcceptor.cc:345
void subscribe(const Subscription::Pointer &aSub)
Definition: TcpAcceptor.cc:60
void notify(const Comm::Flag flag, const Comm::ConnectionPointer &details) const
Call the subscribed callback handler with details about a new connection.
Definition: TcpAcceptor.cc:321
void logAcceptError(const ConnectionPointer &tcpClient) const
Definition: TcpAcceptor.cc:249
char * toStr(char *buf, const unsigned int blen, int force=AF_UNSPEC) const
Definition: Address.cc:792
void setEmpty()
Fast reset of the stored content to what would be after default constructor.
Definition: Address.cc:184
Definition: MemBuf.h:24
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
Definition: Packable.h:61
struct StatCounters::@130 syscalls
struct StatCounters::@130::@135 sock
int clientdbEstablished(const Ip::Address &addr, int delta)
Definition: client_db.cc:182
AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:949
void comm_remove_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:978
int Squid_MaxFD
int RESERVED_FD
int incoming_sockets_accepted
#define MAX_IPSTRLEN
Length of buffer that needs to be allocated to old a null-terminated IP-string.
Definition: forward.h:25
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition: AcceptLimiter.h:17
void ApplyTcpKeepAlive(int fd, const TcpKeepAlive &)
apply configured TCP keep-alive settings to the given FD socket
Definition: Tcp.cc:51
void SetSelect(int, unsigned int, PF *, void *, time_t)
Mark an FD to be watched for its IO status.
Definition: ModDevPoll.cc:223
nfmark_t getNfConnmark(const Comm::ConnectionPointer &conn, const ConnectionDirection connDir)
Definition: QosConfig.cc:146
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
Definition: Stream.h:63