httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1201444 - in /httpd/test/framework/trunk/t: conf/extra.conf.in htdocs/modules/lua/hello2.lua htdocs/modules/lua/translate.lua modules/lua.t
Date Sun, 13 Nov 2011 15:50:34 GMT
Author: covener
Date: Sun Nov 13 15:50:34 2011
New Revision: 1201444

URL: http://svn.apache.org/viewvc?rev=1201444&view=rev
Log:
catch up with r1201443 and verify that config sections are merged properly.

Added:
    httpd/test/framework/trunk/t/htdocs/modules/lua/hello2.lua
Modified:
    httpd/test/framework/trunk/t/conf/extra.conf.in
    httpd/test/framework/trunk/t/htdocs/modules/lua/translate.lua
    httpd/test/framework/trunk/t/modules/lua.t

Modified: httpd/test/framework/trunk/t/conf/extra.conf.in
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/extra.conf.in?rev=1201444&r1=1201443&r2=1201444&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Sun Nov 13 15:50:34 2011
@@ -878,6 +878,18 @@ LimitRequestFields    32
 
 <IfModule mod_lua.c>
    AddHandler lua-script .lua 
-
    LuaHookTranslateName @SERVERROOT@/htdocs/modules/lua/translate.lua translate_name
+   <Location /modules/lua/translate-inherit-after>
+     LuaHookTranslateName @SERVERROOT@/htdocs/modules/lua/translate.lua translate_name2
+     LuaInherit PARENT_LAST
+   </Location>
+   <Location /modules/lua/translate-inherit-before>
+     LuaHookTranslateName @SERVERROOT@/htdocs/modules/lua/translate.lua translate_name2
+     LuaInherit PARENT_FIRST
+   </Location>
+   <Location /modules/lua/translate-inherit-default-before>
+     LuaHookTranslateName @SERVERROOT@/htdocs/modules/lua/translate.lua translate_name2
+     # default: LuaInherit PARENT_FIRST
+   </Location>
+
 </IfModule>

Added: httpd/test/framework/trunk/t/htdocs/modules/lua/hello2.lua
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/lua/hello2.lua?rev=1201444&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/lua/hello2.lua (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/lua/hello2.lua Sun Nov 13 15:50:34 2011
@@ -0,0 +1,4 @@
+function handle(r)
+    r.content_type = "text/plain"
+    r:puts("other lua handler\n")
+end

Modified: httpd/test/framework/trunk/t/htdocs/modules/lua/translate.lua
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/lua/translate.lua?rev=1201444&r1=1201443&r2=1201444&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/lua/translate.lua (original)
+++ httpd/test/framework/trunk/t/htdocs/modules/lua/translate.lua Sun Nov 13 15:50:34 2011
@@ -1,9 +1,28 @@
 require 'apache2'
 
 function translate_name(r)
-    if r.uri == "/modules/lua/translate-me" then
+    r:debug("translate_name: " .. r.uri) 
+    local query = r:parseargs()
+    if query.translateme then
+        r:debug("translate_name: translateme  was true " .. r.uri) 
         r.uri = "/modules/lua/hello.lua"
         return apache2.DECLINED
     end
     return apache2.DECLINED
 end
+
+function translate_name2(r)
+    r:debug("translate_name2: " .. r.uri) 
+    local query = r:parseargs()
+    if (query.ok) then
+        r:debug("will return OK")
+    end
+    if query.translateme then
+        r.uri = "/modules/lua/hello2.lua"
+        if query.ok then
+	  r.filename= r.document_root .. r.uri
+          return apache2.OK
+        end
+    end
+    return apache2.DECLINED
+end

Modified: httpd/test/framework/trunk/t/modules/lua.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/lua.t?rev=1201444&r1=1201443&r2=1201444&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/lua.t (original)
+++ httpd/test/framework/trunk/t/modules/lua.t Sun Nov 13 15:50:34 2011
@@ -19,7 +19,17 @@ my $pfx = "/modules/lua";
 my @ts = (
     { url => "$pfx/hello.lua", rcontent => "Hello Lua World!\n", 
       ctype => "text/plain" },
-    { url => "$pfx/translate-me", rcontent => "Hello Lua World!\n" },
+    { url => "$pfx/404?translateme=1", rcontent => "Hello Lua World!\n" },
+
+    { url => "$pfx/translate-inherit-before/404?translateme=1", rcontent => "other
lua handler\n" },
+    { url => "$pfx/translate-inherit-default-before/404?translateme=1", rcontent =>
"other lua handler\n" },
+    { url => "$pfx/translate-inherit-after/404?translateme=1", rcontent => "Hello Lua
World!\n" },
+
+    { url => "$pfx/translate-inherit-before/404?translateme=1&ok=1", rcontent =>
"other lua handler\n" },
+    { url => "$pfx/translate-inherit-default-before/404?translateme=1&ok=1", rcontent
=> "other lua handler\n" },
+    # the more specific translate_name handler will run first and return OK.
+    { url => "$pfx/translate-inherit-after/404?translateme=1&ok=1", rcontent =>
"other lua handler\n" },
+
     { url => "$pfx/version.lua", rcontent => qr(^$version) },
     { url => "$pfx/method.lua", rcontent => "GET" },
     { url => "$pfx/201.lua", rcontent => "", code => 201 },



Mime
View raw message