mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bfd5398e4f
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 | ||
effective_tld_names.dat | ||
GetAddrInfo.cpp | ||
GetAddrInfo.h | ||
Makefile.in | ||
moz.build | ||
nameprep_template.c | ||
nameprep.c | ||
nameprepdata.c | ||
nsDNSService2.cpp | ||
nsDNSService2.h | ||
nsEffectiveTLDService.cpp | ||
nsEffectiveTLDService.h | ||
nsHostResolver.cpp | ||
nsHostResolver.h | ||
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 |