httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@lnd.com>
Subject RE: Canonical time in Apache 2.0
Date Tue, 04 Apr 2000 18:37:21 GMT
> From: Bill Stoddard [mailto:stoddard@raleigh.ibm.com]
> Sent: Tuesday, April 04, 2000 12:59 PM
> 
> It is my understanding that the canonical time values used by 
> Apache 2.0
> should be APR time, i.e., microseconds since 00:00:00 Jan. 1, 
> 1970 GMT.
> Which means the saving Unix time in the ap_file_t is not the 
> correct thing
> to do. Right?

Right.  However, ap_file_t (struct file_t) was declared with
time_t members - your orig patch overflowed.  I think we all
agree that the struct members should be ap_time_t, with that
change your patch makes sense.

Forget the originals... here's crack three against this 
morning's cvs tree.  time fixes only :-)

> 
> Bill
> 
> -ap_status_t ap_write(struct file_t *thefile, void *buf, 
> ap_ssize_t *nbytes)
> +ap_status_t ap_write(ap_file_t *thefile, void *buf, 
> ap_ssize_t *nbytes)
>  {
>      DWORD bwrote;
>      FILETIME atime, mtime, ctime;
> @@ -104,9 +105,9 @@
>              FlushFileBuffers(thefile->filehand);
>              thefile->size = GetFileSize(thefile->filehand, NULL);
>              GetFileTime(thefile->filehand, &ctime, &atime, &mtime);
> -            FileTimeToAprTime(&thefile->atime, &atime);
> -            FileTimeToAprTime(&thefile->mtime, &mtime);
> -            FileTimeToAprTime(&thefile->ctime, &ctime);
> +            thefile->atime = FileTimeToUnixTime(&atime);
> +            thefile->mtime = FileTimeToUnixTime(&mtime);
> +            thefile->ctime = FileTimeToUnixTime(&ctime);
>          }
>          *nbytes = bwrote;
>          return APR_SUCCESS;
> @@ -117,7 +118,7 @@
> 
> ________________________________________________
> Bill Stoddard stoddard@raleigh.ibm.com
> 
> 
> ________________________________________________
> Bill Stoddard stoddard@raleigh.ibm.com
> 
Mime
View raw message