httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_init.c ssl_engine_rand.c
Date Thu, 29 Nov 2001 05:08:48 GMT
dougm       01/11/28 21:08:48

  Modified:    modules/ssl ssl_engine_init.c ssl_engine_rand.c
  Log:
  move srand() call from ssl_rand_choosenum() to ssl_init_Child()
  
  this was being called twice per-connection with 'SSLRandom connect builtin'
  configured (which is in the default config)
  
  this also gets rid of two time() syscalls per-connection
  
  Revision  Changes    Path
  1.21      +3 -0      httpd-2.0/modules/ssl/ssl_engine_init.c
  
  Index: ssl_engine_init.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_init.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ssl_engine_init.c	2001/11/29 05:04:22	1.20
  +++ ssl_engine_init.c	2001/11/29 05:08:47	1.21
  @@ -967,6 +967,9 @@
       SSLModConfigRec *mc = myModConfig(s);
       mc->pid = getpid(); /* only call getpid() once per-process */
   
  +    /* XXX: there should be an ap_srand() function */
  +    srand((unsigned int)time(NULL));
  +
        /* open the mutex lockfile */
        ssl_mutex_reinit(s, p);
        return;
  
  
  
  1.6       +0 -1      httpd-2.0/modules/ssl/ssl_engine_rand.c
  
  Index: ssl_engine_rand.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_rand.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ssl_engine_rand.c	2001/11/29 05:04:22	1.5
  +++ ssl_engine_rand.c	2001/11/29 05:08:47	1.6
  @@ -203,7 +203,6 @@
       int i;
       char buf[50];
   
  -    srand((unsigned int)time(NULL));
       apr_snprintf(buf, sizeof(buf), "%.0f",
                    (((double)(rand()%RAND_MAX)/RAND_MAX)*(h-l)));
       i = atoi(buf)+1;
  
  
  

Mime
View raw message