From e28ab8f48c891c03cf4b3a8ed88b98d38a561960 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Dec 2015 13:45:08 +0200 Subject: Separate brep module configuration from Apache server configuration --- brep/repository-details.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'brep/repository-details.cxx') diff --git a/brep/repository-details.cxx b/brep/repository-details.cxx index eb2885c..ee34dc2 100644 --- a/brep/repository-details.cxx +++ b/brep/repository-details.cxx @@ -13,9 +13,10 @@ #include #include -#include #include #include + +#include #include #include #include @@ -32,10 +33,13 @@ init (scanner& s) options_ = make_shared ( s, unknown_mode::fail, unknown_mode::fail); + if (options_->root ().empty ()) + options_->root (dir_path ("/")); + db_ = shared_database (options_->db_host (), options_->db_port ()); } -void brep::repository_details:: +bool brep::repository_details:: handle (request& rq, response& rs) { using namespace web::xhtml; @@ -45,16 +49,13 @@ handle (request& rq, response& rs) // The module options object is not changed after being created once per // server process. // - static const dir_path& root ( - options_->root ().empty () - ? dir_path ("/") - : options_->root ()); + static const dir_path& root (options_->root ()); // Make sure no parameters passed. // try { - param_scanner s (rq.parameters ()); + name_value_scanner s (rq.parameters ()); params::repository_details (s, unknown_mode::fail, unknown_mode::fail); } catch (const unknown_argument& e) @@ -106,4 +107,6 @@ handle (request& rq, response& rs) s << ~DIV << ~BODY << ~HTML; + + return true; } -- cgit v1.1