Commit 3a2fa0ff authored by Doug MacEachern's avatar Doug MacEachern
Browse files

call getpid() once at child init and save in the SSLModConfigRec

to avoid getpid() calls at request time
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@92231 13f79535-47bb-0310-9956-ffa450edef68
parent f8056ae2
Loading
Loading
Loading
Loading
+1 −0
Changes for mod_ssl.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -465,6 +465,7 @@ typedef struct {
#define SSLConnLogApplies(sslconn, level) (sslconn->log_level >= level)

typedef struct {
    pid_t           pid;
    apr_pool_t     *pPool;
    BOOL            bFixed;
    int             nInitCount;
+3 −0
Changes for ssl_engine_init.c: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -964,6 +964,9 @@ STACK_OF(X509_NAME) *ssl_init_FindCAList(server_rec *s, apr_pool_t *pp, const ch

void ssl_init_Child(apr_pool_t *p, server_rec *s)
{
    SSLModConfigRec *mc = myModConfig(s);
    mc->pid = getpid(); /* only call getpid() once per-process */

     /* open the mutex lockfile */
     ssl_mutex_reinit(s, p);
     return;
+1 −1
Changes for ssl_engine_rand.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ int ssl_rand_seed(server_rec *s, apr_pool_t *p, ssl_rsctx_t nCtx, char *prefix)
                /*
                 * seed in the current process id (usually just 4 bytes)
                 */
                pid = getpid();
                pid = mc->pid;
                l = sizeof(pid_t);
                RAND_seed((unsigned char *)&pid, l);
                nDone += l;