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
(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;
"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);
#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 */
#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];
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];
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);
}