You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by hu...@apache.org on 2012/08/17 11:41:46 UTC

svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c

Author: humbedooh
Date: Fri Aug 17 09:41:46 2012
New Revision: 1374185

URL: http://svn.apache.org/viewvc?rev=1374185&view=rev
Log: (empty)

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/lua/mod_lua.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1374185&r1=1374184&r2=1374185&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Aug 17 09:41:46 2012
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_lua: Allow scripts handled by the lua-script handler to return 
+     a status code to the client (such as a 302 or a 500) [Daniel Gruno]
+
   *) mod_proxy_ajp: Fix crash in packet dump code when logging
      with LogLevel trace7 or trace8.  PR 53730.  [Rainer Jung]
 

Modified: httpd/httpd/trunk/modules/lua/mod_lua.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/mod_lua.c?rev=1374185&r1=1374184&r2=1374185&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/mod_lua.c (original)
+++ httpd/httpd/trunk/modules/lua/mod_lua.c Fri Aug 17 09:41:46 2012
@@ -233,6 +233,7 @@ static const char* ap_lua_interpolate_st
  */
 static int lua_handler(request_rec *r)
 {
+    int rc = OK;
     if (strcmp(r->handler, "lua-script")) {
         return DECLINED;
     }
@@ -275,12 +276,15 @@ static int lua_handler(request_rec *r)
             return HTTP_INTERNAL_SERVER_ERROR;
         }
         ap_lua_run_lua_request(L, r);
-        if (lua_pcall(L, 1, 0, 0)) {
+        if (lua_pcall(L, 1, 1, 0)) {
             report_lua_error(L, r);
         }
+        if (lua_isnumber(L, -1)) {
+            rc = lua_tointeger(L, -1);
+        }
         ap_lua_release_state(L, spec, r);
     }
-    return OK;
+    return rc;
 }
 
 



Re: svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c

Posted by Rainer Jung <ra...@kippdata.de>.
On 17.08.2012 12:38, Daniel Gruno wrote:
> On 08/17/2012 12:34 PM, Igor Galić wrote:
>>
>>
>> ----- Original Message -----
>>> Please change the svn:log revision property for this revision such
>>> that your comment is documented in Subversion properly.
>>
>> Because it's a FAQ ;)
>>
>>    http://subversion.apache.org/faq.html#change-log-msg
>
> Thanks, Igor and Rüdiger, for the pointers - I'm still a bit new to svn
> in some regards :). It should be fixed now.

So many people where responding, because it happens to most of us every 
now and then (missing or incomplete log entry, or typo).

Regards,

Rainer


Re: svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c

Posted by Daniel Gruno <ru...@cord.dk>.
On 08/17/2012 12:34 PM, Igor Galić wrote:
> 
> 
> ----- Original Message -----
>> Please change the svn:log revision property for this revision such
>> that your comment is documented in Subversion properly.
> 
> Because it's a FAQ ;)
> 
>   http://subversion.apache.org/faq.html#change-log-msg

Thanks, Igor and Rüdiger, for the pointers - I'm still a bit new to svn
in some regards :). It should be fixed now.

With regards,
Daniel.


Re: svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> Please change the svn:log revision property for this revision such
> that your comment is documented in Subversion properly.

Because it's a FAQ ;)

  http://subversion.apache.org/faq.html#change-log-msg

> Regards
> 
> Rüdiger
> 
> -----Original Message-----
> From: Daniel Gruno
> Sent: Friday, August 17, 2012 12:25 PM
> To: dev@httpd.apache.org
> Subject: Re: svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES
> modules/lua/mod_lua.c
> 
> On 08/17/2012 12:19 PM, Guenter Knauf wrote:
> > Daniel,
> > Am 17.08.2012 11:41, schrieb humbedooh@apache.org:
> >> Author: humbedooh
> >> Date: Fri Aug 17 09:41:46 2012
> >> New Revision: 1374185
> >>
> >> URL: http://svn.apache.org/viewvc?rev=1374185&view=rev
> >> Log: (empty)
> > can you please also provide a log entry?
> > 
> > Gün.
> > 
> > 
> I'm very sorry about that, something ate my log entry, it seems.
> I can provide one here if that will do the trick:
> 
> mod_lua: Allow scripts handled by the lua-script handler to set a
> return
> code that will be sent to the client, such as 302, 500 etc. This will
> allow scripts to be able to f.x. redirect a user to another page by
> returning 302.
> 
> If there's anything else I do (somewhere I need to provide this
> entry),
> I'm all ears.
> 
> With regards,
> Daniel.
> 

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


RE: svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c

Posted by Plüm, Rüdiger, Vodafone Group <ru...@vodafone.com>.
Please change the svn:log revision property for this revision such that your comment is documented in Subversion properly.

Regards

Rüdiger 

-----Original Message-----
From: Daniel Gruno  
Sent: Friday, August 17, 2012 12:25 PM
To: dev@httpd.apache.org
Subject: Re: svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c

On 08/17/2012 12:19 PM, Guenter Knauf wrote:
> Daniel,
> Am 17.08.2012 11:41, schrieb humbedooh@apache.org:
>> Author: humbedooh
>> Date: Fri Aug 17 09:41:46 2012
>> New Revision: 1374185
>>
>> URL: http://svn.apache.org/viewvc?rev=1374185&view=rev
>> Log: (empty)
> can you please also provide a log entry?
> 
> Gün.
> 
> 
I'm very sorry about that, something ate my log entry, it seems.
I can provide one here if that will do the trick:

mod_lua: Allow scripts handled by the lua-script handler to set a return
code that will be sent to the client, such as 302, 500 etc. This will
allow scripts to be able to f.x. redirect a user to another page by
returning 302.

If there's anything else I do (somewhere I need to provide this entry),
I'm all ears.

With regards,
Daniel.

Re: svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c

Posted by Daniel Gruno <ru...@cord.dk>.
On 08/17/2012 12:19 PM, Guenter Knauf wrote:
> Daniel,
> Am 17.08.2012 11:41, schrieb humbedooh@apache.org:
>> Author: humbedooh
>> Date: Fri Aug 17 09:41:46 2012
>> New Revision: 1374185
>>
>> URL: http://svn.apache.org/viewvc?rev=1374185&view=rev
>> Log: (empty)
> can you please also provide a log entry?
> 
> Gün.
> 
> 
I'm very sorry about that, something ate my log entry, it seems.
I can provide one here if that will do the trick:

mod_lua: Allow scripts handled by the lua-script handler to set a return
code that will be sent to the client, such as 302, 500 etc. This will
allow scripts to be able to f.x. redirect a user to another page by
returning 302.

If there's anything else I do (somewhere I need to provide this entry),
I'm all ears.

With regards,
Daniel.

Re: svn commit: r1374185 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c

Posted by Guenter Knauf <fu...@apache.org>.
Daniel,
Am 17.08.2012 11:41, schrieb humbedooh@apache.org:
> Author: humbedooh
> Date: Fri Aug 17 09:41:46 2012
> New Revision: 1374185
>
> URL: http://svn.apache.org/viewvc?rev=1374185&view=rev
> Log: (empty)
can you please also provide a log entry?

Gün.