changed: added Cur structure
we have there two pointers: Request * request; Session * session; these are the current request and the current session the session GC was moved to SessionManager (was in SessionContainer) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
void FunctionParser::SkipEmptyString(const char * msg)
|
||||
{
|
||||
for( ; get_index != get_tab_len && request->get_tab[get_index].empty() ; ++get_index )
|
||||
for( ; get_index != get_tab_len && cur->request->get_tab[get_index].empty() ; ++get_index )
|
||||
log << log3 << msg << logend;
|
||||
}
|
||||
|
||||
@@ -31,14 +31,14 @@ void FunctionParser::ParseDirectories()
|
||||
if( !pdir )
|
||||
{
|
||||
// there is no the root dir
|
||||
request->status = WINIX_ERR_NO_ROOT_DIR;
|
||||
cur->request->status = WINIX_ERR_NO_ROOT_DIR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
while( true )
|
||||
{
|
||||
request->dir_tab.push_back( pdir );
|
||||
cur->request->dir_tab.push_back( pdir );
|
||||
log << log3 << "FP: Directory: ";
|
||||
|
||||
if( pdir->parent_id == -1 )
|
||||
@@ -51,7 +51,7 @@ void FunctionParser::ParseDirectories()
|
||||
if( get_index == get_tab_len )
|
||||
break;
|
||||
|
||||
pdir = system->dirs.GetDir(request->get_tab[get_index], pdir->id);
|
||||
pdir = system->dirs.GetDir(cur->request->get_tab[get_index], pdir->id);
|
||||
|
||||
if( !pdir )
|
||||
break;
|
||||
@@ -59,7 +59,7 @@ void FunctionParser::ParseDirectories()
|
||||
++get_index;
|
||||
}
|
||||
|
||||
request->last_item = request->dir_tab.back();
|
||||
cur->request->last_item = cur->request->dir_tab.back();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,26 +71,26 @@ void FunctionParser::ParseItem()
|
||||
if( get_index == get_tab_len )
|
||||
return;
|
||||
|
||||
// request->dir_tab has at least one element
|
||||
long parent_id = request->dir_tab.back()->id;
|
||||
const std::wstring & url = request->get_tab[get_index];
|
||||
// cur->request->dir_tab has at least one element
|
||||
long parent_id = cur->request->dir_tab.back()->id;
|
||||
const std::wstring & url = cur->request->get_tab[get_index];
|
||||
|
||||
request->status = db->GetItem(parent_id, url, request->item);
|
||||
cur->request->status = db->GetItem(parent_id, url, cur->request->item);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
request->last_item = &request->item;
|
||||
cur->request->last_item = &cur->request->item;
|
||||
|
||||
if( request->role == Request::authorizer && request->item.file_type == WINIX_ITEM_FILETYPE_NONE )
|
||||
if( cur->request->role == Request::authorizer && cur->request->item.file_type == WINIX_ITEM_FILETYPE_NONE )
|
||||
{
|
||||
log << log1 << "FP: item.url: " << url << " exists but has not a static content (authorizer role)" << logend;
|
||||
request->status = WINIX_ERR_NO_ITEM;
|
||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
||||
return;
|
||||
}
|
||||
|
||||
++get_index;
|
||||
request->is_item = true;
|
||||
log << log3 << "FP: Item: id: " << request->item.id << ", url: " << request->item.url << logend;
|
||||
cur->request->is_item = true;
|
||||
log << log3 << "FP: Item: id: " << cur->request->item.id << ", url: " << cur->request->item.url << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -107,13 +107,13 @@ void FunctionParser::ParseFunction()
|
||||
if( get_index == get_tab_len )
|
||||
return;
|
||||
|
||||
request->function = functions->Find(request->get_tab[get_index]);
|
||||
cur->request->function = functions->Find(cur->request->get_tab[get_index]);
|
||||
|
||||
|
||||
if( request->function )
|
||||
if( cur->request->function )
|
||||
{
|
||||
++get_index;
|
||||
log << log3 << "FP: Function: " << request->function->fun.url << logend;
|
||||
log << log3 << "FP: Function: " << cur->request->function->fun.url << logend;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ size_t i;
|
||||
param.value = par.substr(i+1);
|
||||
}
|
||||
|
||||
request->param_tab.push_back(param);
|
||||
cur->request->param_tab.push_back(param);
|
||||
|
||||
log << log3 << "FP: Param: name=" << param.name;
|
||||
|
||||
@@ -165,45 +165,45 @@ void FunctionParser::ParseParams()
|
||||
if( get_index == get_tab_len )
|
||||
break;
|
||||
|
||||
ParseParams(request->get_tab[get_index]);
|
||||
ParseParams(cur->request->get_tab[get_index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FunctionParser::Parse(Request * prequest, Db * pdb, Functions * pfunctions, System * psystem)
|
||||
void FunctionParser::Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem)
|
||||
{
|
||||
request = prequest;
|
||||
db = pdb;
|
||||
functions = pfunctions;
|
||||
cur = pcur;
|
||||
system = psystem;
|
||||
functions = pfunctions;
|
||||
|
||||
request->status = WINIX_ERR_OK;
|
||||
cur->request->status = WINIX_ERR_OK;
|
||||
get_index = 0;
|
||||
get_tab_len = request->get_tab.size();
|
||||
request->function = 0;
|
||||
request->is_item = false;
|
||||
get_tab_len = cur->request->get_tab.size();
|
||||
cur->request->function = 0;
|
||||
cur->request->is_item = false;
|
||||
|
||||
ParseDirectories();
|
||||
|
||||
if( request->status != WINIX_ERR_OK )
|
||||
if( cur->request->status != WINIX_ERR_OK )
|
||||
return;
|
||||
|
||||
ParseFunction();
|
||||
|
||||
if( !request->function )
|
||||
if( !cur->request->function )
|
||||
{
|
||||
ParseItem();
|
||||
|
||||
if( request->status != WINIX_ERR_OK )
|
||||
if( cur->request->status != WINIX_ERR_OK )
|
||||
return;
|
||||
|
||||
ParseFunction();
|
||||
|
||||
if( !request->function && get_index != get_tab_len )
|
||||
if( !cur->request->function && get_index != get_tab_len )
|
||||
{
|
||||
request->status = WINIX_ERR_NO_FUNCTION;
|
||||
log << log3 << "FP: Parse: unknown function: \"" << request->get_tab[get_index] << "\"" << logend;
|
||||
cur->request->status = WINIX_ERR_NO_FUNCTION;
|
||||
log << log3 << "FP: Parse: unknown function: \"" << cur->request->get_tab[get_index] << "\"" << logend;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user