httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_vars.c mod_ssl.h ssl_expr.c ssl_expr_eval.c
Date Tue, 17 Jul 2001 14:57:47 GMT
rse         01/07/17 07:57:46

  Modified:    modules/ssl ssl_engine_vars.c mod_ssl.h ssl_expr.c
                        ssl_expr_eval.c
  Log:
  Merge in part II of a set of mod_ssl porting changes.
  
  Submitted by: Madhusudan Mathihalli <madhusudan_mathihalli@hp.com>
  
  Revision  Changes    Path
  1.5       +1 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ssl_engine_vars.c	2001/05/05 16:55:28	1.4
  +++ ssl_engine_vars.c	2001/07/17 14:57:26	1.5
  @@ -104,7 +104,7 @@
   
   #if 0 /* XXX */
   
  -char *ssl_var_lookup(pool *p, server_rec *s, conn_rec *c, request_rec *r, char *var)
  +char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, char *var)
   {
       SSLModConfigRec *mc = myModConfig();
       char *result;
  
  
  
  1.17      +3 -1      httpd-2.0/modules/ssl/mod_ssl.h
  
  Index: mod_ssl.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- mod_ssl.h	2001/06/28 01:13:09	1.16
  +++ mod_ssl.h	2001/07/17 14:57:30	1.17
  @@ -684,9 +684,11 @@
   /*  Variables  */
   void         ssl_var_register(void);
   void         ssl_var_unregister(void);
  -char        *ssl_var_lookup(pool *, server_rec *, conn_rec *, request_rec *, char *);
  +#endif /* XXX */
  +char        *ssl_var_lookup(apr_pool_t *, server_rec *, conn_rec *, request_rec *, char
*);
   
   /*  I/O  */
  +#if 0 /* XXX */
   void         ssl_io_register(void);
   void         ssl_io_unregister(void);
   long         ssl_io_data_cb(BIO *, int, const char *, int, long, long);
  
  
  
  1.4       +2 -7      httpd-2.0/modules/ssl/ssl_expr.c
  
  Index: ssl_expr.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_expr.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ssl_expr.c	2001/05/05 10:12:05	1.3
  +++ ssl_expr.c	2001/07/17 14:57:32	1.4
  @@ -62,8 +62,6 @@
                                             -- Unknown  */
   #include "mod_ssl.h"
   
  -#if 0 /* XXX */
  -
   /*  _________________________________________________________________
   **
   **  Expression Handling
  @@ -73,7 +71,7 @@
   ssl_expr_info_type ssl_expr_info;
   char              *ssl_expr_error;
   
  -ssl_expr *ssl_expr_comp(pool *p, char *expr)
  +ssl_expr *ssl_expr_comp(apr_pool_t *p, char *expr)
   {
       ssl_expr_info.pool       = p;
       ssl_expr_info.inputbuf   = expr;
  @@ -98,7 +96,7 @@
   {
       ssl_expr *node;
   
  -    node = (ssl_expr *)ap_palloc(ssl_expr_info.pool, sizeof(ssl_expr));
  +    node = (ssl_expr *)apr_palloc(ssl_expr_info.pool, sizeof(ssl_expr));
       node->node_op   = op;
       node->node_arg1 = (char *)a1;
       node->node_arg2 = (char *)a2;
  @@ -115,6 +113,3 @@
       else
           return (rc ? 1 : 0);
   }
  -
  -#endif /* XXX */
  -
  
  
  
  1.4       +17 -18    httpd-2.0/modules/ssl/ssl_expr_eval.c
  
  Index: ssl_expr_eval.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_expr_eval.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ssl_expr_eval.c	2001/05/05 10:12:05	1.3
  +++ ssl_expr_eval.c	2001/07/17 14:57:35	1.4
  @@ -61,8 +61,6 @@
                                           -- Unknown */
   #include "mod_ssl.h"
   
  -#if 0 /* XXX */
  -
   /*  _________________________________________________________________
   **
   **  Expression Evaluation
  @@ -223,35 +221,39 @@
   
   static char *ssl_expr_eval_func_file(request_rec *r, char *filename)
   {
  -    FILE *fp;
  +    apr_file_t *fp;
       char *buf;
  -    int len;
  +    apr_off_t offset;
  +    apr_size_t len;
  +    apr_finfo_t finfo;
   
  -    if ((fp = ap_pfopen(r->pool, filename, "r")) == NULL) {
  +    if (apr_file_open(&fp, filename, APR_READ|APR_BUFFERED, 
  +                      APR_OS_DEFAULT, r->pool) != APR_SUCCESS) {
           ssl_expr_error = "Cannot open file";
           return "";
       }
  -    fseek(fp, 0, SEEK_END);
  -    len = ftell(fp);
  +    apr_file_info_get(&finfo, APR_FINFO_SIZE, fp);
  +    len = finfo.size;
       if (len == 0) {
  -        buf = (char *)ap_palloc(r->pool, sizeof(char) * 1);
  +        buf = (char *)apr_palloc(r->pool, sizeof(char) * 1);
           *buf = NUL;
       }
       else {
  -        if ((buf = (char *)ap_palloc(r->pool, sizeof(char) * len+1)) == NULL) {
  +        if ((buf = (char *)apr_palloc(r->pool, sizeof(char)*(len+1))) == NULL) {
               ssl_expr_error = "Cannot allocate memory";
  -            ap_pfclose(r->pool, fp);
  +            apr_file_close(fp);
               return "";
           }
  -        fseek(fp, 0, SEEK_SET);
  -        if (fread(buf, len, 1, fp) == 0) {
  +        offset = 0;
  +        apr_file_seek(fp, APR_SET, &offset);
  +        if (apr_file_read(fp, buf, &len) != APR_SUCCESS) {
               ssl_expr_error = "Cannot read from file";
  -            fclose(fp);
  -            return ("");
  +            apr_file_close(fp);
  +            return "";
           }
           buf[len] = NUL;
       }
  -    ap_pfclose(r->pool, fp);
  +    apr_file_close(fp);
       return buf;
   }
   
  @@ -278,6 +280,3 @@
       }
       return 0;
   }
  -
  -#endif /* XXX */
  -
  
  
  

Mime
View raw message