Ticket #11183: Don-t-prohibit-name-lookups-with-socks_remote_dns-tr.patch

File Don-t-prohibit-name-lookups-with-socks_remote_dns-tr.patch, 2.1 KB (added by dcf, 4 years ago)

Patch to re-enable extra-proxy DNS lookups in Tor Browser.

  • netwerk/dns/nsDNSService2.cpp

    From f21c9bdeca43eaa82f7e48b44c3cbcf5a1337067 Mon Sep 17 00:00:00 2001
    From: David Fifield <david@bamsoftware.com>
    Date: Sat, 15 Mar 2014 04:50:46 +0000
    Subject: [PATCH] Don't prohibit name lookups with socks_remote_dns=true.
    
    This partially undoes 5069a3ee8fa51546a8ad582e6004be66bc9748aa. The
    purpose is to see whether that commit made it impossible to use an
    nsIProxyInfo with type=="direct", as is needed for the meek HTTP helper
    extension.
    ---
     netwerk/dns/nsDNSService2.cpp |    8 ++++++--
     1 file changed, 6 insertions(+), 2 deletions(-)
    
    diff --git a/netwerk/dns/nsDNSService2.cpp b/netwerk/dns/nsDNSService2.cpp
    index 9af2652..5386fd7 100644
    a b  
    33 * License, v. 2.0. If a copy of the MPL was not distributed with this
    44 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    55
     6#include <stdio.h>
     7
    68#include "nsDNSService2.h"
    79#include "nsIDNSRecord.h"
    810#include "nsIDNSListener.h"
    nsDNSService::AsyncResolve(const nsACString &hostname, 
    612614        if (mDisableDNS) {
    613615            // Allow IP lookups through, but nothing else.
    614616            if (PR_StringToNetAddr(hostname.BeginReading(), &tempAddr) != PR_SUCCESS) {
    615                 return NS_ERROR_UNKNOWN_PROXY_HOST; // XXX: NS_ERROR_NOT_IMPLEMENTED?
     617                fprintf(stderr, "Would NS_ERROR_UNKNOWN_PROXY_HOST on \"%s\" in AsyncResolve.\n", PromiseFlatCString(hostname).get());
     618                // return NS_ERROR_UNKNOWN_PROXY_HOST; // XXX: NS_ERROR_NOT_IMPLEMENTED?
    616619            }
    617620        }
    618621
    nsDNSService::Resolve(const nsACString &hostname, 
    732735    if (mDisableDNS) {
    733736        // Allow IP lookups through, but nothing else.
    734737        if (PR_StringToNetAddr(hostname.BeginReading(), &tempAddr) != PR_SUCCESS) {
    735             return NS_ERROR_UNKNOWN_PROXY_HOST; // XXX: NS_ERROR_NOT_IMPLEMENTED?
     738            fprintf(stderr, "Would NS_ERROR_UNKNOWN_PROXY_HOST on \"%s\" in Resolve.\n", PromiseFlatCString(hostname).get());
     739            // return NS_ERROR_UNKNOWN_PROXY_HOST; // XXX: NS_ERROR_NOT_IMPLEMENTED?
    736740        }
    737741    }
    738742