httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_vars.c
Date Tue, 25 Nov 2003 13:10:10 GMT
jorton      2003/11/25 05:10:10

  Modified:    modules/ssl ssl_engine_vars.c
  Log:
  * modules/ssl/ssl_engine_vars.c (ssl_var_lookup): Only call
  ssl_var_lookup_ssl for a real SSL connection; fix lookup of "HTTPS"
  for non-SSL connections.
  (ssl_var_log_handler_x): Give results for non-SSL connections too;
  e.g. %{HTTPS}x does the right thing.
  
  PR: 23956
  
  Revision  Changes    Path
  1.27      +6 -7      httpd-2.0/modules/ssl/ssl_engine_vars.c
  
  Index: ssl_engine_vars.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_vars.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -u -r1.26 -r1.27
  --- ssl_engine_vars.c	25 Nov 2003 12:46:32 -0000	1.26
  +++ ssl_engine_vars.c	25 Nov 2003 13:10:09 -0000	1.27
  @@ -87,9 +87,9 @@
       return;
   }
   
  +/* This function must remain safe to use for a non-SSL connection. */
   char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, char *var)
   {
  -    SSLConnRec *sslconn;
       SSLModConfigRec *mc = myModConfig(s);
       char *result;
       BOOL resdup;
  @@ -169,17 +169,18 @@
        * Connection stuff
        */
       if (result == NULL && c != NULL) {
  -        sslconn = myConnConfig(c);
  +        SSLConnRec *sslconn = myConnConfig(c);
           if (strcEQ(var, "REMOTE_ADDR"))
               result = c->remote_ip;
           else if (strcEQ(var, "REMOTE_USER"))
               result = r->user;
           else if (strcEQ(var, "AUTH_TYPE"))
               result = r->ap_auth_type;
  -        else if (strlen(var) > 4 && strcEQn(var, "SSL_", 4))
  +        else if (strlen(var) > 4 && strcEQn(var, "SSL_", 4) 
  +                 && sslconn && sslconn->ssl)
               result = ssl_var_lookup_ssl(p, c, var+4);
           else if (strcEQ(var, "HTTPS")) {
  -            if (sslconn->ssl != NULL)
  +            if (sslconn && sslconn->ssl)
                   result = "on";
               else
                   result = "off";
  @@ -684,9 +685,7 @@
       SSLConnRec *sslconn = myConnConfig(r->connection);
       char *result;
   
  -    result = NULL;
  -    if (sslconn && sslconn->ssl)
  -        result = ssl_var_lookup(r->pool, r->server, r->connection, r, a);
  +    result = ssl_var_lookup(r->pool, r->server, r->connection, r, a);
       if (result != NULL && result[0] == NUL)
           result = NULL;
       return result;
  
  
  

Mime
View raw message