37 void prepare(
const Request& request,
const std::string& scriptPath,
const std::string& interpreterOverride =
"");
69 std::map<std::string, std::string>
_env;
static void cleanupAllProcesses()
Cleans up all active CGI processes on server shutdown. Sends SIGTERM to all processes,...
static void _registerPid(pid_t pid)
static std::set< pid_t > _activePids
CGIManager & operator=(const CGIManager &other)
std::map< std::string, std::string > _env
void _buildEnvMap(const Request &request, const std::string &scriptPath)
void prepare(const Request &request, const std::string &scriptPath, const std::string &interpreterOverride="")
Prepares the environment and arguments for executing a CGI script.
std::vector< std::string > _scriptArgv
void execute(int inputFd)
Forks, redirs input file and outpipe, and executes the CGI script.
bool isDone()
Checks if the child process has finished executing (Non-blocking); waitpid with WNOHANG.
static bool _isSpawnLimitReached()
static void _unregisterPid(pid_t pid)
static void _reapFinishedActivePids()