Fixes bug

This commit is contained in:
dougt%netscape.com 2001-06-06 00:02:56 +00:00
parent f864ebcadb
commit d3be11ab85

View File

@ -533,17 +533,6 @@ nsLDAPChannel::AsyncOpen(nsIStreamListener* aListener,
nsXPIDLCString host;
PRInt32 port;
// save off the args
//
mResponseContext = aCtxt;
mUnproxiedListener = aListener;
// add ourselves to the appropriate loadgroup
//
if (mLoadGroup) {
mLoadGroup->AddRequest(this, mResponseContext);
}
// slurp out relevant pieces of the URL
//
rv = mURI->GetHost(getter_Copies(host));
@ -557,10 +546,24 @@ nsLDAPChannel::AsyncOpen(nsIStreamListener* aListener,
NS_ERROR("nsLDAPChannel::AsyncRead(): mURI->GetPort failed\n");
return NS_ERROR_FAILURE;
}
if (port == -1)
port = LDAP_PORT;
rv = NS_CheckPortSafety(port, "ldap");
if (NS_FAILED(rv))
return rv;
// save off the args
//
mResponseContext = aCtxt;
mUnproxiedListener = aListener;
// add ourselves to the appropriate loadgroup
//
if (mLoadGroup) {
mLoadGroup->AddRequest(this, mResponseContext);
}
// we don't currently allow for a default host
//
if (nsCRT::strlen(host) == 0)