From: Jeff Trawick Date: Wed, 25 Oct 2000 18:54:20 +0000 (+0000) Subject: Get rid of the xlate version of ap_md5_digest() X-Git-Tag: APACHE_2_0_ALPHA_8~237 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66f97567e9c89cb112f701e3eb9907eeeacdccf5;p=apache Get rid of the xlate version of ap_md5_digest() 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 --- diff --git a/include/util_md5.h b/include/util_md5.h index d5df9e17d5..3585a79bdf 100644 --- a/include/util_md5.h +++ b/include/util_md5.h @@ -97,20 +97,13 @@ AP_DECLARE(char *) ap_md5_binary(apr_pool_t *a, const unsigned char *buf, int le */ 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 } diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 3226eff284..350bad4ee9 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -3006,13 +3006,8 @@ static int default_handler(request_rec *r) #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); diff --git a/server/util_md5.c b/server/util_md5.c index 47adc7c037..03cbb104b6 100644 --- a/server/util_md5.c +++ b/server/util_md5.c @@ -195,32 +195,6 @@ AP_DECLARE(char *) ap_md5contextTo64(apr_pool_t *a, apr_md5_ctx_t *context) 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; @@ -239,4 +213,3 @@ AP_DECLARE(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile) return ap_md5contextTo64(p, &context); } -#endif