Closed
Bug 815989
Opened 12 years ago
Closed 12 years ago
resolve() from nsIDNSService return null on Firefox 18 B1
Categories
(Firefox :: Untriaged, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: cye3s, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 Build ID: 20121119183901 Steps to reproduce: 1.about:config and set "devtools.chrome.enabled" to true 2.Shift+F4, open Scratchpad , Alt+N to open menu ,set to "Browser" 3.paste this code: cls = Components.classes['@mozilla.org/network/dns-service;1']; iface = Components.interfaces.nsIDNSService; dns = cls.getService(iface); var a = new Array(); try { var nsrecord = dns.resolve(dns.myHostName, 0); while (nsrecord.hasMore()) { a[a.length] = nsrecord.getNextAddrAsString(); } } catch (e) { } localip = a.join(" | "); 4.press Ctrl+L Actual results: return empty string: /* */ Expected results: This code works fine on 16.0.2: /* xxx.xxx.xxx.xxx(My Local IP) | 192.168.56.1 |.... */
Comment 1•12 years ago
|
||
Sync resolve from main thread has been disabled. Try: cls = Components.classes['@mozilla.org/network/dns-service;1']; iface = Components.interfaces.nsIDNSService; dns = cls.getService(iface); var a = new Array(); var listener = { onLookupComplete: function(request, record, status) { try { while (record.hasMore()) { a[a.length] = record.getNextAddrAsString(); } } catch (e) { a.push(e); } alert(a.join(" | ")); }, QueryInterface: function(aIID) { if (aIID.equals(Ci.nsIDNSListener) || aIID.equals(Ci.nsISupports)) { return this; } throw Cr.NS_ERROR_NO_INTERFACE; } }; var threadManager = Cc["@mozilla.org/thread-manager;1"]; var mainThread = threadManager.getService(Ci.nsIThreadManager); dns.asyncResolve(dns.myHostName, 0, listener, mainThread.currentThread);
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•