aboutsummaryrefslogtreecommitdiff
path: root/brep/repository-details.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-08 13:45:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-14 12:02:13 +0200
commite28ab8f48c891c03cf4b3a8ed88b98d38a561960 (patch)
tree0ae1dbb54e497fc797e5a73fcf3dd2dc487a5572 /brep/repository-details.cxx
parenta31dfac365feef7838b01b1efd3fe058c89484d7 (diff)
Separate brep module configuration from Apache server configuration
Diffstat (limited to 'brep/repository-details.cxx')
-rw-r--r--brep/repository-details.cxx17
1 files changed, 10 insertions, 7 deletions
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 <web/module>
#include <web/mime-url-encoding>
-#include <brep/page>
#include <brep/types>
#include <brep/utility>
+
+#include <brep/page>
#include <brep/options>
#include <brep/package>
#include <brep/package-odb>
@@ -32,10 +33,13 @@ init (scanner& s)
options_ = make_shared<options::repository_details> (
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;
}