Closed
Bug 219376
Opened 21 years ago
Closed 21 years ago
DNS: attempting IP address resolution (Failed connections stall instead of giving Connection Failure Error; pages stop/don't finish/complete loading if ad hosts/scripts fail)
Categories
(Core :: Networking, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.6alpha
People
(Reporter: opi, Assigned: darin.moz)
References
()
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
8.39 KB,
text/plain
|
Details | |
40.15 KB,
patch
|
dougt
:
review+
bryner
:
superreview+
|
Details | Diff | Splinter Review |
If I enter an URL as IP mozilla seems to try to resolve it as name with the DNS. Also websites with links/forwards to an IP have this problem (http://www.funcomeunity.de) but then you never get an error message, that mozilla can't find the host. Since 2003091510 but I haven't tried mozilla since 2 weeks on the win95 system. Problem seems only with win95 cause no confirmation from #mozilla.de users.
Comment 1•21 years ago
|
||
could be a regression specific to Win95 from bug 205726. Can you attach a HTTP log (minimized to the failing query) via "create a new attachment" ? See instructions here: http://www.mozilla.org/projects/netlib/http/http-debugging.html Do you have a proxy configured: auto (pac) / manual ?
Keywords: regression
Reporter | ||
Comment 2•21 years ago
|
||
There is no proxy used. Used: 2003091604, have started mozilla with blank page, typed 217.160.130.21 in the url bar and closed mozilla after ok on error message.
Assignee | ||
Comment 3•21 years ago
|
||
under Win95, we just call gethostbyname. perhaps it does not support numeric addresses. indeed, MSDN has this to say about gethostbyname: The gethostbyname function cannot resolve IP address strings passed to it. Such a request is treated exactly as if an unknown host name were passed. Use inet_addr to convert an IP address string the string to an actual IP address, then use another function, gethostbyaddr, to obtain the contents of the hostent structure. oops! patch coming up... (this likely effects all WIN32 builds.)
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.6alpha
Assignee | ||
Comment 4•21 years ago
|
||
this bug does not happen under Win2k.
Comment 5•21 years ago
|
||
Nor does it happen under XP.
Assignee | ||
Comment 6•21 years ago
|
||
ok, so it seems like this bug only effects Win95 and probably derivatives like Win98, etc. i suspect most other platforms support numeric ip addresses with gethostbyname. perhaps we should add code to NSPR to handle this problem. wtc: what do you think? in the past, the necko DNS code handled this problem; however, there were things that probably never worked before (e.g., the old SOCKS code used to call PR_GetHostByName directly to resolve the SOCKS proxy host). implementing this in NSPR is going to be a little bit painful since we'll need to populate a PRHostEnt with the result of PR_StringToNetAddr :(
Reporter | ||
Comment 7•21 years ago
|
||
Verify bug on winME
Comment 8•21 years ago
|
||
Darin, needless to say, I'd like you to restore the PR_StringToNetAddr
workaround in the necko DNS code.
You wrote:
> implementing this in NSPR is going to be a little bit painful since
> we'll need to populate a PRHostEnt with the result of PR_StringToNetAddr :(
By PRHostEnt, you really meant PRAddrInfo, right?
Assignee | ||
Comment 9•21 years ago
|
||
wtc: no, i meant PRHostEnt, implying that the change would effect PR_GetHostByName, which PR_GetAddrInfoByName calls under Win9x :) ok, i will write up a patch for necko. i just thought it would be good to fix this in NSPR instead so that PR_GetHostByName and friends behave similarly ("port-ably") on all platforms.
Comment 10•21 years ago
|
||
Darin, could you outline how you'd implement this in PR_GetHostByName and friends? Would you modify PR_GetAddrInfoByName, too, and why (or why not)?
Assignee | ||
Comment 11•21 years ago
|
||
*** Bug 219449 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 12•21 years ago
|
||
wtc: for windows only, i would call PR_StringToNetAddr up at the top of PR_GetHostByName (and probably also PR_GetIPNodeByName), and then i would copy the result into the PRHostEnt buffer and return. no change would be necessary to PR_GetAddrInfoByName since it either uses PR_GetHostByName or getaddrinfo. however, that said, i do have a patch which modifies necko to always call PR_StringToNetAddr before calling PR_GetAddrInfoByName. it required me to make some hefty changes to the necko host resolver code in order to support two kinds of resulting data structures (PRAddrInfo and PRNetAddr) accessible via the nsIDNSRecord interface.
Assignee | ||
Comment 13•21 years ago
|
||
ok, this is the patch i mentioned that solves the bug by making necko call PR_StringToNetAddr before PR_GetAddrInfoByName. unfortunately, the changes are non-trivial, but this did give me the opportunity to eliminate nsAddrInfo in favor of just exposing nsHostRecord directly to the nsDNSService implementation.
Assignee | ||
Updated•21 years ago
|
Attachment #131919 -
Flags: review?(dougt)
Assignee | ||
Updated•21 years ago
|
Attachment #131919 -
Flags: superreview?(bryner)
Comment 14•21 years ago
|
||
*** Bug 220498 has been marked as a duplicate of this bug. ***
Comment 15•21 years ago
|
||
The patch didn't apply cleanly for me. + PRBool HasResult() const { return (addrinfo || addr) != nsnull; } Instead of two compares, you could OR these values and do one compare against zero;
Assignee | ||
Comment 16•21 years ago
|
||
yeah, i'm not surprised the patch has bit-rotted. i'll post a new patch. >+ PRBool HasResult() const { return (addrinfo || addr) != nsnull; } > >Instead of two compares, you could OR these values and do one compare against >zero; isn't that what i am doing?
Assignee | ||
Comment 17•21 years ago
|
||
revised patch; up-to-date.. should apply cleanly. note: it appears that a temporary fix to this bug actually got mistakenly checked into the tree. it was a solution that i rejected in favor of this patch, but i must have left it in my tree and checked it in along with other changes to nsSocketTransport2.cpp. i think that explains the merge conflict. at any rate, this patch actually backs out that fix and replaces it with this fix. the "bad" fix was only a few lines in nsSocketTransport2.cpp.
Attachment #131919 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #131919 -
Flags: superreview?(bryner)
Attachment #131919 -
Flags: review?(dougt)
Assignee | ||
Comment 18•21 years ago
|
||
Comment on attachment 132718 [details] [diff] [review] v1.1 patch dougt: can you please review this patch. thx!
Attachment #132718 -
Flags: review?(dougt)
Assignee | ||
Updated•21 years ago
|
Attachment #132718 -
Flags: superreview?(bryner)
Comment 19•21 years ago
|
||
*** Bug 219657 has been marked as a duplicate of this bug. ***
Comment 20•21 years ago
|
||
*** Bug 219150 has been marked as a duplicate of this bug. ***
Comment 21•21 years ago
|
||
-------------------------------------------------- + if (addr->raw.family == PR_AF_INET) + addr->inet.port = htons(port); + else + addr->ipv6.port = htons(port); -------------------------------------------------- Just a note: This wouldn't compile in VC++ 6 SP5. d:/Mozilla/mozilla/netwerk/dns/src/nsDNSService2.cpp(115) : error C2065: 'htons' : undeclared identifier But, changing it to allowed it to build and test fine: -------------------------------------------------- + if (addr->raw.family == PR_AF_INET) + addr->inet.port = PR_htons(port); + else + addr->ipv6.port = PR_htons(port); --------------------------------------------------
Comment 22•21 years ago
|
||
do you need the null check here? most of the delete/free things check for null themselves. + if (addr) + free(addr); other than that and the htons thing we mentioned earlier, this looks good to me - r=bienvenu
Updated•21 years ago
|
Summary: Trying to resolve IP's via DNS → Trying to resolve IP's via DNS (Failed connections stall instead of giving Connection Failure Error; pages stop/don't finish/complete loading if ad hosts/scripts fail)
Comment 23•21 years ago
|
||
the other question I had has to do with this code: NS_IMETHODIMP nsDNSRecord::HasMore(PRBool *result) { - *result = !mDone; + if (mDone) + *result = PR_FALSE; + else { + // unfortunately, NSPR does not provide a way for us to determine if + // there is another address other than to simply get the next address. + void *iterCopy = mIter; + PRNetAddr addr; + *result = NS_SUCCEEDED(GetNextAddr(0, &addr)); + mIter = iterCopy; // backup iterator + mDone = PR_FALSE; + } mDone is already false when we get here - can it be cleared somehow?
Assignee | ||
Comment 24•21 years ago
|
||
bienvenu: thx for the review :)
i've heard it said that on some platforms free(0) crashes. it seems bogus
because i think ANSI-C allows free(0), but alecf warned me that it can happen.
>mDone is already false when we get here - can it be cleared somehow?
i don't understand the question. mDone may be set to PR_TRUE inside
GetNextAddr, so we need to reset it to the value it held when we entered this
block. same goes for rolling back mIter.
Comment 25•21 years ago
|
||
>mDone may be set to PR_TRUE inside GetNextAddr,
that's what I meant by "cleared somewhere" - thx, that answers my question.
Updated•21 years ago
|
Attachment #132718 -
Flags: superreview?(bryner) → superreview+
Updated•21 years ago
|
Attachment #132718 -
Flags: review?(dougt) → review+
Assignee | ||
Comment 26•21 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
*** Bug 220409 has been marked as a duplicate of this bug. ***
Comment 28•21 years ago
|
||
Working for me! 2003100711 on XP. Woho!
Reporter | ||
Comment 29•21 years ago
|
||
Ok, works on win95 (Should I mark bug as verified?)
Comment 30•21 years ago
|
||
*** Bug 226328 has been marked as a duplicate of this bug. ***
Comment 31•21 years ago
|
||
Alexander: please assign qa to yourself and verify. Darin: this fix was purely Win 95/98/ME, right?
Summary: Trying to resolve IP's via DNS (Failed connections stall instead of giving Connection Failure Error; pages stop/don't finish/complete loading if ad hosts/scripts fail) → DNS: attempting IP address resolution (Failed connections stall instead of giving Connection Failure Error; pages stop/don't finish/complete loading if ad hosts/scripts fail)
Assignee | ||
Comment 32•21 years ago
|
||
benc: yes, the original problem was Win9x specific, but the solution (the patch) affected all platforms. it is possible that other platforms might behave like Win9x, but that theory is untested.
Assignee | ||
Comment 33•21 years ago
|
||
*** Bug 219150 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•