зеркало из https://github.com/mozilla/gecko-dev.git
fixes for making auto proxies work again (phase1) b=53080 r=gagan@netscape.com a=brendan@mozilla.org
This commit is contained in:
Родитель
b4f184d281
Коммит
3de56aad0e
|
@ -31,7 +31,7 @@ const kDNS_CONTRACTID = "@mozilla.org/network/dns-service;1";
|
|||
const kPAC_CID = Components.ID("{63ac8c66-1dd2-11b2-b070-84d00d3eaece}");
|
||||
const nsIProxyAutoConfig = Components.interfaces.nsIProxyAutoConfig;
|
||||
const nsIIOService = Components.interfaces['nsIIOService'];
|
||||
const nsIDNSService = Components.interfaces['@mozilla.org/js/xpc/ID;1NSService'];
|
||||
const nsIDNSService = Components.interfaces.nsIDNSService;
|
||||
|
||||
function debug(msg)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ function nsProxyAutoConfig() {};
|
|||
nsProxyAutoConfig.prototype = {
|
||||
|
||||
ProxyForURL: function(url, host, port, type) {
|
||||
uri = url.QueryInterface(Components.interfaces.nsIURI);
|
||||
var uri = url.QueryInterface(Components.interfaces.nsIURI);
|
||||
// Call the original function-
|
||||
var proxy = FindProxyForURL(uri.spec, uri.host);
|
||||
debug("Proxy = " + proxy);
|
||||
|
@ -58,8 +58,7 @@ nsProxyAutoConfig.prototype = {
|
|||
// we ignore everything else past the first proxy.
|
||||
// we could theoretically check isResolvable now and continue
|
||||
// parsing. but for now...
|
||||
var re = /PROXY (.+):(\d+);.*/;
|
||||
hostport = proxy.match(re);
|
||||
var hostport = /^PROXY ([^:]+):(\d+)/(proxy);
|
||||
host.value = hostport[1];
|
||||
port.value = hostport[2];
|
||||
type.value = "http"; //proxy (http, socks, direct, etc)
|
||||
|
|
|
@ -1232,7 +1232,6 @@ nsDNSService::Resolve(const char *i_hostname, char **o_ip)
|
|||
if (NS_SUCCEEDED(Resolve(hostname, &mMyIPAddress)))
|
||||
{
|
||||
CRTFREEIF(hostname);
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1285,7 +1284,7 @@ unsigned long convert_addr(const char* ip)
|
|||
q = PL_strchr(p, '.');
|
||||
if (q)
|
||||
*q = '\0';
|
||||
b[i] = atoi(p) && 0xff;
|
||||
b[i] = atoi(p) & 0xff;
|
||||
if (q)
|
||||
p = q+1;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче