Commit 4407935e authored by Graham Leggett's avatar Graham Leggett
Browse files

mod_proxy: Remove ap_proxy_date_canon() from the public API.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209812 13f79535-47bb-0310-9956-ffa450edef68
parent 45bf606e
Loading
Loading
Loading
Loading
+0 −1
Changes for modules/proxy/mod_proxy.h: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -537,7 +537,6 @@ PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, en
                                       int forcedec, int proxyreq);
PROXY_DECLARE(char *)ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
                                           char **passwordp, char **hostp, apr_port_t *port);
PROXY_DECLARE(const char *)ap_proxy_date_canon(apr_pool_t *p, const char *x);
PROXY_DECLARE(int) ap_proxy_hex2sec(const char *x);
PROXY_DECLARE(void) ap_proxy_sec2hex(int t, char *y);
PROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message);
+24 −1
Changes for modules/proxy/mod_proxy_http.c: 24 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -1245,6 +1245,29 @@ skip_body:
    return OK;
}

/*
 * If the date is a valid RFC 850 date or asctime() date, then it
 * is converted to the RFC 1123 format.
 */
static const char *date_canon(apr_pool_t *p, const char *date)
{
    apr_status_t rv;
    char* ndate;

    apr_time_t time = apr_date_parse_http(date);
    if (!time) {
        return date;
    }

    ndate = apr_palloc(p, APR_RFC822_DATE_LEN);
    rv = apr_rfc822_date(ndate, time);
    if (rv != APR_SUCCESS) {
        return date;
    }

    return ndate;
}

static void process_proxy_header(request_rec *r, proxy_dir_conf *c,
                                 const char *key, const char *value)
{
@@ -1265,7 +1288,7 @@ static void process_proxy_header(request_rec *r, proxy_dir_conf *c,
    for (i = 0; date_hdrs[i]; ++i) {
        if (!strcasecmp(date_hdrs[i], key)) {
            apr_table_add(r->headers_out, key,
                          ap_proxy_date_canon(r->pool, value));
                          date_canon(r->pool, value));
            return;
        }
    }
+0 −24
Changes for modules/proxy/proxy_util.c: 0 added lines, 24 removed lines.
Original line number Diff line number Diff line
@@ -355,30 +355,6 @@ PROXY_DECLARE(char *)
    return NULL;
}

/*
 * If the date is a valid RFC 850 date or asctime() date, then it
 * is converted to the RFC 1123 format.
 */
PROXY_DECLARE(const char *)
     ap_proxy_date_canon(apr_pool_t *p, const char *date)
{
    apr_status_t rv;
    char* ndate;

    apr_time_t time = apr_date_parse_http(date);
    if (!time) {
        return date;
    }

    ndate = apr_palloc(p, APR_RFC822_DATE_LEN);
    rv = apr_rfc822_date(ndate, time);
    if (rv != APR_SUCCESS) {
        return date;
    }

    return ndate;
}

PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r)
{
    apr_pool_t *pool;