apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: apr/include apr_file_info.h
Date Wed, 31 Jan 2001 20:01:17 GMT
stoddard    01/01/31 12:01:16

  Modified:    modules/http http_request.c
               file_io/win32 filestat.c
               include  apr_file_info.h
  Log:
  apr_stat() in http_request.c only needs size, type, mtime, ctime & atime values from
  the file. Modify apr_stat() under windows to accomodate apr_stat( APR_FINFO_MIN)
  
  Revision  Changes    Path
  1.82      +1 -1      httpd-2.0/modules/http/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- http_request.c	2001/01/28 14:00:56	1.81
  +++ http_request.c	2001/01/31 20:01:16	1.82
  @@ -282,7 +282,7 @@
            * an APR_PATHINCOMPLETE result to indicate that we are staring at
            * an partial virtual root.  Only OS2/Win32/Netware need apply it :-)
            */
  -        rv = apr_stat(&r->finfo, path, APR_FINFO_NORM, r->pool);
  +        rv = apr_stat(&r->finfo, path, APR_FINFO_MIN, r->pool);
   
           if (cp != end)
               *cp = '/';
  
  
  
  1.45      +13 -3     apr/file_io/win32/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/win32/filestat.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- filestat.c	2001/01/29 17:10:19	1.44
  +++ filestat.c	2001/01/31 20:01:16	1.45
  @@ -412,7 +412,7 @@
       memset(finfo, '\0', sizeof(*finfo));
       finfo->cntxt = cont;
       finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME
  -                 | APR_FINFO_SIZE  | APR_FINFO_TYPE;
  +        | APR_FINFO_SIZE  | APR_FINFO_TYPE; /* I.e., APR_FINFO_MIN */
   
       /* File times */
       FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime);
  @@ -445,10 +445,20 @@
           finfo->filetype = APR_REG;
       }
   
  -    if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
  -        finfo->protection = APR_FREADONLY;
  +    /* 
  +     * Hummm, should we assume the file is always executable? Is there a way
  +     * to know other than guess based on the file extension or make an 
  +     * expensive system call?
  +     */
  +    if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {
  +        finfo->protection |= S_IREAD | S_IEXEC;
  +    }
  +    else {
  +        finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC;
  +    }
   
       if (wanted &= ~finfo->valid) {
  +        /* Caller wants more than APR_FINFO_MIN */
   #ifdef APR_HAS_UNICODE_FS
           if (os_level >= APR_WIN_NT)
               return more_finfo(finfo, wfname, wanted, MORE_OF_WFSPEC, os_level);
  
  
  
  1.11      +1 -1      apr/include/apr_file_info.h
  
  Index: apr_file_info.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_file_info.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- apr_file_info.h	2001/01/29 16:08:51	1.10
  +++ apr_file_info.h	2001/01/31 20:01:16	1.11
  @@ -146,7 +146,7 @@
   #define APR_FINFO_ICASE  0x01000000  /*  if dev is case insensitive */
   #define APR_FINFO_NAME   0x02000000  /*  ->name in proper case */
   
  -#define APR_FINFO_MIN    0x00008170  /*  minimal: type, dates and size */
  +#define APR_FINFO_MIN    0x00008170  /*  type, mtime, ctime, atime, size */
   #define APR_FINFO_IDENT  0x00003000  /*  dev and inode */
   #define APR_FINFO_OWNER  0x00030000  /*  user and group */
   #define APR_FINFO_PROT   0x00700000  /*  all protections */
  
  
  

Mime
View raw message