diff options
author | relyea%netscape.com <devnull@localhost> | 2002-03-19 01:22:51 +0000 |
---|---|---|
committer | relyea%netscape.com <devnull@localhost> | 2002-03-19 01:22:51 +0000 |
commit | 374bc36d19156330a6c2c5393a7fa7e2ec69e8d6 (patch) | |
tree | dfe576b73e863f554a7db81fad5576bc1d0228a6 | |
parent | 088c44287577083df43df64aad1b64d30760ec4e (diff) | |
download | nss-hg-374bc36d19156330a6c2c5393a7fa7e2ec69e8d6.tar.gz |
Bub 129080. Increase the size of the libdbm cache so we can handle objects
up to 1 Meg. (namely CRLs).
-rw-r--r-- | security/nss/lib/certdb/pcertdb.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/security/nss/lib/certdb/pcertdb.c b/security/nss/lib/certdb/pcertdb.c index f6601d4cb..9ecfed1c1 100644 --- a/security/nss/lib/certdb/pcertdb.c +++ b/security/nss/lib/certdb/pcertdb.c @@ -4223,6 +4223,16 @@ SEC_CertNicknameConflict(char *nickname, SECItem *derSubject, return(rv); } +#define DBM_DEFAULT 0 +static const HASHINFO cert_hashInfo = { + DBM_DEFAULT, /* bucket size */ + DBM_DEFAULT, /* fill factor */ + DBM_DEFAULT, /* number of elements */ + 1024 * 1024, /* (1 M) bytes to cache */ + DBM_DEFAULT, /* hash function */ + DBM_DEFAULT /* byte order */ +}; + /* * Open the certificate database and index databases. Create them if * they are not there or bad. @@ -4254,7 +4264,8 @@ SEC_OpenPermCertDB(CERTCertDBHandle *handle, PRBool readOnly, /* * first open the permanent file based database. */ - handle->permCertDB = dbopen( certdbname, openflags, 0600, DB_HASH, 0 ); + handle->permCertDB = dbopen( certdbname, openflags, 0600, DB_HASH, + &cert_hashInfo ); /* check for correct version number */ if ( handle->permCertDB ) { @@ -4284,7 +4295,7 @@ SEC_OpenPermCertDB(CERTCertDBHandle *handle, PRBool readOnly, handle->permCertDB = dbopen(certdbname, O_RDWR | O_CREAT | O_TRUNC, - 0600, DB_HASH, 0); + 0600, DB_HASH, &cert_hashInfo); /* if create fails then we lose */ if ( handle->permCertDB == 0 ) { @@ -4850,15 +4861,6 @@ CERT_OpenCertDB(CERTCertDBHandle *handle, PRBool readOnly, CERTDBNameFunc namecb, void *cbarg) { int rv; -#define DBM_DEFAULT 0 - static const HASHINFO hashInfo = { - DBM_DEFAULT, /* bucket size */ - DBM_DEFAULT, /* fill factor */ - DBM_DEFAULT, /* number of elements */ - 256 * 1024, /* bytes to cache */ - DBM_DEFAULT, /* hash function */ - DBM_DEFAULT /* byte order */ - }; certdb_InitDBLock(); @@ -4871,7 +4873,8 @@ CERT_OpenCertDB(CERTCertDBHandle *handle, PRBool readOnly, /* * Open the memory resident decoded cert database. */ - handle->tempCertDB = dbopen(0, O_RDWR | O_CREAT, 0600, DB_HASH, &hashInfo); + handle->tempCertDB = dbopen(0, O_RDWR | O_CREAT, 0600, DB_HASH, + &cert_hashInfo); if ( !handle->tempCertDB ) { goto loser; } |