lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wednesday 15 December 2004 5:33 pm, Tomas wrote:
>  This function only associates an extension with a Lua
> function (this Lua function will be called by CGILua's main function
> with the filename translated from the URL by the http server).  This
> is different from URL functions: association between an URL and a function.

right, of course; what i'll try is something like this:

function setupurlfunctions ()
 
 local uf = {}

 function lfhandler (path)
  local f = uf [path]
  if (f) then
   return f()
  end
 end

 function registerurlfunction (path, f)
  uf [path] = f
 end

 cgilua.addscripthandler ("lf", lfhandler)
end

in other words, a very simple extension handler would do the url=>function 
association

maybe i would modify the fastcgi launcher to get rid of the venv() for each 
call... i still feel that it negates most of the advantages of the persistent 
state of fastCGI

the new code is much cleaner and more readable (i had read only alpha3 before 
the beta), it really invites to experiment

-- 
Javier

Attachment: pgpyVsNGonau_.pgp
Description: PGP signature