mod_ssl has some questionable access to the scoreboard which doesn't
work correctly starting a few minutes ago because SCOREBOARD_SIZE is
much smaller than it expects (< 1024, not indicative of the real size
of the scoreboard).

This patch should get things going again, but I wonder if anybody has
a better idea for seeding the random number generator, since this is
an unfortunate dependence on the memory allocation of the scoreboard.

Index: include/scoreboard.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/include/scoreboard.h,v
retrieving revision 1.34
diff -u -r1.34 scoreboard.h
--- include/scoreboard.h        2001/12/18 13:48:52     1.34
+++ include/scoreboard.h        2001/12/18 13:52:43
@@ -195,9 +195,6 @@
     char value[VALUE_LENGTH];
 } status_table_entry;
 
-/* XXX what should mod_ssl init use instead of this? */
-#define SCOREBOARD_SIZE                sizeof(scoreboard)
-
 AP_DECLARE(int) ap_exists_scoreboard_image(void);
 AP_DECLARE_NONSTD(void) ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e t);
 AP_DECLARE(void) ap_increment_counts(void *sbh, request_rec *r);
@@ -220,6 +217,7 @@
 AP_DECLARE(worker_score *) ap_get_servers_scoreboard(int x, int y);
 AP_DECLARE(process_score *) ap_get_parent_scoreboard(int x);
 AP_DECLARE(global_score *) ap_get_global_scoreboard(void);
+AP_DECLARE(apr_size_t) ap_get_scoreboard_size(void);
 
 AP_DECLARE_DATA extern scoreboard *ap_scoreboard_image;
 AP_DECLARE_DATA extern const char *ap_scoreboard_fname;
Index: modules/ssl/ssl_engine_rand.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/ssl/ssl_engine_rand.c,v
retrieving revision 1.7
diff -u -r1.7 ssl_engine_rand.c
--- modules/ssl/ssl_engine_rand.c       2001/11/29 05:17:38     1.7
+++ modules/ssl/ssl_engine_rand.c       2001/12/18 13:52:44
@@ -153,7 +153,7 @@
                  * seed in an 1KB extract of the current scoreboard
                  */
                 if (ap_scoreboard_image != NULL) {
-                    n = ssl_rand_choosenum(0, SCOREBOARD_SIZE-1024-1);
+                    n = ssl_rand_choosenum(0, ap_get_scoreboard_size()-1024-1);
                     RAND_seed((unsigned char *)ap_scoreboard_image+n, 1024);
                     nDone += 1024;
                 }
Index: server/scoreboard.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/scoreboard.c,v
retrieving revision 1.40
diff -u -r1.40 scoreboard.c
--- server/scoreboard.c 2001/12/18 13:48:52     1.40
+++ server/scoreboard.c 2001/12/18 13:52:44
@@ -435,3 +435,8 @@
 {
     return(&ap_scoreboard_image->global);
 }
+
+AP_DECLARE(apr_size_t) ap_get_scoreboard_size(void)
+{
+    return scoreboard_size;
+}

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Reply via email to