Bug 299458 - Resolve hostnames to IP async.
ChatZilla only. r=rginda a=bsmedberg git-svn-id: svn://10.0.0.236/trunk@176673 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f1dff03c8c
commit
b1a12d3b4f
@ -116,11 +116,20 @@ function dcc_addfile(user, port, file, size)
|
||||
CIRCDCC.prototype.addHost =
|
||||
function dcc_addhost(host, auth)
|
||||
{
|
||||
try {
|
||||
var dnsRecord = this._dnsSvc.resolve(host, false);
|
||||
var me = this;
|
||||
var listener = {
|
||||
onLookupComplete: function _onLookupComplete(request, record, status) {
|
||||
// record == null if it failed. We can't do anything with a failure.
|
||||
if (record)
|
||||
{
|
||||
while (record.hasMore())
|
||||
me.addIP(record.getNextAddrAsString(), auth);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
while (dnsRecord.hasMore())
|
||||
this.addIP(dnsRecord.getNextAddrAsString(), auth);
|
||||
try {
|
||||
var dnsRecord = this._dnsSvc.asyncResolve(host, false, listener, null);
|
||||
} catch (ex) {
|
||||
dd("Error resolving host to IP: " + ex);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user