lua-users home
lua-l archive

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


On Sun, Dec 02, 2012 at 08:52:47PM -0800, Paul K wrote:
> > That said, the libevent dependancy isn't easily dropped (read: large
> > amounts of code would need to be rewritten) and even then I can't
> > imagine being able to completely avoid libraries/C code since CGI isn't
> > going to let routing happen.
> 
> I agree; I was only thinking about doing just enough using copas and
> some HTTP handling code to allow your request/response API to work.
> 
> I looked at libevent HTTP support
> (https://github.com/libevent/libevent/blob/master/http.c) and wouldn't
> want to re-implement those 5k lines of code, but how much of that API
> is needed to get your examples running? It seems like if these are
> implemented in Lua, it should be possible to use flea without any
> modifications, no?
> 
> 	{ "write", request_write },
> 	{ "clear", request_clear },
> 	{ "getHeader", request_getHeader },
> 	{ "addHeader", request_addHeader },
> 	{ "clearHeaders", request_clearHeaders },
> 	{ "postData", request_postData },
> 	{ "sendFile", request_sendFile },
> 	{ "send", request_send },
> 
> Paul.

You (will at some point) also need some way of uniquely identifying
connections and when they disconnect for the eventing system to play
nicely.

You're also missing a few functions:
	flea_parseQuery
	flea_randomBytes

But I suppose those are trivial.

Mike