Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 37919 invoked from network); 24 Aug 2004 11:55:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 24 Aug 2004 11:55:26 -0000 Received: (qmail 53482 invoked by uid 500); 24 Aug 2004 11:55:25 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 53355 invoked by uid 500); 24 Aug 2004 11:55:24 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 53341 invoked by uid 500); 24 Aug 2004 11:55:24 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 53338 invoked by uid 99); 24 Aug 2004 11:55:24 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Tue, 24 Aug 2004 04:55:24 -0700 Received: (qmail 37892 invoked by uid 1526); 24 Aug 2004 11:55:23 -0000 Date: 24 Aug 2004 11:55:23 -0000 Message-ID: <20040824115523.37891.qmail@minotaur.apache.org> From: mturk@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/proxy ajp_header.c X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mturk 2004/08/24 04:55:23 Modified: modules/proxy ajp_header.c Log: Implement REQ_ATTRIBUTE using request rec environment table, so we can use standard SetEnv directive for that. The ajp specific attributes has to be prefixed using 'AJP_', and are passed withouth that prefix to the backend. Revision Changes Path 1.3 +13 -11 httpd-2.0/modules/proxy/ajp_header.c Index: ajp_header.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/proxy/ajp_header.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ajp_header.c 24 Aug 2004 11:28:10 -0000 1.2 +++ ajp_header.c 24 Aug 2004 11:55:23 -0000 1.3 @@ -212,6 +212,8 @@ char *remote_host; char *uri; const char *session_route; + const apr_array_header_t *arr = apr_table_elts(r->subprocess_env); + const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "Into ajp_marshal_into_msgb"); @@ -390,22 +392,22 @@ } } */ - - /* XXXX ignored for the moment - if (s->num_attributes > 0) { - for (i = 0 ; i < s->num_attributes ; i++) { - if (ajp_msg_append_uint8(msg, SC_A_REQ_ATTRIBUTE) || - ajp_msg_append_string(msg, s->attributes_names[i]) || - ajp_msg_append_string(msg, s->attributes_values[i])) { + /* Use the environment vars prefixed with AJP_ + * and pass it to the header striping that prefix. + */ + for (i = 0; i < (apr_uint32_t)arr->nelts; i++) { + if (!strncmp(elts[i].key, "AJP_", 4)) { + if (ajp_msg_append_uint8(msg, SC_A_REQ_ATTRIBUTE) || + ajp_msg_append_string(msg, elts[i].key + 4) || + ajp_msg_append_string(msg, elts[i].val)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, - "Error ajp_marshal_into_msgb - " - "Error appending attribute %s=%s", - s->attributes_names[i], s->attributes_values[i]); + "Error ajp_marshal_into_msgb - " + "Error appending attribute %s=%s", + elts[i].key, elts[i].val); return APR_EGENERAL; } } } - */ if (ajp_msg_append_uint8(msg, SC_A_ARE_DONE)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,