Re: [PATCH] mod_wombat: add table_get and table_set

2007-05-07 Thread Akins, Brian
On 5/4/07 7:42 PM, "Rici Lake" <[EMAIL PROTECTED]> wrote: > In Lua, setting to nil is equivalent to deletion. So I think this should be: > > if (lua_isnoneornil(L, 3) > apr_table_unset(t, key); > else { > const char *val = luaL_checkstring(L, 3); > apr_table_set(t, key, val); >

Re: [PATCH] mod_wombat: add table_get and table_set

2007-05-04 Thread Rici Lake
A few comments intermingled into the patch: Brian McCallister wrote: > On Apr 30, 2007, at 2:02 PM, Akins, Brian wrote: > --- apr_lua.c (revision 0) > +++ apr_lua.c (revision 0) > @@ -0,0 +1,55 @@ > +#include "apr.h" > +#include "apr_tables.h" > + > +#include "lua.h" > +#include "lauxlib.h" > +#in

Re: [PATCH] mod_wombat: add table_get and table_set

2007-05-01 Thread Akins, Brian
On 4/30/07 5:53 PM, "Brian McCallister" <[EMAIL PROTECTED]> wrote: > I would like to maintain a function which is analogous to > lua_pushstring() and lua_pushinteger() for pushing the request_rec > into a function call or whatnot from the C side. > > Will this work with the hook? (I am a hook new

Re: [PATCH] mod_wombat: add table_get and table_set

2007-04-30 Thread Brian McCallister
On Apr 30, 2007, at 2:02 PM, Akins, Brian wrote: Probably more changes than needs to be in one patch: - use hooks for: -- wombat_open - called by create_vm +1 Perfect! -- wombat_request - called instead of apw_request_push I would like to maintain a function which is analogous to lua_pu

Re: [PATCH] mod_wombat: add table_get and table_set

2007-04-30 Thread Akins, Brian
Probably more changes than needs to be in one patch: - use hooks for: -- wombat_open - called by create_vm -- wombat_request - called instead of apw_request_push -added apr_lua.c and .h - only handles tables for now. Can be extended to do more in future. -- Brian Akins Chief Operations Engine

Re: [PATCH] mod_wombat: add table_get and table_set

2007-04-30 Thread Akins, Brian
On 4/27/07 2:34 PM, "Brian McCallister" <[EMAIL PROTECTED]> wrote: > We may want to consider not putting table_set and table_get on the > request, though. It might be better to have a general purpose > userdata type (metatable) for apr_table_t and put the functions > there. This would allow for so

Re: [PATCH] mod_wombat: add table_get and table_set

2007-04-27 Thread Akins, Brian
On 4/27/07 2:34 PM, "Brian McCallister" <[EMAIL PROTECTED]> wrote: > Thoughts? Sounds good to me. Like I said, I just started playing with it this morning :) If you can point me more in the right direction, I can give it a try. I was just scratching an itch. Also, I want to add quick_handler

Re: [PATCH] mod_wombat: add table_get and table_set

2007-04-27 Thread Brian McCallister
On Apr 27, 2007, at 10:48 AM, Akins, Brian wrote: Probably not the best way to do this, but adds ability to get/set on r->headers_in and r->headers_out Example usage: function handle(r) r:table_set(r.headers_out, "Lua", "Cool"); val = r:table_get(r.headers_in, "User-Agent"); r:puts("User

[PATCH] mod_wombat: add table_get and table_set

2007-04-27 Thread Akins, Brian
Probably not the best way to do this, but adds ability to get/set on r->headers_in and r->headers_out Example usage: function handle(r) r:table_set(r.headers_out, "Lua", "Cool"); val = r:table_get(r.headers_in, "User-Agent"); r:puts("User-Agent: " .. val .. "\n"); End FWW, I had never done