removed some thread and ticket information from request

they are in FunThread and FunTicket classes now
added funtion FunUptime (I forgot about it)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@631 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-08-10 20:43:38 +00:00
parent 76897b8a83
commit 9901c63ede
79 changed files with 1219 additions and 993 deletions

View File

@@ -47,14 +47,14 @@ void Request::ClearPostFileTmp()
{
// deleting temporary files (if exists)
while( !post_file_table.empty() )
while( !post_file_tab.empty() )
{
const std::string & tmp_filename = post_file_table.begin()->second.tmp_filename;
const std::string & tmp_filename = post_file_tab.begin()->second.tmp_filename;
if( unlink(tmp_filename.c_str()) == 0 )
log << log3 << "Request: deleted tmp file: " << tmp_filename << logend;
post_file_table.erase(post_file_table.begin());
post_file_tab.erase(post_file_tab.begin());
}
}
@@ -67,10 +67,10 @@ void Request::Clear()
if( ++id == 0 )
++id;
get_table.clear();
post_table.clear();
post_file_table.clear();
cookie_table.clear();
get_tab.clear();
post_tab.clear();
post_file_tab.clear();
cookie_tab.clear();
method = none;
role = responder;
@@ -78,7 +78,7 @@ void Request::Clear()
headers.str("");
page.str("");
debug.str("");
notify.str("");
//notify.str("");
env_request_method = &char_empty;
env_request_uri = &char_empty;
@@ -93,22 +93,14 @@ void Request::Clear()
session = 0;
item_table.clear();
item_tab.clear();
item.Clear();
dir_table.clear();
dir_tab.clear();
is_item = false;
pfunction = 0;
param_table.clear();
function = 0;
param_tab.clear();
status = WINIX_ERR_OK;
is_thread = false;
thread.Clear();
thread_tab.clear();
is_ticket = false;
ticket.Clear();
ticket_tab.clear();
notify_code = 0;
browser_msie = false;
@@ -154,11 +146,11 @@ void Request::SetCookie(const char * name, long value, tm * expires)
bool Request::IsPostVar(const char * var)
{
PostTable::iterator p;
PostTab::iterator p;
p = post_table.find(var);
p = post_tab.find(var);
if( p == post_table.end() )
if( p == post_tab.end() )
return false;
return true;
@@ -168,9 +160,9 @@ return true;
std::string * Request::PostVar(const char * var)
{
PostTable::iterator p = post_table.find(var);
PostTab::iterator p = post_tab.find(var);
if( p == post_table.end() )
if( p == post_tab.end() )
return 0;
return &(p->second);
@@ -180,9 +172,9 @@ return &(p->second);
bool Request::PostVar(const char * var, std::string & result)
{
PostTable::iterator p = post_table.find(var);
PostTab::iterator p = post_tab.find(var);
if( p == post_table.end() )
if( p == post_tab.end() )
{
result.clear();
return false;
@@ -200,11 +192,11 @@ return true;
//
void Request::PrintGetTable()
void Request::PrintGetTab()
{
debug << "get_table: " << get_table.size() << "\n";
debug << "get_tab: " << get_tab.size() << "\n";
for(GetTable::iterator i = get_table.begin() ; i != get_table.end() ; ++i)
for(GetTab::iterator i = get_tab.begin() ; i != get_tab.end() ; ++i)
debug << " \"" << *i << "\"\n";
debug << std::endl;
@@ -327,9 +319,9 @@ void Request::CheckMethod()
bool Request::AllPostVarEmpty()
{
PostTable::iterator i;
PostTab::iterator i;
for(i=post_table.begin() ; i!=post_table.end() ; ++i)
for(i=post_tab.begin() ; i!=post_tab.end() ; ++i)
if( !i->second.empty() )
return false;
@@ -342,7 +334,7 @@ return true;
void Request::ReadParameters()
{
// !! wrzucic jako skladowa klasy
GetParser get_parser(env_request_uri, get_table);
GetParser get_parser(env_request_uri, get_tab);
get_parser.Parse();
if( method == post )
@@ -352,17 +344,17 @@ void Request::ReadParameters()
log << log3 << "Request: post content type: multipart/form-data" << logend;
post_multi_parser.SetConfig(config);
post_multi_parser.Parse(in, post_table, post_file_table);
post_multi_parser.Parse(in, post_tab, post_file_tab);
}
else
{
// !! wrzucic jako skladowa klasy
PostParser post_parser(in, post_table);
PostParser post_parser(in, post_tab);
post_parser.Parse();
}
}
CookieParser cookie_parser(env_http_cookie, cookie_table);
CookieParser cookie_parser(env_http_cookie, cookie_tab);
cookie_parser.Parse();
accept_encoding_parser.Parse(env_http_accept_encoding);
@@ -491,7 +483,7 @@ void Request::SendPage(bool compressing, const std::string & source_ref)
const std::string * source = &source_ref;
bool raw = is_item && item.content_type == Item::ct_raw && status == WINIX_ERR_OK &&
pfunction && (pfunction->fun.url == "cat" || pfunction->fun.url == "run");
function && (function->fun.url == "cat" || function->fun.url == "run");
if( config->html_filter && !raw )
{
@@ -550,9 +542,9 @@ bool compressing = config->compression && role == responder && redirect_to.empty
bool Request::IsParam(const char * param_name)
{
ParamTable::iterator i;
ParamTab::iterator i;
for(i=param_table.begin() ; i!=param_table.end() ; ++i)
for(i=param_tab.begin() ; i!=param_tab.end() ; ++i)
{
// !! make sure that exists std::string::operator==(const char*)
// (optimization)
@@ -566,9 +558,9 @@ return false;
const std::string & Request::ParamValue(const char * param_name)
{
ParamTable::iterator i;
ParamTab::iterator i;
for(i=param_table.begin() ; i!=param_table.end() ; ++i)
for(i=param_tab.begin() ; i!=param_tab.end() ; ++i)
{
if( i->name == param_name )
{