]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3301: ERR_DNS_FAIL never shown
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Sat, 27 Aug 2011 08:54:25 +0000 (11:54 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Sat, 27 Aug 2011 08:54:25 +0000 (11:54 +0300)
Latest squid never shows DNS errors for user. When the user tries to retrieve
web page from non-existent domain, ERR_CANNOT_FORWARD error appears,
which misleads both user and administrator.

src/forward.cc

index 15247665f62808604560be14599fa476deda8a03..941418c5b1264ea041546e4e6e4694b616ed9079 100644 (file)
@@ -303,13 +303,13 @@ FwdState::startConnectionOrFail()
 
         connectStart();
     } else {
-        debugs(17, 3, HERE << entry->url());
-        ErrorState *anErr = NULL;
-        if (err) {
+        debugs(17, 3, HERE << "Connection failed: " << entry->url());
+        if (!err) {
+            ErrorState *anErr = NULL;
             anErr = errorCon(ERR_CANNOT_FORWARD, HTTP_INTERNAL_SERVER_ERROR, request);
             anErr->xerrno = errno;
+            fail(anErr);
         } // else use actual error from last connection attempt
-        fail(anErr);
         self = NULL;       // refcounted
     }
 }