Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 8669 invoked from network); 7 Nov 2010 10:51:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Nov 2010 10:51:14 -0000 Received: (qmail 91722 invoked by uid 500); 7 Nov 2010 10:51:44 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 91278 invoked by uid 500); 7 Nov 2010 10:51:41 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 91270 invoked by uid 99); 7 Nov 2010 10:51:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Nov 2010 10:51:40 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nickgearls@gmail.com designates 209.85.215.45 as permitted sender) Received: from [209.85.215.45] (HELO mail-ew0-f45.google.com) (209.85.215.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Nov 2010 10:51:30 +0000 Received: by ewy3 with SMTP id 3so3039649ewy.18 for ; Sun, 07 Nov 2010 02:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=BmYzILtUB5rONZXPRpa5alEcvQC7v/sIu47Ben0HLNY=; b=gxTsdoKi3Lr16B1DeASQO55JLZfLFYG4jPhX/QMkDdrIkIJgm63aCNMLWo6VmhWfeC bK59N6NQCEVEKtejpSzfChMbTRhSu/KwqIhmUGALR84NqRBVB6A0CSxQcziV8Wpcbae1 U8KZkbnlrpxvNKkaGNovPa+px9dzQStrr5HyQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=Lwj04afMQq1A1KSaPgY9MQfpN1+aewX/u9zVmwlUso5w2xot2VXNes2Dcf3eSQ/pLR q22J9ifLFHB6wl3kKPxjVEFmkk9jAQIPwCTe64CK4+IpTTOS24j48oinFNl7gEIZfqoB eD8wjYHDoIHxBVT5fDQzMVr0MM/s2lwM6/DCc= Received: by 10.213.34.198 with SMTP id m6mr3179342ebd.68.1289127070205; Sun, 07 Nov 2010 02:51:10 -0800 (PST) Received: from [127.0.0.1] ([109.236.133.197]) by mx.google.com with ESMTPS id b52sm3049615eei.1.2010.11.07.02.51.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 07 Nov 2010 02:51:09 -0800 (PST) Message-ID: <4CD68497.7050901@gmail.com> Date: Sun, 07 Nov 2010 11:51:03 +0100 From: Nick Gearls Reply-To: nickgearls@gmail.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Development Apache Subject: Re: mod_substitute tags parsing Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Actually, the problem is that apr_table_get(r->subprocess_env, a) always returns null. I suppose that the problem lies in the request variable "r". I am using f->r where f is the "ap_filter_t" given as parameter to do_pattmatch(). Should I use another one, Thanks, Nick -------- Original Message -------- Subject: mod_substitute tags parsing Date: Sat, 06 Nov 2010 18:19:33 +0100 From: Nick Gearls Reply-To: nickgearls@gmail.com To: Development Apache Hello, I took the tags parsing code from mod_headers to incorporate it to mod_substitute. It almost works, but I cannot obtain the handlers via apr_hash_get() - even the locally defined ones (%D & %t). They are all registered: static int tags_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) { format_tag_hash = apr_hash_make(p); register_format_tag_handler("D", (const void *)tags_request_duration); register_format_tag_handler("t", (const void *)tags_request_time); register_format_tag_handler("e", (const void *)tags_request_env_var); register_format_tag_handler("s", (const void *)tags_request_ssl_var); return OK; } Any idea what could be the problem? Btw, I copied the code from mod_headers and it is 98% identical, so I'll modularise it to be 100% portable between these 2 modules (and others). The next step will be to remove it from the modules itself and make the static functions global. Thanks, Nick