You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/07/25 18:07:57 UTC

[trafficserver] branch 7.1.x updated: Revert "Do not do DNS to origin if the object is HIT-STALE and parent exists"

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new f2fd682  Revert "Do not do DNS to origin if the object is HIT-STALE and parent exists"
f2fd682 is described below

commit f2fd682d7e300bfad3457b0446a81e5d4f708ca5
Author: Leif Hedstrom <le...@ogre.com>
AuthorDate: Wed Jul 25 11:07:40 2018 -0700

    Revert "Do not do DNS to origin if the object is HIT-STALE and parent exists"
    
    This reverts commit e461e941bfef31153fd8e3ea1f1c3755c891d992.
---
 proxy/http/HttpTransact.cc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index c7291c8..ace91d8 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -2464,7 +2464,16 @@ HttpTransact::HandleCacheOpenReadHitFreshness(State *s)
     SET_VIA_STRING(VIA_CACHE_RESULT, VIA_IN_CACHE_STALE);
   }
 
-  TRANSACT_RETURN(SM_ACTION_API_CACHE_LOOKUP_COMPLETE, HttpTransact::HandleCacheOpenReadHit);
+  if (!s->force_dns) { // If DNS is not performed before
+    if (need_to_revalidate(s)) {
+      TRANSACT_RETURN(SM_ACTION_API_CACHE_LOOKUP_COMPLETE,
+                      CallOSDNSLookup); // content needs to be revalidated and we did not perform a dns ....calling DNS lookup
+    } else {                            // document can be served can cache
+      TRANSACT_RETURN(SM_ACTION_API_CACHE_LOOKUP_COMPLETE, HttpTransact::HandleCacheOpenReadHit);
+    }
+  } else { // we have done dns . Its up to HandleCacheOpenReadHit to decide to go OS or serve from cache
+    TRANSACT_RETURN(SM_ACTION_API_CACHE_LOOKUP_COMPLETE, HttpTransact::HandleCacheOpenReadHit);
+  }
 }
 
 ///////////////////////////////////////////////////////////////////////////////