gecko/netwerk/dns
Nicholas Nethercote bfd5398e4f Bug 1124973 (part 3) - Use PL_DHashTableSearch() in nsHostResolver.cpp. r=froydnj,sworkman.
Currently nsHostResolver.cpp uses PL_DHashTableLookup() and fails to use
PL_DHASH_ENTRY_IS_{FREE,BUSY} on the result the way it should. However, I think
it gets away with this because it always does this on the result:

  if (!he || !he->rec) { /* do stuff with |he->rec| */ }

The |!he| test is useless and always fails, but the |!he->rec| does the right
thing because (a) entry storage is always zeroed when the table is created, (b)
HostDB_ClearEntry() zeroes the |rec| field (via NS_RELEASE). So unused entries
always have a null |rec| field.

Furthermore, |he->rec| is never zero in a used entry because HostDB_InitEntry
always assigns it with a nsHostRecord assigned with infallible new in
nsHostRecord::Create (and there are existing assertions to this effect).

All this means that when this patch switches PL_DHashTableLookup to
PL_DHashTableSearch it can drop the |!he->rec| test and just do this:

  if (!he) { /* do stuff with |he->rec| */ }

Finally, there's a comment about HostDB_InitEntry failing which is bogus
because HostDB_InitEntry cannot fail. This patch fixes that too.

--HG--
extra : rebase_source : ded6f8ff404cb160d89bbe7deeb3b863249bdb94
2015-01-22 21:25:44 -08:00
..
ChildDNSService.cpp
ChildDNSService.h
DNS.cpp Bug 1067679 - Call DnsQuery in addition to getaddrinfo to get DNS TTL on Windows r=sworkman 2014-09-20 15:10:18 -07:00
DNS.h Bug 1067679 - Call DnsQuery in addition to getaddrinfo to get DNS TTL on Windows r=sworkman 2014-09-20 15:10:18 -07:00
DNSListenerProxy.cpp
DNSListenerProxy.h
DNSRequestChild.cpp
DNSRequestChild.h
DNSRequestParent.cpp
DNSRequestParent.h Bug 1117042 - Mark virtual overridden functions as MOZ_OVERRIDE in netwerk; r=mcmanus 2015-01-02 09:04:04 -05:00
effective_tld_names.dat Bug 1114762 - New TLD additions for TLDs contracted with ICANN through 12/22/2014 2014-12-29 12:50:22 -08:00
GetAddrInfo.cpp Bug 806819 - Part 3: Remove redundant FORCE_PR_LOG entries. r=ehsan 2014-10-08 13:17:32 -07:00
GetAddrInfo.h Bug 1115219 - Remove unnecessary RELEASE_BUILD check from GetAddrInfo.h. r=mcmanus 2015-01-02 16:51:04 -05:00
Makefile.in
moz.build Bug 1100184 - Use absolute paths in /network local includes. r=gps 2015-01-16 20:41:06 +10:30
nameprep_template.c
nameprep.c
nameprepdata.c
nsDNSService2.cpp Bug 1117042 - Mark virtual overridden functions as MOZ_OVERRIDE in netwerk; r=mcmanus 2015-01-02 09:04:04 -05:00
nsDNSService2.h
nsEffectiveTLDService.cpp
nsEffectiveTLDService.h
nsHostResolver.cpp Bug 1124973 (part 3) - Use PL_DHashTableSearch() in nsHostResolver.cpp. r=froydnj,sworkman. 2015-01-22 21:25:44 -08:00
nsHostResolver.h Bug 1084645 - Enable DNS TTL by default on Windows r=mcmanus 2014-10-20 10:26:33 -07:00
nsIDNKitInterface.h
nsIDNService.cpp
nsIDNService.h
nsIDNSListener.idl
nsIDNSRecord.idl
nsIDNSService.idl
nsIEffectiveTLDService.idl
nsIIDNService.idl
nsPIDNSService.idl
PDNSParams.h
PDNSRequest.ipdl
PDNSRequestParams.ipdlh
prepare_tlds.py
punycode.c
punycode.h
race.c