Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
lfcgi: finish()
Browse files Browse the repository at this point in the history
Use with caution!
  • Loading branch information
agladysh committed Apr 21, 2011
1 parent c21ecb1 commit cead8f0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/fastcgi/lfcgi.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit cead8f0

Please sign in to comment.