Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 91707 invoked from network); 13 Jan 2009 08:44:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jan 2009 08:44:34 -0000 Received: (qmail 52944 invoked by uid 500); 13 Jan 2009 08:44:27 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 52887 invoked by uid 500); 13 Jan 2009 08:44:27 -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 52878 invoked by uid 99); 13 Jan 2009 08:44:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 00:44:27 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [209.85.219.21] (HELO mail-ew0-f21.google.com) (209.85.219.21) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 08:44:18 +0000 Received: by ewy14 with SMTP id 14so11700119ewy.0 for ; Tue, 13 Jan 2009 00:43:57 -0800 (PST) Received: by 10.210.125.13 with SMTP id x13mr568474ebc.11.1231836237480; Tue, 13 Jan 2009 00:43:57 -0800 (PST) Received: from ?10.14.118.227? ([193.253.141.90]) by mx.google.com with ESMTPS id m5sm1489048gve.3.2009.01.13.00.43.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Jan 2009 00:43:56 -0800 (PST) References: <9338f5ad0901112020h30b013f9o201d87bfead7c43d@mail.gmail.com> <9338f5ad0901122028r79403a66p44a232ce2380cdf4@mail.gmail.com> Message-Id: <90C2A4E2-C5F6-4C00-B5CF-05E79821762A@mamasam.net> From: Bertrand Mansion To: "dev@httpd.apache.org" In-Reply-To: <9338f5ad0901122028r79403a66p44a232ce2380cdf4@mail.gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable X-Mailer: iPhone Mail (5G77) Mime-Version: 1.0 (iPhone Mail 5G77) Subject: Re: patch for handling headers_in and headers_out as tables in mod_lua Date: Tue, 13 Jan 2009 09:43:21 +0100 Cc: "dev@httpd.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org +1 Le 13 janv. 09 =C3=A0 05:28, "Brian McCallister" a =20= =C3=A9crit : > Nudge -- if there are no objections to the patch, would someone be > kind enough to apply it? > > -Brian > > On Sun, Jan 11, 2009 at 8:20 PM, Brian McCallister =20 > wrote: >> The attached patch changes headers_in and headers_out handling in >> mod_lua as boxed userdata rather than functions. >> >> Basically we go from: >> >> -- OLD >> function handle(r) >> local host =3D r.headers_in("host") >> r:puts(host) >> end >> >> to >> >> -- NEW >> function handle(r) >> local host =3D r.headers_in['host'] >> r:puts(host) >> >> -- and can now modify them >> r.headers_in['X-XX-Fake'] =3D 'rabbits!' >> r.headers_out['wombat'] =3D 'lua now!' >> end >> >> In order to treat tables idiommatically, it also corrects the >> apl_push_apr_table(..) function to behave as a regular lua style push >> function instead of a set function. >> >> -Brian >>