lua-users home
lua-l archive

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


I made a strange observation in a FastCGI program written in C, that
calls Lua to do the actual work.  The basic outline is as follows:

	while (FCGI_Accept() >= 0) {
		fcgi_handler(config);
		FCGI_Finish();
	}

The fcgi_handler() calls Lua code using lua_pcall().  Nothing fancy.

When the Lua function returns without error, everything is fine, the
accept loop above is called once per request.

As soon as the Lua returns an error, however, the accept loop above is
run twice.

Does Lua somehow modify stdin, stdout, stderr or the environment when an
error happens?  That would partly explain above behaviour.