Closed Bug 180494 Opened 22 years ago Closed 22 years ago

apparent code error in netwerk/dns/src/nsDnsService.cpp

Categories

(Core :: Networking, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: nate, Assigned: darin.moz)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021029 Phoenix/0.4
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021029 Phoenix/0.4

I've been having problems with slow DNS lookups, and spent a little
time wandering through the DNS code trying to figure out how it works.

While reading through netwerk/dns/src/nsDnsService.cpp I found what looks
to be a simple code error.  I have no idea if it is related to my problem,
but likes like it should be fixed.

873     if (PR_SUCCESS != status) {
874         if (nsDNSService::Reset());
875             status = DoSyncLookupInternal();
876     }

It looks like there is an extra semicolon at the end of line 874.  As a 
result, the call to DoSyncLookupInternal() will occur whether regardless of
the return value from Reset().  Or perhaps this is just a indent error
and the if() is redundant?  In any case, it is either wrong or misleading, ad
someone with knowledge should check this.


Reproducible: Always

Steps to Reproduce:




Looks like the code is question came about regarding bug #117628.
yep
Assignee: new-network-bugs → darin
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch v1 patchSplinter Review
yup, the extra semicolon is a typo.  i don't think this "bug" would actually
manifest itself in any kind of real problem though, but thanks for catching it!
Attachment #106510 - Flags: superreview?(bzbarsky)
Attachment #106510 - Flags: review?(bbaetz)
Attachment #106510 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 106510 [details] [diff] [review]
v1 patch

This would cause a slowdown if the dns request failed and we couldn't reset teh
dnsservice. Looking at code, that would mainly affect non-unix plaftorms. ITs
an uncommon case, anyway.

But hey, its a bug ;)
Attachment #106510 - Flags: review?(bbaetz) → review+
fixed-on-trunk
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: