diff options
| author | randomdan <randomdan@localhost> | 2013-07-05 00:01:26 +0000 |
|---|---|---|
| committer | randomdan <randomdan@localhost> | 2013-07-05 00:01:26 +0000 |
| commit | 5507f618e094554f04f61a950d9c6d2b55865d3e (patch) | |
| tree | 6f3a750f79ad26047ff5322522219798d19aa64c /project2/cgi/p2webFCgi.cpp | |
| parent | Move remaining options out of environment (diff) | |
| download | project2-5507f618e094554f04f61a950d9c6d2b55865d3e.tar.bz2 project2-5507f618e094554f04f61a950d9c6d2b55865d3e.tar.xz project2-5507f618e094554f04f61a950d9c6d2b55865d3e.zip | |
Massive refactor to remove the appEngine and environment complication and instead have an execution context that's passed around from the original call site
Diffstat (limited to 'project2/cgi/p2webFCgi.cpp')
| -rw-r--r-- | project2/cgi/p2webFCgi.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/project2/cgi/p2webFCgi.cpp b/project2/cgi/p2webFCgi.cpp index 7eb631f..4320c48 100644 --- a/project2/cgi/p2webFCgi.cpp +++ b/project2/cgi/p2webFCgi.cpp @@ -1,6 +1,6 @@ -#include "cgiCommon.h" #include "FCgiIO.h" -#include "scriptLoader.h" +#include "cgiAppEngine.h" +#include "optionsSource.h" #include <boost/bind.hpp> time_t lastPeriodic = 0; @@ -40,12 +40,15 @@ main(void) fprintf(stderr, "Failed to set signal handler\n"); } alarm(60); - CgiEnvironment env; Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1)); + CgiApplicationEngine app; while (FCGX_Accept_r(&request) == 0) { alarm(0); cgicc::FCgiIO IO(request); - cgiServe(&IO, &env, IO, &IO); + CgiRequestContext crc(&IO, IO); + OptionsSource::loadSources(boost::bind(&HostnamePlatformIdentifier::derivedPlatform, boost::cref(CgiApplicationEngine::hpi), &crc)); + Plugable::onAllComponents(boost::bind(&ComponentLoader::onBefore, _1)); + app.process(IO, &crc); FCGX_Finish_r(&request); Plugable::onAllComponents(boost::bind(&ComponentLoader::onIteration, _1)); if (time(NULL) > lastPeriodic + periodicDelay) { |
