From: Ryan Bloom Date: Sat, 11 Dec 1999 00:13:19 +0000 (+0000) Subject: Get rid of an instance of ap_file_os_t from the Apache source. I will X-Git-Tag: 1.3.10~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=516c90f02fe07418b0fa00be60543772ef861eee;p=apache 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84279 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/util_md5.h b/include/util_md5.h index c5a5e654d7..646b080805 100644 --- a/include/util_md5.h +++ b/include/util_md5.h @@ -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 diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 598f19dbd2..9129eaf684 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -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 */ diff --git a/server/util_md5.c b/server/util_md5.c index 66e1a30bf3..aceeae69db 100644 --- a/server/util_md5.c +++ b/server/util_md5.c @@ -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); }