apr_file_t *fd = NULL;
apr_size_t nbytes;
- apr_off_t offset = 0;
+ apr_off_t offset = 0, zero = 0;
apr_status_t status;
if (er->fd) {
return "";
}
+ if ((status = apr_file_seek(fd, APR_SET, &zero)) != APR_SUCCESS) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, APLOGNO()
+ "Make etag: could not seek");
+ if (er->pathname) {
+ apr_file_close(fd);
+ }
+ return "";
+ }
+
apr_sha1_init(&context);
nbytes = sizeof(buf);
while ((status = apr_file_read(fd, buf, &nbytes)) == APR_SUCCESS) {