Bug 673470 - Fix wrong order of arguments to KeyedHash function. r=dcamp

This commit is contained in:
Gian-Carlo Pascutto 2012-08-15 09:08:23 +02:00
parent 08b56e92fc
commit 3403df5b2f
3 changed files with 7 additions and 7 deletions

View File

@ -631,8 +631,8 @@ LookupCache::GetHostKeys(const nsACString& aSpec,
ensuring any collisions happens at a different points for
different users.
*/
/* static */ nsresult LookupCache::KeyedHash(PRUint32 aPref, PRUint32 aDomain,
PRUint32 aKey, PRUint32* aOut,
/* static */ nsresult LookupCache::KeyedHash(PRUint32 aPref, PRUint32 aHostKey,
PRUint32 aUserKey, PRUint32* aOut,
bool aPassthrough)
{
/* Do not do any processing in passthrough mode. */
@ -655,8 +655,8 @@ LookupCache::GetHostKeys(const nsACString& aSpec,
PRUint32 k1;
PRUint32 karr[2];
karr[0] = aDomain;
karr[1] = aKey;
karr[0] = aHostKey;
karr[1] = aUserKey;
for (PRUint32 i = 0; i < 2; i++) {
k1 = karr[i];

View File

@ -128,8 +128,8 @@ public:
different users. If aPassthrough is set, we ignore the
random value and copy prefix directly into output.
*/
static nsresult KeyedHash(PRUint32 aPref, PRUint32 aDomain,
PRUint32 aKey, PRUint32* aOut,
static nsresult KeyedHash(PRUint32 aPref, PRUint32 aHostKey,
PRUint32 aUserKey, PRUint32* aOut,
bool aPassthrough);
LookupCache(const nsACString& aTableName, nsIFile* aStoreFile,

View File

@ -595,7 +595,7 @@ ProtocolParser::ProcessHostAdd(const Prefix& aDomain, PRUint8 aNumEntries,
for (uint8 i = 0; i < aNumEntries; i++) {
Prefix hash;
hash.Assign(Substring(aChunk, *aStart, PREFIX_SIZE));
nsresult rv = LookupCache::KeyedHash(domHash, hash.ToUint32(), mHashKey, &codedHash,
nsresult rv = LookupCache::KeyedHash(hash.ToUint32(), domHash, mHashKey, &codedHash,
!mPerClientRandomize);
NS_ENSURE_SUCCESS(rv, rv);
Prefix newHash;