aboutsummaryrefslogtreecommitdiff
path: root/brep/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-11-16 20:02:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-25 20:35:10 +0200
commit2700ed6a3e1092a064f28b07f8e2c4e5b9b830e7 (patch)
treea54ffc979dde42e609bc9877120fa010887c6b66 /brep/module.cxx
parent48a3c47d34c2acc0a39e2db5acfd437dace499c1 (diff)
Implement new URL path schema for the web interface
Diffstat (limited to 'brep/module.cxx')
-rw-r--r--brep/module.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/brep/module.cxx b/brep/module.cxx
index 850f593..68177b1 100644
--- a/brep/module.cxx
+++ b/brep/module.cxx
@@ -7,17 +7,17 @@
#include <httpd.h>
#include <http_log.h>
-#include <vector>
-#include <string>
#include <ostream>
#include <sstream>
-#include <cstring> // strncmp()
+#include <cstring> // strchr()
#include <stdexcept>
#include <functional> // bind()
#include <web/module>
#include <web/apache/log>
+#include <brep/types>
+#include <brep/utility>
#include <brep/options>
using namespace std;
@@ -32,6 +32,8 @@ namespace brep
void module::
handle (request& rq, response& rs, log& l)
{
+ assert (loaded_);
+
log_ = &l;
try
@@ -84,6 +86,8 @@ namespace brep
void module::
init (const name_values& options, log& log)
{
+ assert (!loaded_);
+
log_ = &log;
vector<const char*> argv;
@@ -119,6 +123,7 @@ namespace brep
options::module o (s, unknown_mode::skip, unknown_mode::skip);
verb_ = o.verb ();
+ loaded_ = true;
}
catch (const server_error& e)
{
@@ -139,7 +144,7 @@ namespace brep
// Custom copy constructor is required to initialize log_writer_ properly.
//
module::
- module (const module& m): module () {verb_ = m.verb_;}
+ module (const module& m): module () {verb_ = m.verb_; loaded_ = m.loaded_;}
// For function func declared like this:
// using B = std::string (*)(int);