]> granicus.if.org Git - apache/commitdiff
Improvement suggested by rpluem to proxy_date fix
authorNick Kew <niq@apache.org>
Thu, 2 Aug 2007 10:17:25 +0000 (10:17 +0000)
committerNick Kew <niq@apache.org>
Thu, 2 Aug 2007 10:17:25 +0000 (10:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@562069 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_util.c

index 129e5a6619bbb27c70ca8b41a7ae94d67fdfe0e6..bd41cdcd5a709a2d1ad508cde7de32822d3c3e3e 100644 (file)
@@ -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;
     }