added: program reads its configuration from a config file
added: confparser directory and confparser.h and confparser.cpp class ConfParser used to parse a config file this is a generic parser, can be used by another project added: config.h, config.cpp class Config used for assigning values from a config file into the data object added: function for signals: SIGINT, SIGHUP after receiving SIGHUP the program will read its config file again git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@463 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -16,6 +16,22 @@ RequestController::RequestController()
|
||||
}
|
||||
|
||||
|
||||
RequestController::~RequestController()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
void RequestController::Close()
|
||||
{
|
||||
// don't call close(0)
|
||||
// it will be closed next time during dup(s,0)
|
||||
|
||||
// if you closed the descriptor here
|
||||
// then the database would have that descriptor (during connecting)
|
||||
// and there'll be a problem in the next loop (after SIGHUP)
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool RequestController::Init()
|
||||
@@ -77,12 +93,6 @@ bool RequestController::Init()
|
||||
|
||||
|
||||
dup2(s, 0);
|
||||
|
||||
if( !data.log_stdout )
|
||||
close(1);
|
||||
|
||||
close(2);
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -133,5 +143,13 @@ void RequestController::Loop()
|
||||
|
||||
log << log2 << "end request" << logend;
|
||||
log << log2 << "---------------------------------------------------------------------------------" << logend;
|
||||
|
||||
|
||||
// !! this should be immediately after FCGX_Accept() but signals don't want to break FCGX_Accept
|
||||
if( data.signal_hup )
|
||||
{
|
||||
FCGX_Finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user