summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulien.pierre.bugs%sun.com <devnull@localhost>2005-11-11 02:44:56 +0000
committerjulien.pierre.bugs%sun.com <devnull@localhost>2005-11-11 02:44:56 +0000
commit4aecc9fb6049c71ce06c870027b98baf8ec96d03 (patch)
tree3af36928b72417ae4ac6b0180b8fe43626e2ffc4
parent323298cde2caa28f485166850a05d60451849ae2 (diff)
downloadnss-hg-4aecc9fb6049c71ce06c870027b98baf8ec96d03.tar.gz
Fix for bug 292156. Add -C SSLCacheEntries option to selfserv. r=nelson
-rw-r--r--security/nss/cmd/selfserv/selfserv.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/security/nss/cmd/selfserv/selfserv.c b/security/nss/cmd/selfserv/selfserv.c
index b7e4b99c3..f4a3e6525 100644
--- a/security/nss/cmd/selfserv/selfserv.c
+++ b/security/nss/cmd/selfserv/selfserv.c
@@ -89,7 +89,7 @@
#define PORT_Malloc PR_Malloc
#endif
-#define NUM_SID_CACHE_ENTRIES 1024
+int NumSidCacheEntries = 1024;
static int handle_connection( PRFileDesc *, PRFileDesc *, int );
@@ -206,7 +206,7 @@ Usage(const char *progName)
" [-f fortezza_nickname] [-L [seconds]] [-M maxProcs] [-P dbprefix]\n"
#else
" [-i pid_file] [-c ciphers] [-d dbdir] [-f fortezza_nickname] \n"
-" [-L [seconds]] [-M maxProcs] [-P dbprefix]\n"
+" [-L [seconds]] [-M maxProcs] [-P dbprefix] [-C SSLCacheEntries]\n"
#endif /* NSS_ENABLE_ECC */
"-S means disable SSL v2\n"
"-3 means disable SSL v3\n"
@@ -232,6 +232,7 @@ Usage(const char *progName)
"-i pid_file file to write the process id of selfserve\n"
"-c ciphers Letter(s) chosen from the following list\n"
"-l means use local threads instead of global threads\n"
+"-C SSLCacheEntries sets the maximum number of entries in the SSL session cache\n"
"A SSL2 RC4 128 WITH MD5\n"
"B SSL2 RC4 128 EXPORT40 WITH MD5\n"
"C SSL2 RC2 128 CBC WITH MD5\n"
@@ -1663,7 +1664,7 @@ main(int argc, char **argv)
** numbers, then capital letters, then lower case, alphabetical.
*/
optstate = PL_CreateOptState(argc, argv,
- "2:3BDEL:M:NP:RSTbc:d:e:f:hi:lmn:op:rst:vw:xy");
+ "2:3BC:DEL:M:NP:RSTbc:d:e:f:hi:lmn:op:rst:vw:xy");
while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
++optionsFound;
switch(optstate->option) {
@@ -1673,6 +1674,8 @@ main(int argc, char **argv)
case 'B': bypassPKCS11 = PR_TRUE; break;
+ case 'C': if (optstate->value) NumSidCacheEntries = PORT_Atoi(optstate->value); break;
+
case 'D': noDelay = PR_TRUE; break;
case 'E': disableStepDown = PR_TRUE; break;
@@ -1839,7 +1842,7 @@ main(int argc, char **argv)
} else if (maxProcs > 1) {
/* we're going to be the parent in a multi-process server. */
listen_sock = getBoundListenSocket(port);
- rv = SSL_ConfigMPServerSIDCache(NUM_SID_CACHE_ENTRIES, 0, 0, tmp);
+ rv = SSL_ConfigMPServerSIDCache(NumSidCacheEntries, 0, 0, tmp);
if (rv != SECSuccess)
errExit("SSL_ConfigMPServerSIDCache");
hasSidCache = PR_TRUE;
@@ -1852,7 +1855,7 @@ main(int argc, char **argv)
if (prStatus != PR_SUCCESS)
errExit("PR_SetFDInheritable");
if (!NoReuse) {
- rv = SSL_ConfigServerSessionIDCache(NUM_SID_CACHE_ENTRIES,
+ rv = SSL_ConfigServerSessionIDCache(NumSidCacheEntries,
0, 0, tmp);
if (rv != SECSuccess)
errExit("SSL_ConfigServerSessionIDCache");