httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1198930 - in /httpd/httpd/trunk: include/mod_core.h server/core.c server/main.c
Date Mon, 07 Nov 2011 20:57:02 GMT
Author: sf
Date: Mon Nov  7 20:57:02 2011
New Revision: 1198930

URL: http://svn.apache.org/viewvc?rev=1198930&view=rev
Log:
Only init the RNG once at startup. This saves some entropy and works around the APR bug
fixed in r1198921

Modified:
    httpd/httpd/trunk/include/mod_core.h
    httpd/httpd/trunk/server/core.c
    httpd/httpd/trunk/server/main.c

Modified: httpd/httpd/trunk/include/mod_core.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/mod_core.h?rev=1198930&r1=1198929&r2=1198930&view=diff
==============================================================================
--- httpd/httpd/trunk/include/mod_core.h (original)
+++ httpd/httpd/trunk/include/mod_core.h Mon Nov  7 20:57:02 2011
@@ -90,6 +90,8 @@ AP_DECLARE(int) ap_send_http_options(req
 /* Used for multipart/byteranges boundary string */
 extern AP_DECLARE_DATA const char *ap_multipart_boundary;
 
+/* Init RNG at startup */
+AP_CORE_DECLARE(void) ap_init_rng(apr_pool_t *p);
 /* Update RNG state in parent after fork */
 AP_CORE_DECLARE(void) ap_random_parent_after_fork(void);
 

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1198930&r1=1198929&r2=1198930&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Mon Nov  7 20:57:02 2011
@@ -4632,7 +4632,7 @@ AP_CORE_DECLARE(void) ap_random_parent_a
     apr_random_insecure_bytes(rng, &data, sizeof(data));
 }
 
-static void rng_init(apr_pool_t *p)
+AP_CORE_DECLARE(void) ap_init_rng(apr_pool_t *p)
 {
     unsigned char seed[8];
     apr_status_t rv;
@@ -4741,7 +4741,6 @@ static void register_hooks(apr_pool_t *p
     ap_register_log_hooks(p);
     ap_register_config_hooks(p);
     ap_expr_init(p);
-    rng_init(p);
 
     /* create_connection and pre_connection should always be hooked
      * APR_HOOK_REALLY_LAST by core to give other modules the opportunity

Modified: httpd/httpd/trunk/server/main.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/main.c?rev=1198930&r1=1198929&r2=1198930&view=diff
==============================================================================
--- httpd/httpd/trunk/server/main.c (original)
+++ httpd/httpd/trunk/server/main.c Mon Nov  7 20:57:02 2011
@@ -34,6 +34,7 @@
 #include "http_log.h"
 #include "http_config.h"
 #include "http_core.h"
+#include "mod_core.h"
 #include "http_request.h"
 #include "http_vhost.h"
 #include "apr_uri.h"
@@ -459,6 +460,7 @@ int main(int argc, const char * const ar
     ap_pglobal = process->pool;
     pconf = process->pconf;
     ap_server_argv0 = process->short_name;
+    ap_init_rng(ap_pglobal);
 
     /* Set up the OOM callback in the global pool, so all pools should
      * by default inherit it. */



Mime
View raw message