gecko-dev/netwerk/dns
Nicholas Nethercote c801affedb 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 Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
ChildDNSService.h Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
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 Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
DNSListenerProxy.h Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
DNSRequestChild.cpp Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
DNSRequestChild.h Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
DNSRequestParent.cpp Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
DNSRequestParent.h Bug 1117042 - Mark virtual overridden functions as MOZ_OVERRIDE in netwerk; r=mcmanus 2015-01-02 09:04:04 -05: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 Bug 937224 - Part g: Move LOCAL_INCLUDES to moz.build in netwerk/; r=mshal 2013-11-28 15:25:39 +01:00
PDNSParams.h Bug 945066: remote nsIDNSService to child. r=jdm 2013-12-11 11:03:51 -08:00
PDNSRequest.ipdl Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
PDNSRequestParams.ipdlh Bug 945066: remote nsIDNSService to child. r=jdm 2013-12-11 11:03:51 -08: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
moz.build Bug 1100184 - Use absolute paths in /network local includes. r=gps 2015-01-16 20:41:06 +10:30
nameprep.c
nameprep_template.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 Bug 1028588 - Fix dangerous public destructors in netwerk/ - r=mcmanus 2014-06-24 12:36:44 -04:00
nsEffectiveTLDService.cpp Bug 1050009 - Initialize pldhash tables with a length, not a capacity. r=roc. 2014-08-06 06:31:21 -07:00
nsEffectiveTLDService.h Bug 1048271 - Fix more bad implicit constructors in netwerk; r=mcmanus 2014-08-05 09:20:24 -04:00
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 Bug 784739 - Switch from NULL to nullptr in netwerk/ (1/2); r=ehsan 2013-09-19 15:28:26 -04:00
nsIDNSListener.idl Bug 947721 - Fix function CancelAsyncRequest and add the same function for the child process. r=sworkman 2014-08-26 05:09:00 -04:00
nsIDNSRecord.idl Bug 919296 - Minimize the #includes in netwerk/ IDL files; r=mcmanus 2013-09-22 23:35:05 -04:00
nsIDNSService.idl Bug 354493 - revert Add nsINetworkZonePolicy to protect resources loaded from private IPs r=backout a=backout 2014-07-24 10:05:36 -04:00
nsIDNService.cpp Bug 869836 - Part 4: Use EqualsLiteral instead of `Equals(NS_LITERAL_STRING(...))`. r=ehsan 2014-05-22 06:48:51 +03:00
nsIDNService.h Bug 1028588 - Fix dangerous public destructors in netwerk/ - r=mcmanus 2014-06-24 12:36:44 -04:00
nsIEffectiveTLDService.idl
nsIIDNService.idl
nsPIDNSService.idl
prepare_tlds.py
punycode.c Bug 935499. r=honzab 2013-11-16 18:30:12 +09:00
punycode.h
race.c