Re: Reducing number of mod_lua hook directives

2010-05-18 Thread Akins, Brian
On 5/12/10 11:09 AM, Brian McCallister bri...@skife.org wrote: Ah, but what happens when there are multiple functions for same hook? We could get into magic naming and scanning of global scope, but that really turns my stomach. No need. It's easy. Think about it in lua, not C. Something

Re: Reducing number of mod_lua hook directives

2010-05-12 Thread Dan Poirier
You could go even farther, and just provide a way to run some Lua code at startup, and provide Lua APIs to add hooks, handlers, or whatever else you wanted. But while as a programmer that sounds fine to me, I suspect for the average user who just wants to add a few lines to tweak something, quite

Re: Reducing number of mod_lua hook directives

2010-05-12 Thread Brian McCallister
On Tue, May 11, 2010 at 10:59 AM, Akins, Brian brian.ak...@turner.com wrote: The hook runner itself should just be in lua.  Instead of scripts, you write lua modules.  If a lua module has a function with the correct names (ie, same as hooks) it uses that: Ie in my module foo  function

Re: Reducing number of mod_lua hook directives

2010-05-12 Thread Brian McCallister
On Tue, May 11, 2010 at 8:47 PM, William A. Rowe Jr. wr...@rowe-clan.net wrote: On 5/11/2010 9:47 AM, Dan Poirier wrote: LuaHook AccessChecker funcname /path/to/script.lua I just thought of a problem - right now, the funcname is optional (defaults to handle).  I hate having optional

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread Dan Poirier
On 2010-05-10 at 16:03, William A. Rowe Jr. wr...@rowe-clan.net wrote: On 5/10/2010 2:25 PM, Brian McCallister wrote: ... to LuaHook AccessChecker /path/to/script.lua funcname LuaHook AuthChecker /path/to/script.lua funcname LuaHook CheckUserID /path/to/script.lua funcname Any

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread HyperHacker
On Tue, May 11, 2010 at 06:52, Dan Poirier poir...@pobox.com wrote: On 2010-05-10 at 16:03, William A. Rowe Jr. wr...@rowe-clan.net wrote: On 5/10/2010 2:25 PM, Brian McCallister wrote: ... to LuaHook AccessChecker /path/to/script.lua  funcname LuaHook AuthChecker   /path/to/script.lua  

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread Dan Poirier
On 2010-05-11 at 08:52, Dan Poirier poir...@pobox.com wrote: On 2010-05-10 at 16:03, William A. Rowe Jr. wr...@rowe-clan.net wrote: On 5/10/2010 2:25 PM, Brian McCallister wrote: ... to LuaHook AccessChecker /path/to/script.lua funcname LuaHook AuthChecker /path/to/script.lua funcname

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread HyperHacker
On Tue, May 11, 2010 at 08:47, Dan Poirier poir...@pobox.com wrote: On 2010-05-11 at 08:52, Dan Poirier poir...@pobox.com wrote: On 2010-05-10 at 16:03, William A. Rowe Jr. wr...@rowe-clan.net wrote: On 5/10/2010 2:25 PM, Brian McCallister wrote: ... to LuaHook AccessChecker

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread Akins, Brian
The hook runner itself should just be in lua. Instead of scripts, you write lua modules. If a lua module has a function with the correct names (ie, same as hooks) it uses that: Ie in my module foo function fixups( r ) Would get called at fixups, etc. No need for a state per file,

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread Dan Poirier
On 2010-05-11 at 12:55, HyperHacker hyperhac...@gmail.com wrote: On Tue, May 11, 2010 at 08:47, Dan Poirier poir...@pobox.com wrote: I just thought of a problem - right now, the funcname is optional (defaults to handle).  I hate having optional arguments that don't come at the end.  I'd just

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread HyperHacker
On Tue, May 11, 2010 at 20:12, Dan Poirier poir...@pobox.com wrote: On 2010-05-11 at 12:55, HyperHacker hyperhac...@gmail.com wrote: On Tue, May 11, 2010 at 08:47, Dan Poirier poir...@pobox.com wrote: I just thought of a problem - right now, the funcname is optional (defaults to handle).  I

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread Dan Poirier
On 2010-05-11 at 12:59, Akins, Brian brian.ak...@turner.com wrote: The hook runner itself should just be in lua. Instead of scripts, you write lua modules. If a lua module has a function with the correct names (ie, same as hooks) it uses that: Ie in my module foo function fixups( r )

Re: Reducing number of mod_lua hook directives

2010-05-11 Thread William A. Rowe Jr.
On 5/11/2010 9:47 AM, Dan Poirier wrote: LuaHook AccessChecker funcname /path/to/script.lua I just thought of a problem - right now, the funcname is optional (defaults to handle). I hate having optional arguments that don't come at the end. I'd just as soon make it a required argument,

Reducing number of mod_lua hook directives

2010-05-10 Thread Dan Poirier
mod_lua has 8 separate directives for adding hooks using external files with Lua code (LuaHookX) and 8 more for adding the same hooks using inline Lua code (LuaHookX). Most of the code to implement these is common. I think it'd be easier to understand - and document - the module if we

[SPAM] Re: Reducing number of mod_lua hook directives

2010-05-10 Thread Issac Goldstand
Spam detection software, running on the system heartofgold.mirimar.net, has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for

Re: Reducing number of mod_lua hook directives

2010-05-10 Thread Brian McCallister
On Mon, May 10, 2010 at 11:02 AM, Dan Poirier poir...@pobox.com wrote: mod_lua has 8 separate directives for adding hooks using external files with Lua code (LuaHookX) and 8 more for adding the same hooks using inline Lua code (LuaHookX).  Most of the code to implement these is common.

Re: Reducing number of mod_lua hook directives

2010-05-10 Thread Jeff Trawick
On Mon, May 10, 2010 at 3:25 PM, Brian McCallister bri...@skife.org wrote: On Mon, May 10, 2010 at 11:02 AM, Dan Poirier poir...@pobox.com wrote: mod_lua has 8 separate directives for adding hooks using external files with Lua code (LuaHookX) and 8 more for adding the same hooks using

Re: Reducing number of mod_lua hook directives

2010-05-10 Thread Jorge Schrauwen
+1 ~Jorge On Mon, May 10, 2010 at 9:41 PM, Jeff Trawick traw...@gmail.com wrote: On Mon, May 10, 2010 at 3:25 PM, Brian McCallister bri...@skife.org wrote: On Mon, May 10, 2010 at 11:02 AM, Dan Poirier poir...@pobox.com wrote: mod_lua has 8 separate directives for adding hooks using

Re: Reducing number of mod_lua hook directives

2010-05-10 Thread William A. Rowe Jr.
On 5/10/2010 2:25 PM, Brian McCallister wrote: ... to LuaHook AccessChecker /path/to/script.lua funcname LuaHook AuthChecker /path/to/script.lua funcname LuaHook CheckUserID /path/to/script.lua funcname Any reason not to name the func before the script, especially since path names

Re: Reducing number of mod_lua hook directives

2010-05-10 Thread Brian McCallister
On Mon, May 10, 2010 at 2:03 PM, William A. Rowe Jr. wr...@rowe-clan.net wrote: On 5/10/2010 2:25 PM, Brian McCallister wrote: ... to LuaHook AccessChecker /path/to/script.lua  funcname LuaHook AuthChecker   /path/to/script.lua  funcname LuaHook CheckUserID   /path/to/script.lua  funcname