added: Export plugin (not finished yet)

added:   ThreadManager
         all threads are connected to the ThreadManager
         they are started/stopped by the manager
changed: FunctionParser
         now we are parsing directly what is in URI
         (we were using GetParser beforehand)
         we are able to recognize ordinary URI scheme (with '?' and '#' characters)
         sample:
         http://domain.com/dir1/dir2/item/function?par1=val2&par2=val2#htmlanchor
         is the same as:
         http://domain.com/dir1/dir2/item/function/par1:val2/par2:val2#htmlanchor
         'htmlanchor' is put in Request::anchor field,
         and the default function can be used like this:
         http://domain.com/dir1/dir2/item?par1=val2&par2=val2#htmlanchor
         but there is not an equivalent in winix form
         e.g. http://domain.com/dir1/dir2/item/par1:val2/par2:val2#htmlanchor
         because 'par1:val2' would be treated as a function name
removed: GetParser
         now we don't have Request::get_tab structure
removed: CKEditorGetParser
         it is not needed now



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@752 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-07-28 22:18:10 +00:00
parent c37c1ff812
commit 4d87359aca
51 changed files with 1646 additions and 1203 deletions

View File

@@ -152,7 +152,6 @@ bool App::Init()
CreateStaticTree();
get_parser.UTF8(config.utf8);
post_parser.UTF8(config.utf8);
post_parser.LogValueSize(config.log_post_value_size);
// post_multi_parser has a pointer to the config
@@ -184,6 +183,8 @@ bool App::BaseUrlRedirect()
cur.request->redirect_to = config.base_url;
AssignString(cur.request->env_request_uri, cur.request->redirect_to, false);
// cur.request->env_request_uri should not be UrlEncoded
cur.request->redirect_url_encoded = true;
log << log3 << "RC: BaseUrlRedirect from: " << cur.request->env_http_host << logend;
@@ -372,7 +373,6 @@ void App::Make()
{
// !! dodac inne informacje (get, post, itp)
// jesli jest debug_info wlaczone to nie robic przekierowan
cur.request->PrintGetTab();
//cur.request->PrintEnv(); // !! PrintEnv() mozna przeniesc tutaj (do klasy App)
}
}
@@ -476,7 +476,7 @@ void App::LogAccess()
void App::ReadGetPostVars()
{
// get parameters we have always
get_parser.Parse(cur.request->env_request_uri, cur.request->get_tab);
//get_parser.Parse(cur.request->env_request_uri, cur.request->get_tab);
if( cur.request->method == Request::post )
{
@@ -621,7 +621,11 @@ void App::SendHeadersRedirect()
break;
}
UrlEncode(cur.request->redirect_to, cur.request->aredirect_to);
if( !cur.request->redirect_url_encoded )
UrlEncode(cur.request->redirect_to, cur.request->aredirect_to);
else
Ezc::WideToUTF8(cur.request->redirect_to, cur.request->aredirect_to);
FCGX_FPrintF(fcgi_request.out, "Location: %s\r\n", cur.request->aredirect_to.c_str());
log << log2 << "Redirect to: " << cur.request->aredirect_to << logend;
}
@@ -1127,9 +1131,7 @@ void App::WaitForThreads()
// but it doesn't matter, don't use pthread_join on it
//pthread_join(signal_thread, 0);
system.notify.WaitForThread();
session_manager.WaitForThread();
system.thumb.WaitForThread();
system.thread_manager.StopAll();
}
@@ -1163,9 +1165,6 @@ sigset_t set;
app->synchro.was_stop_signal = true;
FCGX_ShutdownPending();
Ezc::WideToUTF8(app->config.base_url, app->url_to_fetch_on_exit);
app->system.notify.PrepareToStopThread();
app->session_manager.WakeUpThread();
app->system.thumb.WakeUpThread();
app->Unlock();
// this thread will hang on this method
@@ -1180,27 +1179,14 @@ sigset_t set;
void App::StartThreads()
{
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGTERM);
sigaddset(&set, SIGINT);
// blocking SIGTERM and SIGINT
// new threads will have the signals blocked too
pthread_sigmask(SIG_BLOCK, &set, 0);
// make sure system.thread_manager.Init() was called beforehand
// it is called in Init() -> system.Init()
// special thread only for signals
pthread_create(&signal_thread, 0, SpecialThreadForSignals, this);
// thread for notifications
system.notify.StartThread();
// gc for sessions
session_manager.StartThread();
// thumbnails
system.thumb.StartThread();
system.thread_manager.Add(&session_manager);
system.thread_manager.StartAll();
}