]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/client_side_reply.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / client_side_reply.h
index 25b83a2a9e8eeae48e68488af8ee6d39d154f009..8678f538bdbd063a5eb4ca00605e9e76170d1b7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -74,9 +74,15 @@ public:
 
     /* state variable - replace with class to handle storeentries at some point */
     int lookingforstore;
+
+    /* StoreClient API */
     virtual void created (StoreEntry *newEntry);
+    virtual LogTags *loggingTags();
 
     ClientHttpRequest *http;
+    /// Base reply header bytes received from Store.
+    /// Compatible with ClientHttpRequest::Out::offset.
+    /// Not to be confused with ClientHttpRequest::Out::headers_sz.
     int headers_sz;
     store_client *sc;       /* The store_client we're using */
     StoreIOBuffer tempBuffer;   /* For use in validating requests via IMS */
@@ -99,6 +105,9 @@ public:
     clientStreamNode *ourNode;  /* This will go away if/when this file gets refactored some more */
 
 private:
+    /* StoreClient API */
+    virtual void fillChecklist(ACLFilledChecklist &) const;
+
     clientStreamNode *getNextNode() const;
     void makeThisHead();
     bool errorInStream(StoreIOBuffer const &result, size_t const &sizeToProcess)const ;
@@ -109,13 +118,13 @@ private:
     HttpReply *reply;
     void processReplyAccess();
     static ACLCB ProcessReplyAccessResult;
-    void processReplyAccessResult(const allow_t &accessAllowed);
+    void processReplyAccessResult(const Acl::Answer &accessAllowed);
     void cloneReply();
     void buildReplyHeader ();
     bool alwaysAllowResponse(Http::StatusCode sline) const;
     int checkTransferDone();
     void processOnlyIfCachedMiss();
-    void processConditional(StoreIOBuffer &result);
+    bool processConditional(StoreIOBuffer &result);
     void cacheHit(StoreIOBuffer result);
     void handleIMSReply(StoreIOBuffer result);
     void sendMoreData(StoreIOBuffer result);
@@ -131,8 +140,20 @@ private:
     void sendNotModifiedOrPreconditionFailedError();
 
     StoreEntry *old_entry;
-    store_client *old_sc;   /* ... for entry to be validated */
+    /* ... for entry to be validated */
+    store_client *old_sc;
+    time_t old_lastmod;
+    String old_etag;
+
     bool deleting;
+
+    typedef enum {
+        crNone = 0, ///< collapsed revalidation is not allowed for this context
+        crInitiator, ///< we initiated collapsed revalidation request
+        crSlave ///< we collapsed on the existing revalidation request
+    } CollapsedRevalidation;
+
+    CollapsedRevalidation collapsedRevalidation;
 };
 
 #endif /* SQUID_CLIENTSIDEREPLY_H */