зеркало из https://github.com/mozilla/pjs.git
Bug 299458 - Resolve hostnames to IP async.
ChatZilla only. r=rginda a=bsmedberg
This commit is contained in:
Родитель
826e524f81
Коммит
332650385b
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче