removed: ezn patterns for rawcontent and ajaxcontent:

index_rawcontent.html, index_ajaxcontent.html
         now we have out_streams in Request and some special
         keyword in ezc templates for sending content to the 
         specified streams
changed: the way how winix answers to the client's browsers:
         info from Request class:
	                                   winix answer send to the client's browser
	                                                       |
	                                                       |
	                                          depending on send_bin_stream
	                               -------------------------------------------------
	                               |                                               |
	                          text answer                                     binary answer
	                               |                                               |
	                   depending on return_json                          sending out_bin_stream
	             ------------------------------------
	             |                                  |
	       normal request                     ajax request
	             |                                  |
	   sending out_streams[0]           depending on return_info_only
	                              ------------------------------------------------------
	                              |                                                    |
	                 generating JSON object from:                   generating JSON object only from info
	                 out_streams and info, e.g.:                    e.g.:
	                 {                                              { info object serialized here }
	                  "stream_1": "some html content",
	                  "stream_2": "some other html content",
	                  "info": { info object serialized here }
	                 }
	                 note that out_streams[0] is not sent
	                 in JSON answers
	
	




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@937 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2013-11-14 20:59:23 +00:00
parent d801f53154
commit 3af3ac3f6f
15 changed files with 303 additions and 115 deletions

View File

@@ -30,36 +30,17 @@ void Request::SetConfig(Config * pconfig)
}
void Request::ClearAjax()
void Request::ClearOutputStreams()
{
size_t i = ajax.spaces.size();
out_streams.resize(16); // !! IMPROVE ME add as a constant somewhere
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;
}
}
for(size_t i=0 ; i<out_streams.size() ; ++i)
out_streams[i].Clear();
}
void Request::Clear()
{
// id is never 0
@@ -67,6 +48,7 @@ void Request::Clear()
++id;
RemovePostFileTmp(post_file_tab);
ClearOutputStreams();
post_tab.clear();
post_file_tab.clear();
@@ -76,8 +58,8 @@ void Request::Clear()
role = responder;
headers.Clear();
page.Clear();
ajaxpage.Clear();
debug.Clear();
page_generated = false;
@@ -117,12 +99,13 @@ void Request::Clear()
start_date.Clear();
subdomain.clear();
ClearAjax();
ajax_serializer = 0;
return_info_only = false;
info.Clear();
info_serializer = 0;
return_json = false;
binary_page.clear();
compressed_page.clear();
use_text_page = true;
out_bin_stream.clear();
send_bin_stream = false;
gen_trim_white = false;
gen_skip_new_line = false;