client_side.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 33 Client-side Routines */
10 
11 #ifndef SQUID_SRC_CLIENT_SIDE_H
12 #define SQUID_SRC_CLIENT_SIDE_H
13 
14 #include "acl/ChecklistFiller.h"
15 #include "base/RunnersRegistry.h"
16 #include "clientStreamForward.h"
17 #include "comm.h"
18 #include "error/Error.h"
19 #include "helper/forward.h"
20 #include "http/forward.h"
21 #include "HttpControlMsg.h"
22 #include "ipc/FdNotes.h"
23 #include "log/forward.h"
24 #include "proxyp/forward.h"
25 #include "sbuf/SBuf.h"
26 #include "servers/Server.h"
27 #if USE_AUTH
28 #include "auth/UserRequest.h"
29 #endif
30 #include "security/KeyLogger.h"
31 #if USE_OPENSSL
32 #include "security/forward.h"
33 #include "security/Handshake.h"
34 #include "ssl/support.h"
35 #endif
36 #if USE_DELAY_POOLS
37 #include "MessageBucket.h"
38 #endif
39 
40 #include <iosfwd>
41 
42 class ClientHttpRequest;
43 class HttpHdrRangeSpec;
44 
47 
48 #if USE_OPENSSL
49 namespace Ssl
50 {
51 class ServerBump;
52 }
53 #endif
54 
80  public Server,
81  public HttpControlMsgSink,
82  public Acl::ChecklistFiller,
83  private IndependentRunner
84 {
85 
86 public:
87  explicit ConnStateData(const MasterXactionPointer &xact);
88  ~ConnStateData() override;
89 
90  /* ::Server API */
91  void receivedFirstByte() override;
92  bool handleReadData() override;
93  void afterClientRead() override;
94  void afterClientWrite(size_t) override;
95 
96  /* HttpControlMsgSink API */
97  void sendControlMsg(HttpControlMsg) override;
98  void doneWithControlMsg() override;
99 
101  void readNextRequest();
102 
104  void kick();
105 
106  bool isOpen() const;
107 
109 
116  int64_t mayNeedToReadMoreBody() const;
117 
118 #if USE_AUTH
119 
123  const Auth::UserRequest::Pointer &getAuth() const { return auth_; }
124 
133  void setAuth(const Auth::UserRequest::Pointer &aur, const char *cause);
134 #endif
135 
137 
138  struct {
139  bool readMore = true;
140  bool swanSang = false; // XXX: temporary flag to check proper cleanup
141  } flags;
142  struct {
143  Comm::ConnectionPointer serverConnection; /* pinned server side connection */
144  char *host = nullptr;
146  bool pinned = false;
147  bool auth = false;
148  bool reading = false;
149  bool zeroReply = false;
150  bool peerAccessDenied = false;
151  CachePeer *peer = nullptr;
154  } pinning;
155 
156  bool transparent() const;
157 
159  const char *stoppedReceiving() const { return stoppedReceiving_; }
161  const char *stoppedSending() const { return stoppedSending_; }
163  void stopReceiving(const char *error);
165  void stopSending(const char *error);
166 
168  void resetReadTimeout(time_t timeout);
170  void extendLifetime();
171 
172  void expectNoForwarding();
173 
174  /* BodyPipe API */
177  void noteBodyConsumerAborted(BodyPipe::Pointer) override = 0;
178 
179  bool handleRequestBodyData();
180 
183  {
184  public:
186 
189  };
190 
195  void pinBusyConnection(const Comm::ConnectionPointer &pinServerConn, const HttpRequest::Pointer &request);
197  void unpinConnection(const bool andClose);
198 
203  CachePeer *pinnedPeer() const {return pinning.peer;}
204  bool pinnedAuth() const {return pinning.auth;}
205 
208 
209  // pining related comm callbacks
210  virtual void clientPinnedConnectionClosed(const CommCloseCbParams &io);
211 
214  public:
215  ServerConnectionContext(const Comm::ConnectionPointer &conn, const SBuf &post101Bytes) : preReadServerBytes(post101Bytes), conn_(conn) { conn_->enterOrphanage(); }
216 
219 
221 
222  private:
223  friend std::ostream &operator <<(std::ostream &, const ServerConnectionContext &);
225  };
226 
230 
231  // comm callbacks
232  void clientReadFtpData(const CommIoCbParams &io);
233  void connStateClosed(const CommCloseCbParams &io);
234  void requestTimeout(const CommTimeoutCbParams &params);
235  void lifetimeTimeout(const CommTimeoutCbParams &params);
236 
237  // AsyncJob API
238  void start() override;
239  bool doneAll() const override { return BodyProducer::doneAll() && false;}
240  void swanSong() override;
241  void callException(const std::exception &) override;
242 
245  void quitAfterError(HttpRequest *request); // meant to be private
246 
249 
253 
255  void postHttpsAccept();
256 
257 #if USE_OPENSSL
258  void startPeekAndSplice();
260 
264  void doPeekAndSpliceStep();
266  void httpsPeeked(PinnedIdleContext pic);
267 
269  bool splice();
270 
272  void getSslContextStart();
273 
276 
278  static void sslCrtdHandleReplyWrapper(void *data, const Helper::Reply &reply);
280  void sslCrtdHandleReply(const Helper::Reply &reply);
281 
282  void switchToHttps(ClientHttpRequest *, Ssl::BumpMode bumpServerMode);
283  void parseTlsHandshake();
284  bool switchedToHttps() const { return switchedToHttps_; }
286  inline void setServerBump(Ssl::ServerBump *srvBump) {
287  if (!sslServerBump)
288  sslServerBump = srvBump;
289  else
290  assert(sslServerBump == srvBump);
291  }
292  const SBuf &sslCommonName() const {return sslCommonName_;}
293  void resetSslCommonName(const char *name) {sslCommonName_ = name;}
294  const SBuf &tlsClientSni() const { return tlsClientSni_; }
303 
305 
309 #else
310  bool switchedToHttps() const { return false; }
311 #endif
313 
315  void add(const Http::StreamPointer &context);
316 
318  virtual bool writeControlMsgAndCall(HttpReply *rep, AsyncCall::Pointer &call) = 0;
319 
322  virtual void handleReply(HttpReply *header, StoreIOBuffer receivedData) = 0;
323 
325  void consumeInput(const size_t byteCount);
326 
327  /* TODO: Make the methods below (at least) non-public when possible. */
328 
330  Http::Stream *abortRequestParsing(const char *const errUri);
331 
334  bool fakeAConnectRequest(const char *reason, const SBuf &payload);
335 
337  bool initiateTunneledRequest(HttpRequest::Pointer const &cause, const char *reason, const SBuf &payload);
338 
341  bool shouldPreserveClientData() const;
342 
344  ClientHttpRequest *buildFakeRequest(SBuf &useHost, AnyP::KnownPort usePort, const SBuf &payload);
345 
350 
351  /* Registered Runner API */
352  void startShutdown() override;
353  void endingShutdown() override;
354 
358  bool hasNotes() const { return bool(theNotes) && !theNotes->empty(); }
359 
361 
363  void updateError(const Error &);
364 
366  void updateError(const err_type c, const ErrorDetailPointer &d) { updateError(Error(c, d)); }
367 
368  /* Acl::ChecklistFiller API */
369  void fillChecklist(ACLFilledChecklist &) const override;
370 
377 
378  // Exposed to be accessible inside the ClientHttpRequest constructor.
379  // TODO: Remove. Make sure there is always a suitable ALE instead.
382 
385 
386 protected:
387  void startDechunkingRequest();
388  void finishDechunkingRequest(bool withSuccess);
391 
394 
397 #if USE_OPENSSL
402 #endif
403 
412 
416  virtual Http::Stream *parseOneRequest() = 0;
417 
419  virtual void processParsedRequest(Http::StreamPointer &) = 0;
420 
422  virtual int pipelinePrefetchMax() const;
423 
425  virtual time_t idleTimeout() const = 0;
426 
429  void whenClientIpKnown();
430 
432 
434  bool preservingClientData_ = false;
435 
436  bool tunnelOnError(const err_type);
437 
438 private:
439  /* ::Server API */
440  void terminateAll(const Error &, const LogTagsErrors &) override;
441  bool shouldCloseOnEof() const override;
442 
443  void checkLogging();
444 
445  void parseRequests();
447  bool concurrentRequestQueueFilled() const;
448 
449  void pinConnection(const Comm::ConnectionPointer &pinServerConn, const HttpRequest &request);
450 
451  /* PROXY protocol functionality */
454  bool proxyProtocolError(const char *reason);
455 
456 #if USE_OPENSSL
457  Security::ContextPointer getTlsContextFromCache(const SBuf &cacheKey, const Ssl::CertificateProperties &certProperties);
459 
462  void storeTlsContextToCache(const SBuf &cacheKey, Security::ContextPointer &ctx);
464 #endif
465 
468 
471 
472 #if USE_AUTH
475 #endif
476 
477 #if USE_OPENSSL
478  bool switchedToHttps_ = false;
479  bool parsingTlsHandshake = false;
480  uint64_t parsedBumpedRequestCount = 0;
482 
483  // TODO: Replace tlsConnectHostOrIp and tlsConnectPort with CONNECT request AnyP::Uri
488 
492 
496 #endif
497 
499  const char *stoppedSending_ = nullptr;
501  const char *stoppedReceiving_ = nullptr;
506 };
507 
508 const char *findTrailingHTTPVersion(const char *uriAndHTTPVersion, const char *end = nullptr);
509 
510 int varyEvaluateMatch(StoreEntry * entry, HttpRequest * req);
511 
514 
515 void clientOpenListenSockets(void);
516 void clientConnectionsClose(void);
517 void httpRequestFree(void *);
518 
521 
523 void clientPackRangeHdr(const HttpReplyPointer &, const HttpHdrRangeSpec *, String boundary, MemBuf *);
524 
526 void clientPackTermBound(String boundary, MemBuf *);
527 
528 /* misplaced declaratrions of Stream callbacks provided/used by client side */
534 
538 
539 std::ostream &operator <<(std::ostream &os, const ConnStateData::PinnedIdleContext &pic);
540 std::ostream &operator <<(std::ostream &, const ConnStateData::ServerConnectionContext &);
541 
542 #endif /* SQUID_SRC_CLIENT_SIDE_H */
543 
std::ostream & operator<<(std::ostream &os, const ConnStateData::PinnedIdleContext &pic)
bool shouldCloseOnEof() const override
whether to stop serving our client after reading EOF on its connection
bool shouldPreserveClientData() const
void whenClientIpKnown()
Comm::ConnectionPointer connection()
gives to-server connection to the new owner
Definition: client_side.h:218
virtual void clientPinnedConnectionClosed(const CommCloseCbParams &io)
Our close handler called by Comm when the pinned connection is closed.
void clientAfterReadingRequests()
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.
virtual void processParsedRequest(Http::StreamPointer &)=0
start processing a freshly parsed request
void fillConnectionLevelDetails(ACLFilledChecklist &) const
A RegisteredRunner with lifetime determined by forces outside the Registry.
void fillChecklist(ACLFilledChecklist &) const override
configure the given checklist (to reflect the current transaction state)
void pinBusyConnection(const Comm::ConnectionPointer &pinServerConn, const HttpRequest::Pointer &request)
CSCB clientSocketRecipient
Definition: client_side.h:532
void stopPinnedConnectionMonitoring()
The caller assumes responsibility for connection closure detection.
void setServerBump(Ssl::ServerBump *srvBump)
Definition: client_side.h:286
CertSignAlgorithm
Definition: gadgets.h:169
void lifetimeTimeout(const CommTimeoutCbParams &params)
CachePeer * peer
CachePeer the connection goes via.
Definition: client_side.h:151
std::shared_ptr< SSL_CTX > ContextPointer
Definition: Context.h:29
Comm::ConnectionPointer connection
to-server connection to be pinned
Definition: client_side.h:187
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
@ Error
Definition: ResultCode.h:19
void getSslContextStart()
Start to create dynamic Security::ContextPointer for host or uses static port SSL context.
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
const ProxyProtocol::HeaderPointer & proxyProtocolHeader() const
Definition: client_side.h:360
bool proxyProtocolError(const char *reason)
void sslCrtdHandleReply(const Helper::Reply &reply)
Process response from ssl_crtd.
NotePairs::Pointer theNotes
Definition: client_side.h:505
void clientProcessRequest(ConnStateData *, const Http1::RequestParserPointer &, Http::Stream *)
bool peerAccessDenied
cache_peer_access denied pinned connection reuse
Definition: client_side.h:150
void extendLifetime()
(re)sets client_lifetime timeout
Definition: client_side.cc:582
PinnedIdleContext(const Comm::ConnectionPointer &conn, const HttpRequest::Pointer &req)
Definition: client_side.h:185
void doPeekAndSpliceStep()
Comm::ConnectionPointer borrowPinnedConnection(HttpRequest *, const AccessLogEntryPointer &)
ConnStateData-specific part of BorrowPinnedConnection()
CSS clientReplyStatus
Definition: client_side.h:530
void error(char *format,...)
CachePeer * pinnedPeer() const
Definition: client_side.h:203
Ip::Address log_addr
Definition: client_side.h:136
void readNextRequest()
Traffic parsing.
Definition: client_side.cc:857
bool pinned
this connection was pinned
Definition: client_side.h:146
void sendControlMsg(HttpControlMsg) override
called to send the 1xx message and notify the Source
Comm::ConnectionPointer serverConnection
Definition: client_side.h:143
Definition: SBuf.h:93
BumpMode
Definition: support.h:132
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
BodyPipe::Pointer bodyPipe
set when we are reading request body
Definition: client_side.h:431
bool splice()
Splice a bumped client connection on peek-and-splice mode.
const char * stoppedReceiving_
the reason why we no longer read the request or nil
Definition: client_side.h:501
int64_t mayNeedToReadMoreBody() const
Definition: Server.h:31
void noteBodyConsumerAborted(BodyPipe::Pointer) override=0
clientStream_status_t CSS(clientStreamNode *, ClientHttpRequest *)
@ bumpEnd
Definition: support.h:132
Security::KeyLogger keyLogger
managers logging of the being-accepted TLS connection secrets
Definition: client_side.h:384
CSD clientSocketDetach
Definition: client_side.h:533
struct ConnStateData::@35 flags
Http1::TeChunkedParser * bodyParser
parses HTTP/1.1 chunked request body
Definition: client_side.h:108
a summary a TLS I/O operation outcome
Definition: Io.h:19
void handleSslBumpHandshakeError(const Security::IoResult &)
process a problematic Security::Accept() result on the SslBump code path
bool empty() const
Definition: Notes.h:260
err_type
Definition: forward.h:14
SBuf sslBumpCertKey
Key to use to store/retrieve generated certificate.
Definition: client_side.h:491
static void sslCrtdHandleReplyWrapper(void *data, const Helper::Reply &reply)
Callback function. It is called when squid receive message from ssl_crtd.
void startDechunkingRequest()
initialize dechunking state
static int port
Definition: ldap_backend.cc:70
Security::IoResult acceptTls()
void startPinnedConnectionMonitoring()
void finishDechunkingRequest(bool withSuccess)
put parsed content into input buffer and clean up
void stopReceiving(const char *error)
note request receiving error and close as soon as we write the response
bool zeroReply
server closed w/o response (ERR_ZERO_SIZE_OBJECT)
Definition: client_side.h:149
a transaction problem
Definition: Error.h:27
bool readMore
needs comm_read (for this request or new requests)
Definition: client_side.h:139
Http::Stream * parseHttpRequest(const Http1::RequestParserPointer &)
void parseRequests()
void postHttpsAccept()
the second part of old httpsAccept, waiting for future HttpsServer home
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
Ssl::CertSignAlgorithm signAlgorithm
The signing algorithm to use.
Definition: client_side.h:495
bool needProxyProtocolHeader_
whether PROXY protocol header is still expected
Definition: client_side.h:467
int size
Definition: ModDevPoll.cc:69
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
void httpRequestFree(void *)
Definition: client_side.cc:475
AnyP::Port tlsConnectPort
The TLS server port number as passed in the CONNECT request.
Definition: client_side.h:486
virtual bool doneAll() const
whether positive goal has been reached
Definition: AsyncJob.cc:112
@ algSignTrusted
Definition: gadgets.h:169
AsyncCall::Pointer closeHandler
The close handler for pinned server side connection.
Definition: client_side.h:153
bool reading
we are monitoring for peer connection closure
Definition: client_side.h:148
void CSD(clientStreamNode *, ClientHttpRequest *)
client stream detach
virtual void handleReply(HttpReply *header, StoreIOBuffer receivedData)=0
void CSR(clientStreamNode *, ClientHttpRequest *)
client stream read
Ssl::BumpMode sslBumpMode
ssl_bump decision (Ssl::bumpEnd if n/a).
Definition: client_side.h:304
bundles HTTP 1xx reply and the "successfully forwarded" callback
void updateError(const Error &)
if necessary, stores new error information (if any)
Definition: client_side.cc:628
bool parsingTlsHandshake
Definition: client_side.h:479
uint16_t KnownPort
validated/supported port number; these values are never zero
Definition: UriScheme.h:23
Definition: MemBuf.h:23
ServerConnectionContext(const Comm::ConnectionPointer &conn, const SBuf &post101Bytes)
Definition: client_side.h:215
CSR clientGetMoreData
Definition: client_side.h:529
bool concurrentRequestQueueFilled() const
void start() override
called by AsyncStart; do not call directly
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
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
bool preservingClientData_
whether preservedClientData is valid and should be kept up to date
Definition: client_side.h:434
void clientOpenListenSockets(void)
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
void clientConnectionsClose(void)
bool handleIdleClientPinnedTlsRead()
virtual int pipelinePrefetchMax() const
returning N allows a pipeline of 1+N requests (see pipeline_prefetch)
manages collecting and logging secrets of a TLS connection to tls_key_log
Definition: KeyLogger.h:23
int varyEvaluateMatch(StoreEntry *entry, HttpRequest *req)
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
NotePairs::Pointer notes()
void parseTlsHandshake()
Http::Stream * abortRequestParsing(const char *const errUri)
stop parsing the request and create context for relaying error info
Definition: client_side.cc:998
#define assert(EX)
Definition: assert.h:17
AsyncCall::Pointer readHandler
detects serverConnection closure
Definition: client_side.h:152
~ConnStateData() override
Definition: client_side.cc:647
bool transparent() const
void swanSong() override
Definition: client_side.cc:591
bool switchedToHttps() const
Definition: client_side.h:284
BodyPipe::Pointer expectRequestBody(int64_t size)
void buildSslCertGenerationParams(Ssl::CertificateProperties &certProperties)
const char * findTrailingHTTPVersion(const char *uriAndHTTPVersion, const char *end=nullptr)
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
bool proxyProtocolValidateClient()
void quitAfterError(HttpRequest *request)
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
ProxyProtocol::HeaderPointer proxyProtocolHeader_
the parsed PROXY protocol header
Definition: client_side.h:470
bool pinnedAuth() const
Definition: client_side.h:204
void receivedFirstByte() override
Update flags and timeout after the first byte received.
void notePinnedConnectionBecameIdle(PinnedIdleContext pic)
Called when a pinned connection becomes available for forwarding the next request.
bool switchedToHttps_
Definition: client_side.h:478
SBuf preservedClientData
Definition: client_side.h:349
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)
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"
SBuf sslCommonName_
CN name for SSL certificate generation.
Definition: client_side.h:487
void switchToHttps(ClientHttpRequest *, Ssl::BumpMode bumpServerMode)
void abortChunkedRequestBody(const err_type error)
quit on errors related to chunked request body handling
void expectNoForwarding()
cleans up virgin request [body] forwarding state
const Auth::UserRequest::Pointer & getAuth() const
Definition: client_side.h:123
bool tunnelOnError(const err_type)
initiate tunneling if possible or return false otherwise
static Comm::ConnectionPointer BorrowPinnedConnection(HttpRequest *, const AccessLogEntryPointer &)
err_type handleChunkedRequestBody()
parses available chunked encoded body bytes, checks size, returns errors
bool handleRequestBodyData()
struct ConnStateData::@36 pinning
void startPeekAndSplice()
Initializes and starts a peek-and-splice negotiation with the SSL client.
sends a single control message, notifying the Sink
friend std::ostream & operator<<(std::ostream &, const ServerConnectionContext &)
noteTakeServerConnectionControl() callback parameter
Definition: client_side.h:213
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
bool serveDelayedError(Http::Stream *)
bool handleReadData() override
void clientReadFtpData(const CommIoCbParams &io)
void afterClientRead() override
processing to be done after a Comm::Read()
void clientSetKeepaliveFlag(ClientHttpRequest *http)
decide whether to expect multiple requests on the corresponding connection
Definition: client_side.cc:674
Comm::ConnectionPointer conn_
to-server connection
Definition: client_side.h:224
const SBuf & sslCommonName() const
Definition: client_side.h:292
Error bareError
a problem that occurred without a request (e.g., while parsing headers)
Definition: client_side.h:381
void clientPostHttpsAccept(ConnStateData *)
ConnStateData(const MasterXactionPointer &xact)
std::optional< KnownPort > Port
validated/supported port number (if any)
Definition: UriScheme.h:26
RefCount< MasterXaction > MasterXactionPointer
Definition: client_side.h:45
void startShutdown() override
bool auth
pinned for www authentication
Definition: client_side.h:147
Ssl::ServerBump * serverBump()
Definition: client_side.h:285
AnyP::Port port
destination port of the request that caused serverConnection
Definition: client_side.h:145
SBuf preReadServerBytes
post-101 bytes received from the server
Definition: client_side.h:220
const char * stoppedReceiving() const
true if we stopped receiving the request
Definition: client_side.h:159
const SBuf & tlsClientSni() const
Definition: client_side.h:294
Incremental TLS/SSL Handshake parser.
Definition: Handshake.h:60
void clientProcessRequestFinished(ConnStateData *, const HttpRequest::Pointer &)
void noteMoreBodySpaceAvailable(BodyPipe::Pointer) override=0
void checkLogging()
log the last (attempt at) transaction if nobody else did
void doneWithControlMsg() override
void kick()
try to make progress on a transaction or read more I/O
Definition: client_side.cc:894
bool doneAll() const override
whether positive goal has been reached
Definition: client_side.h:239
bool isOpen() const
Definition: client_side.cc:640
void storeTlsContextToCache(const SBuf &cacheKey, Security::ContextPointer &ctx)
bool fakeAConnectRequest(const char *reason, const SBuf &payload)
CSD clientReplyDetach
Definition: client_side.h:531
void CSCB(clientStreamNode *, ClientHttpRequest *, HttpReply *, StoreIOBuffer)
client stream read callback
virtual void noteTakeServerConnectionControl(ServerConnectionContext)
Definition: client_side.h:229
an interface for those capable of configuring an ACLFilledChecklist object
Security::HandshakeParser tlsParser
Definition: client_side.h:308
void unpinConnection(const bool andClose)
Undo pinConnection() and, optionally, close the pinned connection.
void callException(const std::exception &) override
called when the job throws during an async call
Definition: client_side.cc:615
void endingShutdown() override
HttpRequest::Pointer request
to-server request that initiated serverConnection
Definition: client_side.h:188
char * host
host name of pinned connection
Definition: client_side.h:144
ClientHttpRequest * buildFakeRequest(SBuf &useHost, AnyP::KnownPort usePort, const SBuf &payload)
build a fake http request
char * prepareTlsSwitchingURL(const Http1::RequestParserPointer &hp)
void requestTimeout(const CommTimeoutCbParams &params)
Security::ContextPointer getTlsContextFromCache(const SBuf &cacheKey, const Ssl::CertificateProperties &certProperties)
bool parseProxyProtocolHeader()
bool hasNotes() const
Definition: client_side.h:358
void terminateAll(const Error &, const LogTagsErrors &) override
abort any pending transactions and prevent new ones (by closing)

 

Introduction

Documentation

Support

Miscellaneous