client_side.h
Go to the documentation of this file.
185 PinnedIdleContext(const Comm::ConnectionPointer &conn, const HttpRequest::Pointer &req): connection(conn), request(req) {}
195 void pinBusyConnection(const Comm::ConnectionPointer &pinServerConn, const HttpRequest::Pointer &request);
201 static Comm::ConnectionPointer BorrowPinnedConnection(HttpRequest *, const AccessLogEntryPointer &);
215 ServerConnectionContext(const Comm::ConnectionPointer &conn, const SBuf &post101Bytes) : preReadServerBytes(post101Bytes), conn_(conn) { conn_->enterOrphanage(); }
337 bool initiateTunneledRequest(HttpRequest::Pointer const &cause, const char *reason, const SBuf &payload);
344 ClientHttpRequest *buildFakeRequest(SBuf &useHost, AnyP::KnownPort usePort, const SBuf &payload);
360 const ProxyProtocol::HeaderPointer &proxyProtocolHeader() const { return proxyProtocolHeader_; }
457 Security::ContextPointer getTlsContextFromCache(const SBuf &cacheKey, const Ssl::CertificateProperties &certProperties);
513 void clientStartListeningOn(AnyP::PortCfgPointer &port, const RefCount< CommCbFunPtrCallT<CommAcceptCbPtrFun> > &subCall, const Ipc::FdNoteId noteId);
523 void clientPackRangeHdr(const HttpReplyPointer &, const HttpHdrRangeSpec *, String boundary, MemBuf *);
535 void clientProcessRequest(ConnStateData *, const Http1::RequestParserPointer &, Http::Stream *);
std::ostream & operator<<(std::ostream &os, const ConnStateData::PinnedIdleContext &pic)
Definition: client_side.cc:4012
bool shouldCloseOnEof() const override
whether to stop serving our client after reading EOF on its connection
Definition: client_side.cc:1389
bool shouldPreserveClientData() const
Definition: client_side.cc:3972
Comm::ConnectionPointer connection()
gives to-server connection to the new owner
Definition: client_side.h:218
Definition: TeChunkedParser.h:51
virtual void clientPinnedConnectionClosed(const CommCloseCbParams &io)
Our close handler called by Comm when the pinned connection is closed.
Definition: client_side.cc:3660
void clientAfterReadingRequests()
Definition: client_side.cc:1417
SBuf tlsClientSni_
TLS client delivered SNI value. Empty string if none has been received.
Definition: client_side.h:490
void pinConnection(const Comm::ConnectionPointer &pinServerConn, const HttpRequest &request)
Forward future client requests using the given server connection.
Definition: client_side.cc:3699
virtual void processParsedRequest(Http::StreamPointer &)=0
start processing a freshly parsed request
void fillConnectionLevelDetails(ACLFilledChecklist &) const
Definition: client_side.cc:3499
A RegisteredRunner with lifetime determined by forces outside the Registry.
Definition: RunnersRegistry.h:106
void fillChecklist(ACLFilledChecklist &) const override
configure the given checklist (to reflect the current transaction state)
Definition: client_side.cc:3482
Definition: gadgets.h:231
Definition: FilledChecklist.h:33
void pinBusyConnection(const Comm::ConnectionPointer &pinServerConn, const HttpRequest::Pointer &request)
Definition: client_side.cc:3678
void stopPinnedConnectionMonitoring()
The caller assumes responsibility for connection closure detection.
Definition: client_side.cc:3756
void setServerBump(Ssl::ServerBump *srvBump)
Definition: client_side.h:286
void lifetimeTimeout(const CommTimeoutCbParams ¶ms)
Definition: client_side.cc:2101
const char * stoppedSending() const
true if we stopped sending the response
Definition: client_side.h:161
void enterOrphanage()
close the still-open connection when its last reference is gone
Definition: Connection.h:90
void getSslContextStart()
Start to create dynamic Security::ContextPointer for host or uses static port SSL context.
Definition: client_side.cc:2675
void setAuth(const Auth::UserRequest::Pointer &aur, const char *cause)
Definition: client_side.cc:494
void resetSslCommonName(const char *name)
Definition: client_side.h:293
Definition: HttpHeaderRange.h:26
const ProxyProtocol::HeaderPointer & proxyProtocolHeader() const
Definition: client_side.h:360
bool proxyProtocolError(const char *reason)
Definition: client_side.cc:1778
void sslCrtdHandleReply(const Helper::Reply &reply)
Process response from ssl_crtd.
Definition: client_side.cc:2528
void clientProcessRequest(ConnStateData *, const Http1::RequestParserPointer &, Http::Stream *)
Definition: client_side.cc:1568
PinnedIdleContext(const Comm::ConnectionPointer &conn, const HttpRequest::Pointer &req)
Definition: client_side.h:185
Comm::ConnectionPointer borrowPinnedConnection(HttpRequest *, const AccessLogEntryPointer &)
ConnStateData-specific part of BorrowPinnedConnection()
Definition: client_side.cc:3837
void error(char *format,...)
void sendControlMsg(HttpControlMsg) override
called to send the 1xx message and notify the Source
Definition: client_side.cc:3614
Definition: CachePeer.h:28
Comm::ConnectionPointer serverConnection
Definition: client_side.h:143
void clientPackRangeHdr(const HttpReplyPointer &, const HttpHdrRangeSpec *, String boundary, MemBuf *)
append a "part" HTTP header (as in a multi-part/range reply) to the buffer
Definition: client_side.cc:709
bool splice()
Splice a bumped client connection on peek-and-splice mode.
Definition: client_side.cc:2930
Definition: LogTags.h:17
const char * stoppedReceiving_
the reason why we no longer read the request or nil
Definition: client_side.h:501
int64_t mayNeedToReadMoreBody() const
Definition: client_side.cc:3533
Definition: Server.h:31
void noteBodyConsumerAborted(BodyPipe::Pointer) override=0
Definition: client_side.cc:2067
clientStream_status_t CSS(clientStreamNode *, ClientHttpRequest *)
Definition: clientStreamForward.h:35
Security::KeyLogger keyLogger
managers logging of the being-accepted TLS connection secrets
Definition: client_side.h:384
struct ConnStateData::@35 flags
Http1::TeChunkedParser * bodyParser
parses HTTP/1.1 chunked request body
Definition: client_side.h:108
void handleSslBumpHandshakeError(const Security::IoResult &)
process a problematic Security::Accept() result on the SslBump code path
Definition: client_side.cc:3020
static void sslCrtdHandleReplyWrapper(void *data, const Helper::Reply &reply)
Callback function. It is called when squid receive message from ssl_crtd.
Definition: client_side.cc:2521
Definition: CommCalls.h:280
void startPinnedConnectionMonitoring()
Definition: client_side.cc:3744
void finishDechunkingRequest(bool withSuccess)
put parsed content into input buffer and clean up
Definition: client_side.cc:3591
void stopReceiving(const char *error)
note request receiving error and close as soon as we write the response
Definition: client_side.cc:3551
Http::Stream * parseHttpRequest(const Http1::RequestParserPointer &)
Definition: client_side.cc:1255
void postHttpsAccept()
the second part of old httpsAccept, waiting for future HttpsServer home
Definition: client_side.cc:2465
Definition: HttpRequest.h:48
Ssl::ServerBump * sslServerBump
HTTPS server cert. fetching state for bump-ssl-server-first.
Definition: client_side.h:494
const char * stoppedSending_
the reason why we no longer write the response or nil
Definition: client_side.h:499
void connStateClosed(const CommCloseCbParams &io)
Definition: client_side.cc:483
virtual Http::Stream * parseOneRequest()=0
bool needProxyProtocolHeader_
whether PROXY protocol header is still expected
Definition: client_side.h:467
parameters for the async notePinnedConnectionBecameIdle() call
Definition: client_side.h:182
void leaveOrphanage()
resume relying on owner(s) to initiate an explicit connection closure
Definition: Connection.h:92
Definition: StoreIOBuffer.h:15
AnyP::Port tlsConnectPort
The TLS server port number as passed in the CONNECT request.
Definition: client_side.h:486
AsyncCall::Pointer closeHandler
The close handler for pinned server side connection.
Definition: client_side.h:153
void CSD(clientStreamNode *, ClientHttpRequest *)
client stream detach
Definition: clientStreamForward.h:33
virtual void handleReply(HttpReply *header, StoreIOBuffer receivedData)=0
void CSR(clientStreamNode *, ClientHttpRequest *)
client stream read
Definition: clientStreamForward.h:30
Definition: client_side_request.h:30
bundles HTTP 1xx reply and the "successfully forwarded" callback
Definition: HttpControlMsg.h:46
void updateError(const Error &)
if necessary, stores new error information (if any)
Definition: client_side.cc:628
uint16_t KnownPort
validated/supported port number; these values are never zero
Definition: UriScheme.h:23
Definition: client_side.h:79
Definition: MemBuf.h:23
Definition: CommCalls.h:113
ServerConnectionContext(const Comm::ConnectionPointer &conn, const SBuf &post101Bytes)
Definition: client_side.h:215
bool concurrentRequestQueueFilled() const
Definition: client_side.cc:1730
Definition: Xaction.cc:39
bool initiateTunneledRequest(HttpRequest::Pointer const &cause, const char *reason, const SBuf &payload)
generates and sends to tunnel.cc a fake request with a given payload
Definition: client_side.cc:3089
void afterClientWrite(size_t) override
processing to sync state after a Comm::Write()
Definition: client_side.cc:983
void httpsPeeked(PinnedIdleContext pic)
called by FwdState when it is done bumping the server
Definition: client_side.cc:3071
bool preservingClientData_
whether preservedClientData is valid and should be kept up to date
Definition: client_side.h:434
void resetReadTimeout(time_t timeout)
(re)sets timeout for receiving more bytes from the client
Definition: client_side.cc:574
FdNoteId
We cannot send char* FD notes to other processes. Pass int IDs and convert.
Definition: FdNotes.h:20
void stopSending(const char *error)
note response sending error and close as soon as we read the request
Definition: client_side.cc:959
Definition: Reply.h:29
bool handleIdleClientPinnedTlsRead()
Definition: client_side.cc:3766
virtual int pipelinePrefetchMax() const
returning N allows a pipeline of 1+N requests (see pipeline_prefetch)
Definition: client_side.cc:1716
manages collecting and logging secrets of a TLS connection to tls_key_log
Definition: KeyLogger.h:23
int varyEvaluateMatch(StoreEntry *entry, HttpRequest *req)
Definition: client_side.cc:3393
SBuf tlsConnectHostOrIp
The TLS server host name appears in CONNECT request or the server ip address for the intercepted requ...
Definition: client_side.h:485
Http::Stream * abortRequestParsing(const char *const errUri)
stop parsing the request and create context for relaying error info
Definition: client_side.cc:998
Definition: SquidString.h:25
BodyPipe::Pointer expectRequestBody(int64_t size)
Definition: client_side.cc:3522
void buildSslCertGenerationParams(Ssl::CertificateProperties &certProperties)
Definition: client_side.cc:2571
const char * findTrailingHTTPVersion(const char *uriAndHTTPVersion, const char *end=nullptr)
Definition: client_side.cc:1052
void updateError(const err_type c, const ErrorDetailPointer &d)
emplacement/convenience wrapper for updateError(const Error &)
Definition: client_side.h:366
void clientPackTermBound(String boundary, MemBuf *)
put terminating boundary for multiparts to the buffer
Definition: client_side.cc:702
void add(const Http::StreamPointer &context)
registers a newly created stream
Definition: client_side.cc:1702
bool proxyProtocolValidateClient()
Definition: client_side.cc:1759
void quitAfterError(HttpRequest *request)
Definition: client_side.cc:1431
virtual time_t idleTimeout() const =0
timeout to use when waiting for the next request
void consumeInput(const size_t byteCount)
remove no longer needed leading bytes from the input buffer
Definition: client_side.cc:1409
ProxyProtocol::HeaderPointer proxyProtocolHeader_
the parsed PROXY protocol header
Definition: client_side.h:470
Definition: ServerBump.h:33
void receivedFirstByte() override
Update flags and timeout after the first byte received.
Definition: client_side.cc:1824
void notePinnedConnectionBecameIdle(PinnedIdleContext pic)
Called when a pinned connection becomes available for forwarding the next request.
Definition: client_side.cc:3684
virtual bool writeControlMsgAndCall(HttpReply *rep, AsyncCall::Pointer &call)=0
handle a control message received by context from a peer and call back
void clientPinnedConnectionRead(const CommIoCbParams &io)
Definition: client_side.cc:3808
virtual void notePeerConnection(Comm::ConnectionPointer)
called just before a FwdState-dispatched job starts using connection
Definition: client_side.h:207
uint64_t parsedBumpedRequestCount
The number of parsed HTTP requests headers on a bumped client connection.
Definition: client_side.h:481
void getSslContextDone(Security::ContextPointer &)
finish configuring the newly created SSL context"
Definition: client_side.cc:2735
void switchToHttps(ClientHttpRequest *, Ssl::BumpMode bumpServerMode)
Definition: client_side.cc:2772
void abortChunkedRequestBody(const err_type error)
quit on errors related to chunked request body handling
Definition: client_side.cc:2034
void expectNoForwarding()
cleans up virgin request [body] forwarding state
Definition: client_side.cc:3571
const Auth::UserRequest::Pointer & getAuth() const
Definition: client_side.h:123
bool tunnelOnError(const err_type)
initiate tunneling if possible or return false otherwise
Definition: client_side.cc:1521
Definition: HttpReply.h:24
static Comm::ConnectionPointer BorrowPinnedConnection(HttpRequest *, const AccessLogEntryPointer &)
Definition: client_side.cc:3868
err_type handleChunkedRequestBody()
parses available chunked encoded body bytes, checks size, returns errors
Definition: client_side.cc:1993
struct ConnStateData::@36 pinning
void startPeekAndSplice()
Initializes and starts a peek-and-splice negotiation with the SSL client.
Definition: client_side.cc:2964
friend std::ostream & operator<<(std::ostream &, const ServerConnectionContext &)
Definition: client_side.cc:4018
noteTakeServerConnectionControl() callback parameter
Definition: client_side.h:213
Definition: Store.h:37
Auth::UserRequest::Pointer auth_
some user details that can be used to perform authentication on this connection
Definition: client_side.h:474
void clientStartListeningOn(AnyP::PortCfgPointer &port, const RefCount< CommCbFunPtrCallT< CommAcceptCbPtrFun > > &subCall, const Ipc::FdNoteId noteId)
accept requests to a given port and inform subCall about them
Definition: client_side.cc:3293
bool serveDelayedError(Http::Stream *)
Definition: client_side.cc:1443
void clientReadFtpData(const CommIoCbParams &io)
void afterClientRead() override
processing to be done after a Comm::Read()
Definition: client_side.cc:1910
void clientSetKeepaliveFlag(ClientHttpRequest *http)
decide whether to expect multiple requests on the corresponding connection
Definition: client_side.cc:674
Error bareError
a problem that occurred without a request (e.g., while parsing headers)
Definition: client_side.h:381
void clientPostHttpsAccept(ConnStateData *)
Definition: Stream.h:72
ConnStateData(const MasterXactionPointer &xact)
Definition: client_side.cc:2111
AnyP::Port port
destination port of the request that caused serverConnection
Definition: client_side.h:145
Definition: CommCalls.h:133
const char * stoppedReceiving() const
true if we stopped receiving the request
Definition: client_side.h:159
Definition: CommCalls.h:127
void clientProcessRequestFinished(ConnStateData *, const HttpRequest::Pointer &)
Definition: client_side.cc:1552
void noteMoreBodySpaceAvailable(BodyPipe::Pointer) override=0
void checkLogging()
log the last (attempt at) transaction if nobody else did
Definition: client_side.cc:3953
void storeTlsContextToCache(const SBuf &cacheKey, Security::ContextPointer &ctx)
Definition: client_side.cc:2665
bool fakeAConnectRequest(const char *reason, const SBuf &payload)
Definition: client_side.cc:3136
void CSCB(clientStreamNode *, ClientHttpRequest *, HttpReply *, StoreIOBuffer)
client stream read callback
Definition: clientStreamForward.h:27
Definition: Address.h:42
virtual void noteTakeServerConnectionControl(ServerConnectionContext)
Definition: client_side.h:229
an interface for those capable of configuring an ACLFilledChecklist object
Definition: ChecklistFiller.h:18
void unpinConnection(const bool andClose)
Undo pinConnection() and, optionally, close the pinned connection.
Definition: client_side.cc:3880
void callException(const std::exception &) override
called when the job throws during an async call
Definition: client_side.cc:615
HttpRequest::Pointer request
to-server request that initiated serverConnection
Definition: client_side.h:188
ClientHttpRequest * buildFakeRequest(SBuf &useHost, AnyP::KnownPort usePort, const SBuf &payload)
build a fake http request
Definition: client_side.cc:3165
char * prepareTlsSwitchingURL(const Http1::RequestParserPointer &hp)
Definition: client_side.cc:1196
void requestTimeout(const CommTimeoutCbParams ¶ms)
Definition: client_side.cc:2078
Security::ContextPointer getTlsContextFromCache(const SBuf &cacheKey, const Ssl::CertificateProperties &certProperties)
Definition: client_side.cc:2647
bool parseProxyProtocolHeader()
Definition: client_side.cc:1799
void terminateAll(const Error &, const LogTagsErrors &) override
abort any pending transactions and prevent new ones (by closing)
Definition: client_side.cc:3910
Definition: MasterXaction.h:39
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products