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_autoindex.c mod_expires.c mod_include.c mod_usertrack.c
Date Thu, 06 Jan 2000 19:19:43 GMT
rbb         00/01/06 11:19:42

  Modified:    src/lib/apr/file_io/unix filestat.c
               src/lib/apr/include apr_time.h
               src/lib/apr/test testtime.c
               src/lib/apr/time/unix access.c
               src/modules/standard mod_autoindex.c mod_expires.c
                        mod_include.c mod_usertrack.c
  Log:
  Next pass at the time functions.  This defines an ap_ansi_time_t which has
  a specific format (seconds since 0:00:00 Jan 1, 1970).  I also renamed the
  (get|set)_curtime functions to (get|set)ansitime.  This should make more
  sense, and be a bit more intuitive.
  
  Revision  Changes    Path
  1.8       +6 -6      apache-2.0/src/lib/apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/filestat.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- filestat.c	2000/01/06 14:43:08	1.7
  +++ filestat.c	2000/01/06 19:19:25	1.8
  @@ -75,11 +75,11 @@
           finfo->size = info.st_size;
           finfo->inode = info.st_ino;
           ap_make_time(&finfo->atime, thefile->cntxt);
  -        ap_set_curtime(finfo->atime, info.st_atime);
  +        ap_set_ansitime(finfo->atime, info.st_atime);
           ap_make_time(&finfo->mtime, thefile->cntxt);
  -        ap_set_curtime(finfo->mtime, info.st_mtime);
  +        ap_set_ansitime(finfo->mtime, info.st_mtime);
           ap_make_time(&finfo->ctime, thefile->cntxt);
  -        ap_set_curtime(finfo->ctime, info.st_ctime);
  +        ap_set_ansitime(finfo->ctime, info.st_ctime);
   
           return APR_SUCCESS;
       }
  @@ -108,11 +108,11 @@
           finfo->size = info.st_size;
           finfo->inode = info.st_ino;
           ap_make_time(&finfo->atime, cont);
  -        ap_set_curtime(finfo->atime, info.st_atime);
  +        ap_set_ansitime(finfo->atime, info.st_atime);
           ap_make_time(&finfo->mtime, cont);
  -        ap_set_curtime(finfo->mtime, info.st_mtime);
  +        ap_set_ansitime(finfo->mtime, info.st_mtime);
           ap_make_time(&finfo->ctime, cont);
  -        ap_set_curtime(finfo->ctime, info.st_ctime);
  +        ap_set_ansitime(finfo->ctime, info.st_ctime);
           return APR_SUCCESS;
       }
       else {
  
  
  
  1.9       +6 -2      apache-2.0/src/lib/apr/include/apr_time.h
  
  Index: apr_time.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_time.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- apr_time.h	1999/12/31 05:09:20	1.8
  +++ apr_time.h	2000/01/06 19:19:26	1.9
  @@ -65,6 +65,10 @@
   
   typedef enum {APR_LOCALTIME, APR_UTCTIME} ap_timetype_e;
   
  +/* ap_ansi_time_t is defined as the number of seconds since
  + * 0:00:00 01/01/70.
  + */
  +typedef ap_int64_t           ap_ansi_time_t;
   typedef struct atime_t       ap_time_t;
   
   API_VAR_IMPORT const char ap_month_snames[12][4];
  @@ -80,7 +84,7 @@
   ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, const char *format,
ap_time_t *tm);
   
   /* accessor functions */
  -ap_status_t ap_get_curtime(ap_time_t *, ap_int64_t *);
  +ap_status_t ap_get_ansitime(ap_time_t *, ap_ansi_time_t *);
   ap_status_t ap_timediff(ap_time_t *, ap_time_t *, ap_int32_t *);
   
   ap_status_t ap_get_sec(ap_time_t *, ap_int32_t *);
  @@ -91,7 +95,7 @@
   ap_status_t ap_get_year(ap_time_t *, ap_int32_t *);
   ap_status_t ap_get_wday(ap_time_t *, ap_int32_t *);
   
  -ap_status_t ap_set_curtime(ap_time_t *, ap_int64_t);
  +ap_status_t ap_set_ansitime(ap_time_t *, ap_ansi_time_t);
   ap_status_t ap_set_sec(ap_time_t *, ap_int32_t);
   ap_status_t ap_set_min(ap_time_t *, ap_int32_t);
   ap_status_t ap_set_hour(ap_time_t *, ap_int32_t);
  
  
  
  1.4       +2 -2      apache-2.0/src/lib/apr/test/testtime.c
  
  Index: testtime.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testtime.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- testtime.c	1999/10/04 16:37:25	1.3
  +++ testtime.c	2000/01/06 19:19:28	1.4
  @@ -165,8 +165,8 @@
       fprintf(stdout, "OK\n");
   
       fprintf(stdout, "\tComparing two time values.......");
  -    ap_get_curtime(time, &t1);
  -    ap_get_curtime(time2, &t2);
  +    ap_get_ansitime(time, &t1);
  +    ap_get_ansitime(time2, &t2);
       if ((t1 == -1) || (t2 == -1) || (t1 != t2)) {
           fprintf(stderr, "Values don't match\n");
           exit(-1);
  
  
  
  1.10      +4 -4      apache-2.0/src/lib/apr/time/unix/access.c
  
  Index: access.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/time/unix/access.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- access.c	1999/12/21 21:16:19	1.9
  +++ access.c	2000/01/06 19:19:31	1.10
  @@ -56,12 +56,12 @@
   #include "atime.h"
   
   /* ***APRDOC********************************************************
  - * ap_status_t ap_get_curtime(ap_time_t *, ap_int64_t *)
  + * ap_status_t ap_get_ansitime(ap_time_t *, ap_int64_t *)
    *    Get the current time in seconds since Jan 1, 1970.
    * arg 1) The time value we care about.
    * arg 2) Integer to store time value in
    */
  -ap_status_t ap_get_curtime(struct atime_t *atime, ap_int64_t *rv)
  +ap_status_t ap_get_ansitime(struct atime_t *atime, ap_ansi_time_t *rv)
   {
       if (atime) {
           (*rv) = atime->currtime->tv_sec;
  @@ -176,12 +176,12 @@
   }
   
   /* ***APRDOC********************************************************
  - * ap_status_t ap_set_curtime(ap_time_t *, ap_int64_t)
  + * ap_status_t ap_set_ansitime(ap_time_t *, ap_int64_t)
    *    Set the current time in seconds since Jan 1, 1970.
    * arg 1) The time value we care about.
    * arg 2) Integer to store time value in
    */
  -ap_status_t ap_set_curtime(struct atime_t *atime, ap_int64_t sec)
  +ap_status_t ap_set_ansitime(struct atime_t *atime, ap_ansi_time_t sec)
   {
       if (atime) {
           if (!atime->currtime) {
  
  
  
  1.17      +1 -1      apache-2.0/src/modules/standard/mod_autoindex.c
  
  Index: mod_autoindex.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_autoindex.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- mod_autoindex.c	2000/01/06 14:43:38	1.16
  +++ mod_autoindex.c	2000/01/06 19:19:34	1.17
  @@ -1162,7 +1162,7 @@
           request_rec *rr = ap_sub_req_lookup_file(name, r);
   
   	if (rr->finfo.protection != 0) {
  -	    ap_get_curtime(rr->finfo.mtime, (ap_int64_t *)&p->lm);
  +	    ap_get_ansitime(rr->finfo.mtime, (ap_int64_t *)&p->lm);
   	    if (S_ISDIR(rr->finfo.protection)) {
   	        if (!(p->icon = find_icon(d, rr, 1))) {
   		    p->icon = find_default_icon(d, "^^DIRECTORY^^");
  
  
  
  1.6       +2 -2      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mod_expires.c	1999/12/31 20:32:35	1.5
  +++ mod_expires.c	2000/01/06 19:19:36	1.6
  @@ -466,7 +466,7 @@
           /* there's been some discussion and it's possible that 
            * 'access time' will be stored in request structure
            */
  -        ap_get_curtime(r->request_time, &base);
  +        ap_get_ansitime(r->request_time, &base);
           additional = atoi(&code[1]);
           break;
       default:
  @@ -485,7 +485,7 @@
                                    * under FreeBSD
                                    */
       ap_make_time(&finaltime, r->pool);
  -    ap_set_curtime(finaltime, expires);
  +    ap_set_ansitime(finaltime, expires);
       ap_timestr(&timestr, finaltime, APR_UTCTIME, r->pool); 
       ap_table_setn(r->headers_out, "Expires", timestr);
       return OK;
  
  
  
  1.16      +1 -1      apache-2.0/src/modules/standard/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_include.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- mod_include.c	2000/01/06 14:43:39	1.15
  +++ mod_include.c	2000/01/06 19:19:38	1.16
  @@ -1183,7 +1183,7 @@
               parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0);
               if (!find_file(r, "flastmod", tag, parsed_string, &finfo, error)) {
                   ap_make_time(&mtime, r->pool);
  -                ap_set_curtime(mtime, finfo.st_mtime);
  +                ap_set_ansitime(mtime, finfo.st_mtime);
                   ap_rputs(ap_ht_time(r->pool, mtime, tf, 0), r);
               }
           }
  
  
  
  1.8       +3 -3      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mod_usertrack.c	1999/12/31 20:32:36	1.7
  +++ mod_usertrack.c	2000/01/06 19:19:39	1.8
  @@ -188,7 +188,7 @@
           ap_size_t retsize;
           
           ap_make_time(&when, r->pool);
  -        ap_get_curtime(when, &req_time);
  +        ap_get_ansitime(when, &req_time);
   #ifndef MILLENIAL_COOKIES
           /*
            * Only two-digit date string, so we can't trust "00" or more.
  @@ -197,11 +197,11 @@
            */
   
           if (req_time + cls->expires > 946684799) {
  -            ap_set_curtime(when, 946684799);
  +            ap_set_ansitime(when, 946684799);
           }
           else
   #endif
  -            ap_set_curtime(when,  req_time + cls->expires);
  +            ap_set_ansitime(when,  req_time + cls->expires);
   
           /* Cookie with date; as strftime '%a, %d-%h-%y %H:%M:%S GMT' */
           ap_strftime(temp_cookie, &retsize, MAX_STRING_LEN, "%a, %d-%h-%y %H:%M:%S GMT",
when); 
  
  
  

Mime
View raw message