Skip to content
Browse files

lfcgi: finish()

Use with caution!
  • Loading branch information...
1 parent c21ecb1 commit cead8f07222a168750942d9141962b6fe1dc2216 @agladysh agladysh committed Apr 21, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/fastcgi/lfcgi.c
View
11 src/fastcgi/lfcgi.c
@@ -520,6 +520,16 @@ static int lfcgi_accept (lua_State *L) {
return 1;
}
+/*
+* Do not use anything from the lfcgi module except accept()
+* after you called this function. Including io.* stuff
+* if you replaced originals.
+*/
+static int lfcgi_finish (lua_State *L) {
+ FCGI_Finish();
+ return 0;
+}
+
static int lfcgi_getenv (lua_State *L) {
const char* envVar = luaL_checkstring(L, 1);
char* val = getenv(envVar);
@@ -582,6 +592,7 @@ static const luaL_reg iolib[] = {
{"type", io_type},
{"write", io_write},
{"accept", lfcgi_accept},
+ {"finish", lfcgi_finish},
{"getenv", lfcgi_getenv},
{"getpid", lfcgi_getpid},
{"environ", lfcgi_environ},

0 comments on commit cead8f0

Please sign in to comment.
Something went wrong with that request. Please try again.