summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2013-03-16 13:22:41 +0000
committerrandomdan <randomdan@localhost>2013-03-16 13:22:41 +0000
commitcdb598439fc2ec56897aaf2d20d2398ca2cdaba3 (patch)
tree525ca4eb7d3150f444726740c331d3d1a84caaef
parentAdd a rowset that lists the routes configured in a programable router (diff)
downloadproject2-cdb598439fc2ec56897aaf2d20d2398ca2cdaba3.tar.bz2
project2-cdb598439fc2ec56897aaf2d20d2398ca2cdaba3.tar.xz
project2-cdb598439fc2ec56897aaf2d20d2398ca2cdaba3.zip
Fix the case where the routing table wasn't cleared before reload
-rw-r--r--project2/cgi/cgiProgRouter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/project2/cgi/cgiProgRouter.cpp b/project2/cgi/cgiProgRouter.cpp
index ff7c864..6e7f73f 100644
--- a/project2/cgi/cgiProgRouter.cpp
+++ b/project2/cgi/cgiProgRouter.cpp
@@ -9,9 +9,9 @@ typedef std::map<std::string, std::string> VarMap;
class RoutingTable {
public:
RoutingTable & operator=(const std::string & routeFile) {
- routes.clear();
routeScriptPath = routeFile;
if (routeFile.empty()) {
+ routes.clear();
routeScript.reset();
}
else {
@@ -30,6 +30,7 @@ class RoutingTable {
{
routeScript = Environment::getCurrent()->resolveScript(Environment::getCurrent()->datasourceRoot, routeScriptPath, true);
routeScript->loader.addLoadTarget(routeScript->root(), Storer::into<ElementLoader>(&routes));
+ routes.clear();
routeScript->load(NULL, true);
}
ScriptReaderPtr routeScript;