]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/client_side.h
Merged from trunk rev.13515
[thirdparty/squid.git] / src / client_side.h
index c24255289b87b6755caa7d4023be2b4b27dd4259..d3607f985c385738ac4ed2c412a81dfbc4f9a698 100644 (file)
@@ -78,6 +78,12 @@ class PortCfg;
  *
  * The individual processing actions are done by other Jobs which we
  * kick off as needed.
+ *
+ * XXX: If an async call ends the ClientHttpRequest job, ClientSocketContext
+ * (and ConnStateData) may not know about it, leading to segfaults and
+ * assertions like areAllContextsForThisConnection(). This is difficult to fix
+ * because ClientHttpRequest lacks a good way to communicate its ongoing
+ * destruction back to the ClientSocketContext which pretends to "own" *http.
  */
 class ClientSocketContext : public RefCountable
 {
@@ -91,7 +97,7 @@ public:
     void keepaliveNextRequest();
 
     Comm::ConnectionPointer clientConnection; /// details about the client connection socket.
-    ClientHttpRequest *http;   /* we own this */
+    ClientHttpRequest *http;   /* we pretend to own that job */
     HttpReply *reply;
     char reqbuf[HTTP_REQBUF_SZ];
     Pointer next;
@@ -268,7 +274,7 @@ public:
     } pinning;
 
     /// Squid listening port details where this connection arrived.
-    AnyP::PortCfg *port;
+    AnyP::PortCfgPointer port;
 
     bool transparent() const;
     bool reading() const;
@@ -374,6 +380,10 @@ public:
     bool switchedToHttps() const { return false; }
 #endif
 
+    /* clt_conn_tag=tag annotation access */
+    const SBuf &connectionTag() const { return connectionTag_; }
+    void connectionTag(const char *aTag) { connectionTag_ = aTag; }
+
 protected:
     void startDechunkingRequest();
     void finishDechunkingRequest(bool withSuccess);
@@ -416,6 +426,8 @@ private:
     AsyncCall::Pointer reader; ///< set when we are reading
     BodyPipe::Pointer bodyPipe; // set when we are reading request body
 
+    SBuf connectionTag_; ///< clt_conn_tag=Tag annotation for client connection
+
     CBDATA_CLASS2(ConnStateData);
 };