From: Nick Kew Date: Thu, 2 Aug 2007 10:17:25 +0000 (+0000) Subject: Improvement suggested by rpluem to proxy_date fix X-Git-Tag: 2.3.0~1657 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e206de8a2730405a606418c409eaedd6f9cdd39;p=apache Improvement suggested by rpluem to proxy_date fix git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@562069 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 129e5a6619..bd41cdcd5a 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -314,25 +314,16 @@ PROXY_DECLARE(const char *) ap_proxy_date_canon(apr_pool_t *p, const char *date) { apr_status_t rv; - apr_time_exp_t tm; - apr_size_t retsize; char* ndate; - static const char format[] = "%a, %d %b %Y %H:%M:%S GMT"; + apr_time_t time = apr_date_parse_http(date); if (!time) { return date; } - rv = apr_time_exp_gmt(&tm, time); - - if (rv != APR_SUCCESS) { - return date; - } - ndate = apr_palloc(p, APR_RFC822_DATE_LEN); - rv = apr_strftime(ndate, &retsize, APR_RFC822_DATE_LEN, format, &tm); - - if (rv != APR_SUCCESS || !retsize) { + rv = apr_rfc822_date(ndate, time); + if (rv != APR_SUCCESS) { return date; }