httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@hyperreal.org
Subject cvs commit: apache-2.0/src/modules/standard mod_cern_meta.c mod_expires.c mod_status.c mod_usertrack.c
Date Fri, 31 Dec 1999 20:32:37 GMT
rbb         99/12/31 12:32:37

  Modified:    src/modules/mpm/prefork prefork.c
               src/modules/standard mod_cern_meta.c mod_expires.c
                        mod_status.c mod_usertrack.c
  Log:
  A few more tweaks to finish the modules work.  Now, all of the modules
  compile correctly with Apache 2.0. This does run, but it hasn't been tested
  any more than simply compiling and running the server.
  
  Revision  Changes    Path
  1.62      +6 -0      apache-2.0/src/modules/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- prefork.c	1999/12/29 23:57:53	1.61
  +++ prefork.c	1999/12/31 20:32:34	1.62
  @@ -2985,6 +2985,12 @@
       /* NOP */
   }
   
  +ap_array_header_t *ap_get_status_table(ap_context_t *p)
  +{
  +    /* NOP */
  +    return NULL;
  +}
  +
   API_EXPORT(void) ap_reset_connection_status(long conn_id)
   {
       /* NOP */
  
  
  
  1.5       +7 -6      apache-2.0/src/modules/standard/mod_cern_meta.c
  
  Index: mod_cern_meta.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cern_meta.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_cern_meta.c	1999/10/22 16:01:25	1.4
  +++ mod_cern_meta.c	1999/12/31 20:32:35	1.5
  @@ -229,7 +229,7 @@
   /* XXX: this is very similar to ap_scan_script_header_err_core...
    * are the differences deliberate, or just a result of bit rot?
    */
  -static int scan_meta_file(request_rec *r, FILE *f)
  +static int scan_meta_file(request_rec *r, ap_file_t *f)
   {
       char w[MAX_STRING_LEN];
       char *l;
  @@ -237,7 +237,7 @@
       ap_table_t *tmp_headers;
   
       tmp_headers = ap_make_table(r->pool, 5);
  -    while (fgets(w, MAX_STRING_LEN - 1, f) != NULL) {
  +    while (ap_fgets(w, MAX_STRING_LEN - 1, f) != APR_SUCCESS) {
   
   	/* Delete terminal (CR?)LF */
   
  @@ -295,7 +295,8 @@
       char *last_slash;
       char *real_file;
       char *scrap_book;
  -    FILE *f;
  +    ap_file_t *f = NULL;
  +    ap_status_t retcode;
       cern_meta_dir_config *dconf;
       int rv;
       request_rec *rr;
  @@ -354,8 +355,8 @@
       }
       ap_destroy_sub_req(rr);
   
  -    f = ap_pfopen(r->pool, metafilename, "r");
  -    if (f == NULL) {
  +    retcode = ap_open(&f, metafilename, APR_READ | APR_CREATE, APR_OS_DEFAULT, r->pool);
  +    if (retcode != APR_SUCCESS) {
   	if (errno == ENOENT) {
   	    return DECLINED;
   	}
  @@ -366,7 +367,7 @@
   
       /* read the headers in */
       rv = scan_meta_file(r, f);
  -    ap_pfclose(r->pool, f);
  +    ap_close(f);
   
       return rv;
   }
  
  
  
  1.5       +10 -3     apache-2.0/src/modules/standard/mod_expires.c
  
  Index: mod_expires.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_expires.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_expires.c	1999/10/22 16:01:26	1.4
  +++ mod_expires.c	1999/12/31 20:32:35	1.5
  @@ -402,9 +402,11 @@
   {
       expires_dir_config *conf;
       char *code;
  -    time_t base;
  +    char *timestr = NULL;
  +    ap_int64_t base;
       time_t additional;
       time_t expires;
  +    ap_time_t *finaltime = NULL;
       char age[20];
   
       if (ap_is_HTTP_ERROR(r->status))       /* Don't add Expires headers to errors */
  @@ -464,7 +466,7 @@
           /* there's been some discussion and it's possible that 
            * 'access time' will be stored in request structure
            */
  -        base = r->request_time;
  +        ap_get_curtime(r->request_time, &base);
           additional = atoi(&code[1]);
           break;
       default:
  @@ -482,13 +484,18 @@
       tzset();                    /* redundant? called implicitly by localtime, at least

                                    * under FreeBSD
                                    */
  -    ap_table_setn(r->headers_out, "Expires", ap_gm_timestr_822(r->pool, expires));
  +    ap_make_time(&finaltime, r->pool);
  +    ap_set_curtime(finaltime, expires);
  +    ap_timestr(&timestr, finaltime, APR_UTCTIME, r->pool); 
  +    ap_table_setn(r->headers_out, "Expires", timestr);
       return OK;
   }
  +
   static void register_hooks(void)
   {
       ap_hook_fixups(add_expires,NULL,NULL,HOOK_MIDDLE);
   }
  +
   module MODULE_VAR_EXPORT expires_module =
   {
       STANDARD20_MODULE_STUFF,
  
  
  
  1.6       +1 -1      apache-2.0/src/modules/standard/mod_status.c
  
  Index: mod_status.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_status.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mod_status.c	1999/12/31 17:38:25	1.5
  +++ mod_status.c	1999/12/31 20:32:35	1.6
  @@ -85,7 +85,7 @@
       ap_time_t *nowtime = NULL;
   
       ap_make_time(&nowtime, r->pool);
  -    ap_curtime(nowtime);
  +    ap_current_time(nowtime);
   
       r->allowed = (1 << M_GET);
       if (r->method_number != M_GET)
  
  
  
  1.7       +10 -11    apache-2.0/src/modules/standard/mod_usertrack.c
  
  Index: mod_usertrack.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_usertrack.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mod_usertrack.c	1999/12/31 17:39:42	1.6
  +++ mod_usertrack.c	1999/12/31 20:32:36	1.7
  @@ -184,11 +184,11 @@
           struct tm *tms;
           ap_time_t *when = NULL;
           ap_int64_t req_time;
  +        char *temp_cookie = NULL;
  +        ap_size_t retsize;
           
           ap_make_time(&when, r->pool);
           ap_get_curtime(when, &req_time);
  -        ap_set_curtime(when,  req_time + cls->expires);
  -
   #ifndef MILLENIAL_COOKIES
           /*
            * Only two-digit date string, so we can't trust "00" or more.
  @@ -196,18 +196,17 @@
            * 1/1/2000 (which is 946684799)
            */
   
  -        if (when > 946684799)
  -            when = 946684799;
  +        if (req_time + cls->expires > 946684799) {
  +            ap_set_curtime(when, 946684799);
  +        }
  +        else
   #endif
  -        tms = gmtime(&when);
  +            ap_set_curtime(when,  req_time + cls->expires);
   
           /* Cookie with date; as strftime '%a, %d-%h-%y %H:%M:%S GMT' */
  -        new_cookie = ap_psprintf(r->pool,
  -                "%s=%s; path=/; expires=%s, %.2d-%s-%.2d %.2d:%.2d:%.2d GMT",
  -                    dcfg->cookie_name, cookiebuf, ap_day_snames[tms->tm_wday],
  -                    tms->tm_mday, ap_month_snames[tms->tm_mon],
  -		    tms->tm_year % 100,
  -                    tms->tm_hour, tms->tm_min, tms->tm_sec);
  +        ap_strftime(temp_cookie, &retsize, MAX_STRING_LEN, "%a, %d-%h-%y %H:%M:%S GMT",
when); 
  +        new_cookie = ap_psprintf(r->pool, "%s=%s; path=/; expires=%s", 
  +                                 dcfg->cookie_name, cookiebuf, temp_cookie);
       }
       else {
   	new_cookie = ap_psprintf(r->pool, "%s=%s; path=/",
  
  
  

Mime
View raw message