mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 01:10:22 +00:00
Fix for bug 103991, removing obsolete IsAsciiString() function from nsHttpChannel and nsDnsService. r=nhotta, sr=darin.
This commit is contained in:
parent
a4dffeca06
commit
7f7c3b76a7
@ -1125,16 +1125,6 @@ nsDNSService::ExpirationInterval()
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsDNSService::IsAsciiString(const char *s)
|
||||
{
|
||||
for (const char *c = s; *c; c++) {
|
||||
if (!nsCRT::IsAscii(*c)) return PR_FALSE;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#define NETWORK_DNS_CACHE_ENTRIES "network.dnsCacheEntries"
|
||||
#define NETWORK_DNS_CACHE_EXPIRATION "network.dnsCacheExpiration"
|
||||
#define NETWORK_ENABLEIDN "network.enableIDN"
|
||||
@ -1395,7 +1385,7 @@ nsDNSService::Lookup(const char* hostName,
|
||||
|
||||
nsDNSLookup *lookup = nsnull;
|
||||
// IDN handling
|
||||
if (mIDNConverter && !IsAsciiString(hostName)) {
|
||||
if (mIDNConverter && !nsCRT::IsAscii(hostName)) {
|
||||
nsXPIDLCString hostNameACE;
|
||||
rv = mIDNConverter->UTF8ToIDNHostName(hostName, getter_Copies(hostNameACE));
|
||||
if (!hostNameACE.get()) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -96,10 +96,6 @@ public:
|
||||
|
||||
static nsDNSService * gService;
|
||||
|
||||
// helper method to check for non-Ascii hostnames (should really be in
|
||||
// nsCRT or something)
|
||||
static PRBool IsAsciiString(const char *s);
|
||||
|
||||
private:
|
||||
nsresult LateInit();
|
||||
nsresult InstallPrefObserver();
|
||||
|
@ -136,7 +136,7 @@ nsHttpChannel::Init(nsIURI *uri,
|
||||
|
||||
nsCOMPtr<nsIIDNService> converter;
|
||||
if ((converter = nsHttpHandler::get()->IDNConverter()) &&
|
||||
!IsAsciiString(host))
|
||||
!nsCRT::IsAscii(host))
|
||||
{
|
||||
nsXPIDLCString hostACE;
|
||||
rv = converter->UTF8ToIDNHostName(host.get(), getter_Copies(hostACE));
|
||||
@ -1658,15 +1658,6 @@ nsHttpChannel::GetCurrentPath(char **path)
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsHttpChannel::IsAsciiString(const char *s)
|
||||
{
|
||||
for (const char *c = s; *c; c++) {
|
||||
if (!nsCRT::IsAscii(*c)) return PR_FALSE;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// nsHttpChannel::nsISupports
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -118,9 +118,6 @@ private:
|
||||
static void *PR_CALLBACK AsyncRedirect_EventHandlerFunc(PLEvent *);
|
||||
static void PR_CALLBACK AsyncRedirect_EventCleanupFunc(PLEvent *);
|
||||
|
||||
// Helper to detect non-Ascii hostnames (should be provided somewhere else)
|
||||
static PRBool IsAsciiString(const char *c);
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIURI> mOriginalURI;
|
||||
nsCOMPtr<nsIURI> mURI;
|
||||
|
Loading…
x
Reference in New Issue
Block a user