[tbb-commits] [tor-browser/tor-browser-45.4.0esr-6.5-1] Bug 1311044 - show error when connection to domain socket is failed; r=bagder

gk at torproject.org gk at torproject.org
Tue Oct 25 06:37:49 UTC 2016


commit b91682cd038d63eb2dbec1303c2ab9a65a43775b
Author: Liang-Heng Chen <xeonchen at mozilla.com>
Date:   Wed Oct 19 18:28:02 2016 +0800

    Bug 1311044 - show error when connection to domain socket is failed; r=bagder
    
    MozReview-Commit-ID: GtqKiMVwQyX
    
    --HG--
    extra : rebase_source : 04e3b258f06e7d3e196c241c96aa3cc92ec334da
---
 netwerk/socket/nsSOCKSIOLayer.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/netwerk/socket/nsSOCKSIOLayer.cpp b/netwerk/socket/nsSOCKSIOLayer.cpp
index be69725..d20fe7f 100644
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -515,10 +515,16 @@ nsSOCKSSocketInfo::ConnectToProxy(PRFileDesc *fd)
         status = fd->lower->methods->connect(fd->lower, &prProxy, mTimeout);
         if (status != PR_SUCCESS) {
             PRErrorCode c = PR_GetError();
+
             // If EINPROGRESS, return now and check back later after polling
             if (c == PR_WOULD_BLOCK_ERROR || c == PR_IN_PROGRESS_ERROR) {
                 mState = SOCKS_CONNECTING_TO_PROXY;
                 return status;
+            } else if (IsHostDomainSocket()) {
+                LOGERROR(("socks: connect to domain socket failed (%d)", c));
+                PR_SetError(PR_CONNECT_REFUSED_ERROR, 0);
+                mState = SOCKS_FAILED;
+                return status;
             }
         }
     } while (status != PR_SUCCESS);



More information about the tbb-commits mailing list