]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: shuffle HttpRequest::inheritProperties next to clone()
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 18 May 2011 12:50:48 +0000 (00:50 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 18 May 2011 12:50:48 +0000 (00:50 +1200)
Making it a bit easier to see exactly what fields are duplicated and which
are not.

src/HttpRequest.cc

index 5cfe284de2c96af1287f16cd369b0c8618986f7a..580938159bb2bd9e24f6c7e1748dc7de9c89e4be 100644 (file)
@@ -229,6 +229,45 @@ HttpRequest::clone() const
     return copy;
 }
 
+bool
+HttpRequest::inheritProperties(const HttpMsg *aMsg)
+{
+    const HttpRequest* aReq = dynamic_cast<const HttpRequest*>(aMsg);
+    if (!aReq)
+        return false;
+
+    client_addr = aReq->client_addr;
+#if FOLLOW_X_FORWARDED_FOR
+    indirect_client_addr = aReq->indirect_client_addr;
+#endif
+#if USE_SQUID_EUI
+    client_eui48 = aReq->client_eui48;
+    client_eui64 = aReq->client_eui64;
+#endif
+    my_addr = aReq->my_addr;
+
+    dnsWait = aReq->dnsWait;
+
+#if USE_ADAPTATION
+    adaptHistory_ = aReq->adaptHistory();
+#endif
+#if ICAP_CLIENT
+    icapHistory_ = aReq->icapHistory();
+#endif
+
+    // This may be too conservative for the 204 No Content case
+    // may eventually need cloneNullAdaptationImmune() for that.
+    flags = aReq->flags.cloneAdaptationImmune();
+
+    errType = aReq->errType;
+    errDetail = aReq->errDetail;
+#if USE_AUTH
+    auth_user_request = aReq->auth_user_request;
+#endif
+    clientConnectionManager = aReq->clientConnectionManager;
+    return true;
+}
+
 /**
  * Checks the first line of an HTTP request is valid
  * currently just checks the request method is present.
@@ -604,45 +643,8 @@ HttpRequest::conditional() const
            header.has(HDR_IF_NONE_MATCH);
 }
 
-bool HttpRequest::inheritProperties(const HttpMsg *aMsg)
-{
-    const HttpRequest* aReq = dynamic_cast<const HttpRequest*>(aMsg);
-    if (!aReq)
-        return false;
-
-    client_addr = aReq->client_addr;
-#if FOLLOW_X_FORWARDED_FOR
-    indirect_client_addr = aReq->indirect_client_addr;
-#endif
-#if USE_SQUID_EUI
-    client_eui48 = aReq->client_eui48;
-    client_eui64 = aReq->client_eui64;
-#endif
-    my_addr = aReq->my_addr;
-
-    dnsWait = aReq->dnsWait;
-
-#if USE_ADAPTATION
-    adaptHistory_ = aReq->adaptHistory();
-#endif
-#if ICAP_CLIENT
-    icapHistory_ = aReq->icapHistory();
-#endif
-
-    // This may be too conservative for the 204 No Content case
-    // may eventually need cloneNullAdaptationImmune() for that.
-    flags = aReq->flags.cloneAdaptationImmune();
-
-    errType = aReq->errType;
-    errDetail = aReq->errDetail;
-#if USE_AUTH
-    auth_user_request = aReq->auth_user_request;
-#endif
-    clientConnectionManager = aReq->clientConnectionManager;
-    return true;
-}
-
-void HttpRequest::recordLookup(const DnsLookupDetails &dns)
+void
+HttpRequest::recordLookup(const DnsLookupDetails &dns)
 {
     if (dns.wait >= 0) { // known delay
         if (dnsWait >= 0) // have recorded DNS wait before