зеркало из https://github.com/mozilla/gecko-dev.git
c801affedb
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 |
||
---|---|---|
.. | ||
ChildDNSService.cpp | ||
ChildDNSService.h | ||
DNS.cpp | ||
DNS.h | ||
DNSListenerProxy.cpp | ||
DNSListenerProxy.h | ||
DNSRequestChild.cpp | ||
DNSRequestChild.h | ||
DNSRequestParent.cpp | ||
DNSRequestParent.h | ||
GetAddrInfo.cpp | ||
GetAddrInfo.h | ||
Makefile.in | ||
PDNSParams.h | ||
PDNSRequest.ipdl | ||
PDNSRequestParams.ipdlh | ||
effective_tld_names.dat | ||
moz.build | ||
nameprep.c | ||
nameprep_template.c | ||
nameprepdata.c | ||
nsDNSService2.cpp | ||
nsDNSService2.h | ||
nsEffectiveTLDService.cpp | ||
nsEffectiveTLDService.h | ||
nsHostResolver.cpp | ||
nsHostResolver.h | ||
nsIDNKitInterface.h | ||
nsIDNSListener.idl | ||
nsIDNSRecord.idl | ||
nsIDNSService.idl | ||
nsIDNService.cpp | ||
nsIDNService.h | ||
nsIEffectiveTLDService.idl | ||
nsIIDNService.idl | ||
nsPIDNSService.idl | ||
prepare_tlds.py | ||
punycode.c | ||
punycode.h | ||
race.c |