11#ifndef SQUID_SRC_CLIENT_SIDE_H
12#define SQUID_SRC_CLIENT_SIDE_H
238 void start()
override;
void error(char *format,...)
an interface for those capable of configuring an ACLFilledChecklist object
virtual bool doneAll() const
whether positive goal has been reached
CachePeer * getPeer() const
void leaveOrphanage()
resume relying on owner(s) to initiate an explicit connection closure
void enterOrphanage()
close the still-open connection when its last reference is gone
parameters for the async notePinnedConnectionBecameIdle() call
PinnedIdleContext(const Comm::ConnectionPointer &conn, const HttpRequest::Pointer &req)
Comm::ConnectionPointer connection
to-server connection to be pinned
HttpRequest::Pointer request
to-server request that initiated serverConnection
noteTakeServerConnectionControl() callback parameter
Comm::ConnectionPointer conn_
to-server connection
SBuf preReadServerBytes
post-101 bytes received from the server
Comm::ConnectionPointer connection()
gives to-server connection to the new owner
ServerConnectionContext(const Comm::ConnectionPointer &conn, const SBuf &post101Bytes)
friend std::ostream & operator<<(std::ostream &, const ServerConnectionContext &)
virtual int pipelinePrefetchMax() const
returning N allows a pipeline of 1+N requests (see pipeline_prefetch)
void postHttpsAccept()
the second part of old httpsAccept, waiting for future HttpsServer home
Ssl::ServerBump * serverBump()
void endingShutdown() override
struct ConnStateData::@29 pinning
bool auth
pinned for www authentication
bool fakeAConnectRequest(const char *reason, const SBuf &payload)
bool switchedToHttps() const
void readNextRequest()
Traffic parsing.
virtual void noteTakeServerConnectionControl(ServerConnectionContext)
virtual void clientPinnedConnectionClosed(const CommCloseCbParams &io)
Our close handler called by Comm when the pinned connection is closed.
char * prepareTlsSwitchingURL(const Http1::RequestParserPointer &hp)
Security::KeyLogger keyLogger
managers logging of the being-accepted TLS connection secrets
void afterClientRead() override
processing to be done after a Comm::Read()
Ssl::ServerBump * sslServerBump
HTTPS server cert. fetching state for bump-ssl-server-first.
const ProxyProtocol::HeaderPointer & proxyProtocolHeader() const
Http::Stream * parseHttpRequest(const Http1::RequestParserPointer &)
virtual bool writeControlMsgAndCall(HttpReply *rep, AsyncCall::Pointer &call)=0
handle a control message received by context from a peer and call back
Comm::ConnectionPointer serverConnection
void switchToHttps(ClientHttpRequest *, Ssl::BumpMode bumpServerMode)
void startPinnedConnectionMonitoring()
const char * stoppedReceiving() const
true if we stopped receiving the request
void consumeInput(const size_t byteCount)
remove no longer needed leading bytes from the input buffer
void clientAfterReadingRequests()
ClientHttpRequest * buildFakeRequest(SBuf &useHost, AnyP::KnownPort usePort, const SBuf &payload)
build a fake http request
virtual void handleReply(HttpReply *header, StoreIOBuffer receivedData)=0
void setAuth(const Auth::UserRequest::Pointer &aur, const char *cause)
virtual Http::Stream * parseOneRequest()=0
BodyPipe::Pointer bodyPipe
set when we are reading request body
const SBuf & tlsClientSni() const
void sendControlMsg(HttpControlMsg) override
called to send the 1xx message and notify the Source
void kick()
try to make progress on a transaction or read more I/O
const Auth::UserRequest::Pointer & getAuth() const
void getSslContextStart()
Start to create dynamic Security::ContextPointer for host or uses static port SSL context.
void httpsPeeked(PinnedIdleContext pic)
called by FwdState when it is done bumping the server
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
bool splice()
Splice a bumped client connection on peek-and-splice mode.
void start() override
called by AsyncStart; do not call directly
SBuf tlsClientSni_
TLS client delivered SNI value. Empty string if none has been received.
Error bareError
a problem that occurred without a request (e.g., while parsing headers)
bool handleReadData() override
void expectNoForwarding()
cleans up virgin request [body] forwarding state
Http::Stream * abortRequestParsing(const char *const errUri)
stop parsing the request and create context for relaying error info
void startShutdown() override
void sslCrtdHandleReply(const Helper::Reply &reply)
Process response from ssl_crtd.
err_type handleChunkedRequestBody()
parses available chunked encoded body bytes, checks size, returns errors
SBuf sslCommonName_
CN name for SSL certificate generation.
void resetSslCommonName(const char *name)
void afterClientWrite(size_t) override
processing to sync state after a Comm::Write()
void doneWithControlMsg() override
bool doneAll() const override
whether positive goal has been reached
void terminateAll(const Error &, const LogTagsErrors &) override
abort any pending transactions and prevent new ones (by closing)
void abortChunkedRequestBody(const err_type error)
quit on errors related to chunked request body handling
void pinConnection(const Comm::ConnectionPointer &pinServerConn, const HttpRequest &request)
Forward future client requests using the given server connection.
bool preservingClientData_
whether preservedClientData is valid and should be kept up to date
void callException(const std::exception &) override
called when the job throws during an async call
static void sslCrtdHandleReplyWrapper(void *data, const Helper::Reply &reply)
Callback function. It is called when squid receive message from ssl_crtd.
void lifetimeTimeout(const CommTimeoutCbParams ¶ms)
Ssl::CertSignAlgorithm signAlgorithm
The signing algorithm to use.
Security::ContextPointer getTlsContextFromCache(const SBuf &cacheKey, const Ssl::CertificateProperties &certProperties)
AnyP::Port tlsConnectPort
The TLS server port number as passed in the CONNECT request.
struct ConnStateData::@28 flags
CachePeer * pinnedPeer() const
Auth::UserRequest::Pointer auth_
some user details that can be used to perform authentication on this connection
Comm::ConnectionPointer borrowPinnedConnection(HttpRequest *, const AccessLogEntryPointer &)
ConnStateData-specific part of BorrowPinnedConnection()
bool shouldPreserveClientData() const
void notePinnedConnectionBecameIdle(PinnedIdleContext pic)
Called when a pinned connection becomes available for forwarding the next request.
void stopPinnedConnectionMonitoring()
The caller assumes responsibility for connection closure detection.
void pinBusyConnection(const Comm::ConnectionPointer &pinServerConn, const HttpRequest::Pointer &request)
bool handleIdleClientPinnedTlsRead()
bool proxyProtocolError(const char *reason)
bool serveDelayedError(Http::Stream *)
const SBuf & sslCommonName() const
const char * stoppedSending_
the reason why we no longer write the response or nil
void resetReadTimeout(time_t timeout)
(re)sets timeout for receiving more bytes from the client
void quitAfterError(HttpRequest *request)
void updateError(const err_type c, const ErrorDetailPointer &d)
emplacement/convenience wrapper for updateError(const Error &)
SBuf tlsConnectHostOrIp
The TLS server host name appears in CONNECT request or the server ip address for the intercepted requ...
AsyncCall::Pointer readHandler
detects serverConnection closure
~ConnStateData() override
void receivedFirstByte() override
Update flags and timeout after the first byte received.
uint64_t parsedBumpedRequestCount
The number of parsed HTTP requests headers on a bumped client connection.
Security::IoResult acceptTls()
bool pinned
this connection was pinned
BodyPipe::Pointer expectRequestBody(int64_t size)
void clientPinnedConnectionRead(const CommIoCbParams &io)
static Comm::ConnectionPointer BorrowPinnedConnection(HttpRequest *, const AccessLogEntryPointer &)
void stopReceiving(const char *error)
note request receiving error and close as soon as we write the response
void checkLogging()
log the last (attempt at) transaction if nobody else did
void unpinConnection(const bool andClose)
Undo pinConnection() and, optionally, close the pinned connection.
void handleSslBumpHandshakeError(const Security::IoResult &)
process a problematic Security::Accept() result on the SslBump code path
void startDechunkingRequest()
initialize dechunking state
void startPeekAndSplice()
Initializes and starts a peek-and-splice negotiation with the SSL client.
Ssl::BumpMode sslBumpMode
ssl_bump decision (Ssl::bumpEnd if n/a).
bool concurrentRequestQueueFilled() const
bool readMore
needs comm_read (for this request or new requests)
void extendLifetime()
(re)sets client_lifetime timeout
ProxyProtocol::HeaderPointer proxyProtocolHeader_
the parsed PROXY protocol header
bool shouldCloseOnEof() const override
whether to stop serving our client after reading EOF on its connection
void fillChecklist(ACLFilledChecklist &) const override
configure the given checklist (to reflect the current transaction state)
void requestTimeout(const CommTimeoutCbParams ¶ms)
virtual void notePeerConnection(Comm::ConnectionPointer)
called just before a FwdState-dispatched job starts using connection
void noteMoreBodySpaceAvailable(BodyPipe::Pointer) override=0
virtual time_t idleTimeout() const =0
timeout to use when waiting for the next request
void clientReadFtpData(const CommIoCbParams &io)
void finishDechunkingRequest(bool withSuccess)
put parsed content into input buffer and clean up
virtual void processParsedRequest(Http::StreamPointer &)=0
start processing a freshly parsed request
void getSslContextDone(Security::ContextPointer &)
finish configuring the newly created SSL context"
bool parseProxyProtocolHeader()
AnyP::Port port
destination port of the request that caused serverConnection
bool handleRequestBodyData()
void updateError(const Error &)
if necessary, stores new error information (if any)
void doPeekAndSpliceStep()
const char * stoppedReceiving_
the reason why we no longer read the request or nil
bool needProxyProtocolHeader_
whether PROXY protocol header is still expected
void noteBodyConsumerAborted(BodyPipe::Pointer) override=0
bool tunnelOnError(const err_type)
initiate tunneling if possible or return false otherwise
void stopSending(const char *error)
note response sending error and close as soon as we read the request
int64_t mayNeedToReadMoreBody() const
char * host
host name of pinned connection
Security::HandshakeParser tlsParser
void storeTlsContextToCache(const SBuf &cacheKey, Security::ContextPointer &ctx)
const char * stoppedSending() const
true if we stopped sending the response
SBuf sslBumpCertKey
Key to use to store/retrieve generated certificate.
bool zeroReply
server closed w/o response (ERR_ZERO_SIZE_OBJECT)
NotePairs::Pointer notes()
Http1::TeChunkedParser * bodyParser
parses HTTP/1.1 chunked request body
bool reading
we are monitoring for peer connection closure
void fillConnectionLevelDetails(ACLFilledChecklist &) const
AsyncCall::Pointer closeHandler
The close handler for pinned server side connection.
NotePairs::Pointer theNotes
void connStateClosed(const CommCloseCbParams &io)
bool proxyProtocolValidateClient()
bool peerAccessDenied
cache_peer_access denied pinned connection reuse
void add(const Http::StreamPointer &context)
registers a newly created stream
void setServerBump(Ssl::ServerBump *srvBump)
void buildSslCertGenerationParams(Ssl::CertificateProperties &certProperties)
sends a single control message, notifying the Sink
bundles HTTP 1xx reply and the "successfully forwarded" callback
A RegisteredRunner with lifetime determined by forces outside the Registry.
Incremental TLS/SSL Handshake parser.
a summary a TLS I/O operation outcome
manages collecting and logging secrets of a TLS connection to tls_key_log
void CSD(clientStreamNode *, ClientHttpRequest *)
client stream detach
void CSR(clientStreamNode *, ClientHttpRequest *)
client stream read
void CSCB(clientStreamNode *, ClientHttpRequest *, HttpReply *, StoreIOBuffer)
client stream read callback
clientStream_status_t CSS(clientStreamNode *, ClientHttpRequest *)
void clientConnectionsClose(void)
void clientProcessRequestFinished(ConnStateData *, const HttpRequest::Pointer &)
const char * findTrailingHTTPVersion(const char *uriAndHTTPVersion, const char *end=nullptr)
void clientOpenListenSockets(void)
void httpRequestFree(void *)
void clientPackRangeHdr(const HttpReplyPointer &, const HttpHdrRangeSpec *, String boundary, MemBuf *)
append a "part" HTTP header (as in a multi-part/range reply) to the buffer
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
RefCount< MasterXaction > MasterXactionPointer
CSCB clientSocketRecipient
void clientSetKeepaliveFlag(ClientHttpRequest *http)
decide whether to expect multiple requests on the corresponding connection
std::ostream & operator<<(std::ostream &os, const ConnStateData::PinnedIdleContext &pic)
void clientPostHttpsAccept(ConnStateData *)
void clientProcessRequest(ConnStateData *, const Http1::RequestParserPointer &, Http::Stream *)
void clientPackTermBound(String boundary, MemBuf *)
put terminating boundary for multiparts to the buffer
int varyEvaluateMatch(StoreEntry *entry, HttpRequest *req)
std::optional< KnownPort > Port
validated/supported port number (if any)
uint16_t KnownPort
validated/supported port number; these values are never zero
FdNoteId
We cannot send char* FD notes to other processes. Pass int IDs and convert.
std::shared_ptr< SSL_CTX > ContextPointer