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);
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)
{
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;
}
}
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;