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:
104
core/request.cpp
104
core/request.cpp
@@ -184,6 +184,9 @@ void Request::ReadEnvVariables()
|
||||
env_request_method = FCGX_GetParam("REQUEST_METHOD", env);
|
||||
env_request_uri = FCGX_GetParam("REQUEST_URI", env);
|
||||
env_http_cookie = FCGX_GetParam("HTTP_COOKIE", env);
|
||||
env_remote_addr = FCGX_GetParam("REMOTE_ADDR", env);
|
||||
|
||||
log << log1 << "IP: " << env_remote_addr << logend;
|
||||
}
|
||||
|
||||
|
||||
@@ -271,104 +274,3 @@ void Request::SendAll()
|
||||
|
||||
|
||||
|
||||
|
||||
// ----------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
|
||||
unsigned char Request::tohex(unsigned char polowa)
|
||||
{
|
||||
// polowa z zakresu 0-15
|
||||
polowa = polowa & 0xf;
|
||||
|
||||
if(polowa<10)
|
||||
polowa += '0';
|
||||
else
|
||||
polowa = polowa - 10 + 'A';
|
||||
|
||||
return polowa;
|
||||
}
|
||||
|
||||
|
||||
// cala wartosc zapisywana jest w postaci hex
|
||||
string Request::ToHex(const string & dane)
|
||||
{
|
||||
string wynik;
|
||||
unsigned int i;
|
||||
|
||||
|
||||
for(i=0 ; i<dane.length() ; ++i)
|
||||
{
|
||||
wynik += tohex(dane[i] >> 4);
|
||||
wynik += tohex(dane[i] & 0xf);
|
||||
}
|
||||
|
||||
return wynik;
|
||||
}
|
||||
|
||||
string Request::HexToString(const string & dane)
|
||||
{
|
||||
string wynik;
|
||||
unsigned int i;
|
||||
unsigned char znak,znak1,znak2;
|
||||
|
||||
if(dane.length()==0)
|
||||
return wynik;
|
||||
|
||||
for(i=0 ; i<dane.length()-1 ; i+=2)
|
||||
{
|
||||
znak1 = parsujhex(dane[i]);
|
||||
znak2 = parsujhex(dane[i+1]);
|
||||
|
||||
znak = (znak1 << 4) + znak2;
|
||||
|
||||
wynik += znak;
|
||||
}
|
||||
|
||||
return wynik;
|
||||
}
|
||||
|
||||
|
||||
string Request::ToUrl(const string & dane)
|
||||
{
|
||||
string wynik;
|
||||
unsigned int i;
|
||||
|
||||
|
||||
for(i=0 ; i<dane.length() ; ++i)
|
||||
{
|
||||
if( (dane[i]>='a' && dane[i]<='z') ||
|
||||
(dane[i]>='A' && dane[i]<='Z') ||
|
||||
(dane[i]>='0' && dane[i]<='9') ||
|
||||
dane[i]=='_' )
|
||||
{
|
||||
wynik += dane[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
wynik += '%';
|
||||
|
||||
wynik += tohex(dane[i] >> 4);
|
||||
wynik += tohex(dane[i] & 0xf);
|
||||
}
|
||||
}
|
||||
|
||||
return wynik;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user