diff options
author | nelsonb%netscape.com <devnull@localhost> | 2001-02-28 22:50:12 +0000 |
---|---|---|
committer | nelsonb%netscape.com <devnull@localhost> | 2001-02-28 22:50:12 +0000 |
commit | e4838af6135b8bbe6a80b1c99fd3ebcc724231d4 (patch) | |
tree | e5e2ad793c4225411a3306869b541bd5c73f2e90 | |
parent | d99c8edb6ef5b8f87e84f03313d9a530b5eba19d (diff) | |
download | nss-hg-e4838af6135b8bbe6a80b1c99fd3ebcc724231d4.tar.gz |
Increase the temp cert db's memory buffer size from 64KB to 256KB.
This reduces the liklihood that it will overflow into a disk file.
This is a partial fix for bug 67953.
-rw-r--r-- | security/nss/lib/certdb/certdb.c | 13 | ||||
-rw-r--r-- | security/nss/lib/certdb/pcertdb.c | 11 |
2 files changed, 21 insertions, 3 deletions
diff --git a/security/nss/lib/certdb/certdb.c b/security/nss/lib/certdb/certdb.c index f70f7893e..e626581ac 100644 --- a/security/nss/lib/certdb/certdb.c +++ b/security/nss/lib/certdb/certdb.c @@ -1182,10 +1182,19 @@ CERT_GetDefaultCertDB(void) SECStatus CERT_OpenVolatileCertDB(CERTCertDBHandle *handle) { +#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 */ + }; /* * Open the memory resident perm cert database. */ - handle->permCertDB = dbopen( 0, O_RDWR | O_CREAT, 0600, DB_HASH, 0 ); + handle->permCertDB = dbopen(0, O_RDWR | O_CREAT, 0600, DB_HASH, &hashInfo); if ( !handle->permCertDB ) { goto loser; } @@ -1193,7 +1202,7 @@ CERT_OpenVolatileCertDB(CERTCertDBHandle *handle) /* * Open the memory resident decoded cert database. */ - handle->tempCertDB = dbopen( 0, O_RDWR | O_CREAT, 0600, DB_HASH, 0 ); + handle->tempCertDB = dbopen(0, O_RDWR | O_CREAT, 0600, DB_HASH, &hashInfo); if ( !handle->tempCertDB ) { goto loser; } diff --git a/security/nss/lib/certdb/pcertdb.c b/security/nss/lib/certdb/pcertdb.c index 8e642951d..382640460 100644 --- a/security/nss/lib/certdb/pcertdb.c +++ b/security/nss/lib/certdb/pcertdb.c @@ -4843,6 +4843,15 @@ 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(); @@ -4855,7 +4864,7 @@ CERT_OpenCertDB(CERTCertDBHandle *handle, PRBool readOnly, /* * Open the memory resident decoded cert database. */ - handle->tempCertDB = dbopen( 0, O_RDWR | O_CREAT, 0600, DB_HASH, 0 ); + handle->tempCertDB = dbopen(0, O_RDWR | O_CREAT, 0600, DB_HASH, &hashInfo); if ( !handle->tempCertDB ) { goto loser; } |