From 2700ed6a3e1092a064f28b07f8e2c4e5b9b830e7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Nov 2015 20:02:06 +0200 Subject: Implement new URL path schema for the web interface --- brep/module.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'brep/module.cxx') 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 #include -#include -#include #include #include -#include // strncmp() +#include // strchr() #include #include // bind() #include #include +#include +#include #include 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 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); -- cgit v1.1