]> granicus.if.org Git - apache/commitdiff
Get rid of an instance of ap_file_os_t from the Apache source. I will
authorRyan Bloom <rbb@apache.org>
Sat, 11 Dec 1999 00:13:19 +0000 (00:13 +0000)
committerRyan Bloom <rbb@apache.org>
Sat, 11 Dec 1999 00:13:19 +0000 (00:13 +0000)
be finishing the cleansing of these interim variables over the next few
days.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84279 13f79535-47bb-0310-9956-ffa450edef68

include/util_md5.h
modules/http/http_core.c
server/util_md5.c

index c5a5e654d775d1fe43469f74602fe15008143d5d..646b080805475db1c4a5031d38e703f71415e82f 100644 (file)
@@ -68,9 +68,9 @@ API_EXPORT(char *) ap_md5(ap_context_t *a, const unsigned char *string);
 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
index 598f19dbd2f13e64d692f1037a4fd34c2067f529..9129eaf6845e46262fb6a0c5bdf505329f6b3b3e 100644 (file)
@@ -2455,7 +2455,6 @@ static int default_handler(request_rec *r)
            (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 @@ static int default_handler(request_rec *r)
                     "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 @@ static int default_handler(request_rec *r)
 #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 */
 
index 66e1a30bf371bba948d8c37a189a6ceff5854938..aceeae69db032dad38cab089ef7890fe3745d5b0 100644 (file)
@@ -190,7 +190,7 @@ API_EXPORT(char *) ap_md5contextTo64(ap_context_t *a, 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)
 {
     AP_MD5_CTX context;
     unsigned char buf[1000];
@@ -198,20 +198,21 @@ API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile, int convert)
     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 @@ API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile)
     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);
 }