since we don't compute digests of filtered (e.g., translated)
response bodies this way anymore. (Note that we don't do it at
all at the present; somebody needs to write a filter to do so.)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86750
13f79535-47bb-0310-9956-
ffa450edef68
*/
AP_DECLARE(char *) ap_md5contextTo64(apr_pool_t *p, apr_md5_ctx_t *context);
-#ifdef APACHE_XLATE
/**
* Create an MD5 Digest for a given file
* @param p The pool to allocate out of
* @param infile The file to create the digest for
- * @param xlate The translation header to use.
- * @warning The xlate parameter is only available if APACHE_XLATE is defined
- * @deffunc char *ap_md5digest(apr_pool_t *p, apr_file_t *infile, apr_xlate_t *xlate)
+ * @deffunc char *ap_md5digest(apr_pool_t *p, apr_file_t *infile)
*/
-AP_DECLARE(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile,
- apr_xlate_t *xlate);
-#else
AP_DECLARE(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile);
-#endif
#ifdef __cplusplus
}
#endif
if (bld_content_md5) {
-#ifdef APACHE_XLATE
- apr_table_setn(r->headers_out, "Content-MD5",
- ap_md5digest(r->pool, fd, NULL));
-#else
apr_table_setn(r->headers_out, "Content-MD5",
ap_md5digest(r->pool, fd));
-#endif /* APACHE_XLATE */
}
rangestatus = ap_set_byterange(r);
return encodedDigest;
}
-#ifdef APACHE_XLATE
-
-AP_DECLARE(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile,
- apr_xlate_t *xlate)
-{
- apr_md5_ctx_t context;
- unsigned char buf[1000];
- long length = 0;
- int nbytes;
- apr_off_t offset = 0L;
-
- apr_MD5Init(&context);
- if (xlate) {
- apr_MD5SetXlate(&context, xlate);
- }
- nbytes = sizeof(buf);
- while (apr_read(infile, buf, &nbytes) == APR_SUCCESS) {
- length += nbytes;
- apr_MD5Update(&context, buf, nbytes);
- }
- apr_seek(infile, APR_SET, &offset);
- return ap_md5contextTo64(p, &context);
-}
-
-#else
-
AP_DECLARE(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile)
{
apr_md5_ctx_t context;
return ap_md5contextTo64(p, &context);
}
-#endif