You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@hyperreal.org on 1999/12/11 01:13:33 UTC

cvs commit: apache-2.0/src/main http_core.c util_md5.c

rbb         99/12/10 16:13:29

  Modified:    src/include util_md5.h
               src/main http_core.c util_md5.c
  Log:
  Get rid of an instance of ap_file_os_t from the Apache source.  I will
  be finishing the cleansing of these interim variables over the next few
  days.
  
  Revision  Changes    Path
  1.5       +2 -2      apache-2.0/src/include/util_md5.h
  
  Index: util_md5.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/util_md5.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- util_md5.h	1999/09/08 14:15:40	1.4
  +++ util_md5.h	1999/12/11 00:13:02	1.5
  @@ -68,9 +68,9 @@
   API_EXPORT(char *) ap_md5_binary(ap_context_t *a, const unsigned char *buf, int len);
   API_EXPORT(char *) ap_md5contextTo64(ap_context_t *p, AP_MD5_CTX * context);
   #ifdef CHARSET_EBCDIC
  -API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile, int convert);
  +API_EXPORT(char *) ap_md5digest(ap_context_t *p, ap_file_t *infile, int convert);
   #else
  -API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile);
  +API_EXPORT(char *) ap_md5digest(ap_context_t *p, ap_file_t *infile);
   #endif /* CHARSET_EBCDIC */
   
   #ifdef __cplusplus
  
  
  
  1.27      +2 -5      apache-2.0/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- http_core.c	1999/11/23 13:46:59	1.26
  +++ http_core.c	1999/12/11 00:13:14	1.27
  @@ -2455,7 +2455,6 @@
   	    (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
       int rangestatus, errstatus;
       ap_file_t *fd = NULL;
  -    ap_os_file_t fd_os;
       ap_status_t status;
   #ifdef USE_MMAP_FILES
       ap_mmap_t *mm = NULL;
  @@ -2507,8 +2506,6 @@
   		     "file permissions deny server access: %s", r->filename);
           return FORBIDDEN;
       }
  -    else
  -       ap_get_os_file(&fd_os, fd);
   	
       ap_update_mtime(r, r->finfo.st_mtime);
       ap_set_last_modified(r);
  @@ -2542,12 +2539,12 @@
   #ifdef CHARSET_EBCDIC
   	if (d->content_md5 & 1) {
   	    ap_table_setn(r->headers_out, "Content-MD5",
  -			  ap_md5digest(r->pool, fd_os, convert_flag));
  +			  ap_md5digest(r->pool, fd, convert_flag));
   	}
   #else
   	if (d->content_md5 & 1) {
   	    ap_table_setn(r->headers_out, "Content-MD5",
  -			  ap_md5digest(r->pool, fd_os));
  +			  ap_md5digest(r->pool, fd));
   	}
   #endif /* CHARSET_EBCDIC */
   
  
  
  
  1.6       +8 -6      apache-2.0/src/main/util_md5.c
  
  Index: util_md5.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/util_md5.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- util_md5.c	1999/11/16 18:30:49	1.5
  +++ util_md5.c	1999/12/11 00:13:19	1.6
  @@ -190,7 +190,7 @@
   
   #ifdef CHARSET_EBCDIC
   
  -API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile, int convert)
  +API_EXPORT(char *) ap_md5digest(ap_context_t *p, ap_file_t *infile, int convert)
   {
       AP_MD5_CTX context;
       unsigned char buf[1000];
  @@ -198,20 +198,21 @@
       int nbytes;
   
       ap_MD5Init(&context);
  -    while ((nbytes = read(infile, buf, sizeof(buf)))) {
  +    nbytes = sizeof(buf);
  +    while (ap_read(infile, buf, &nbytes) == APR_SUCCESS) {
   	length += nbytes;
           if (!convert) {
               ascii2ebcdic(buf, buf, nbytes);
           }
   	ap_MD5Update(&context, buf, nbytes);
       }
  -    lseek(infile, 0L, SEEK_SET);
  +    ap_seek(infile, 0L, APR_SET);
       return ap_md5contextTo64(p, &context);
   }
   
   #else
   
  -API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile)
  +API_EXPORT(char *) ap_md5digest(ap_context_t *p, ap_file_t *infile)
   {
       AP_MD5_CTX context;
       unsigned char buf[1000];
  @@ -219,11 +220,12 @@
       int nbytes;
   
       ap_MD5Init(&context);
  -    while ((nbytes = read(infile, buf, sizeof(buf)))) {
  +    nbytes = sizeof(buf);
  +    while (ap_read(infile, buf, &nbytes) == APR_SUCCESS) {
   	length += nbytes;
   	ap_MD5Update(&context, buf, nbytes);
       }
  -    lseek(infile, 0L, SEEK_SET);
  +    ap_seek(infile, 0L, APR_SET);
       return ap_md5contextTo64(p, &context);
   }