added: to Request:
// used as a JSON output (when ajax_serializer is defined) // it will be serialized and have at least: // 'content' string - the whole html content // 'http_status' integer - http status code (e.g. 200) PT::Space ajax; // if not null then the request will have a JSON as an output PT::SpaceToJSON * ajax_serializer; git-svn-id: svn://ttmath.org/publicrep/winix/trunk@871 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -30,6 +30,34 @@ void Request::SetConfig(Config * pconfig)
|
||||
}
|
||||
|
||||
|
||||
void Request::ClearAjax()
|
||||
{
|
||||
size_t i = ajax.spaces.size();
|
||||
|
||||
while( i-- > 0 )
|
||||
ajax.RemoveSpace(i);
|
||||
|
||||
ajax.table.clear();
|
||||
|
||||
PT::Space::TableSingle::iterator s = ajax.table_single.begin();
|
||||
|
||||
while( s != ajax.table_single.end() )
|
||||
{
|
||||
if( s->first != L"content" && s->first != L"http_status" )
|
||||
{
|
||||
ajax.table_single.erase(s++);
|
||||
}
|
||||
else
|
||||
{
|
||||
// small optimization when deleting
|
||||
// the memory for "content" and "http_status" will be reused
|
||||
s->second.clear();
|
||||
|
||||
++s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Request::Clear()
|
||||
@@ -49,6 +77,7 @@ void Request::Clear()
|
||||
|
||||
headers.Clear();
|
||||
page.Clear();
|
||||
ajaxpage.Clear();
|
||||
debug.Clear();
|
||||
|
||||
page_generated = false;
|
||||
@@ -88,6 +117,8 @@ void Request::Clear()
|
||||
start_date.Clear();
|
||||
|
||||
subdomain.clear();
|
||||
ClearAjax();
|
||||
ajax_serializer = 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user