aboutsummaryrefslogtreecommitdiff
path: root/brep/mod-package-version-details.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-03-06 13:52:48 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-03-07 00:05:29 +0300
commitb72424fca7a6af6ff7921101c450850fef875152 (patch)
treeac295d1e228379b1b31c6af3a84e7057f2ea96ae /brep/mod-package-version-details.cxx
parent0f9c65e489a7b59f76ccbf2ca6e76ab0a1012932 (diff)
Support multiple instances of brep in a single Apache instance
Diffstat (limited to 'brep/mod-package-version-details.cxx')
-rw-r--r--brep/mod-package-version-details.cxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/brep/mod-package-version-details.cxx b/brep/mod-package-version-details.cxx
index c9055a5..cbf9c86 100644
--- a/brep/mod-package-version-details.cxx
+++ b/brep/mod-package-version-details.cxx
@@ -25,6 +25,18 @@ using namespace std;
using namespace odb::core;
using namespace brep::cli;
+// While currently the user-defined copy constructor is not required (we don't
+// need to deep copy nullptr's), it is a good idea to keep the placeholder
+// ready for less trivial cases.
+//
+brep::package_version_details::
+package_version_details (const package_version_details& r)
+ : module (r),
+ options_ (r.initialized_ ? r.options_ : nullptr),
+ db_ (r.initialized_ ? r.db_ : nullptr)
+{
+}
+
void brep::package_version_details::
init (scanner& s)
{
@@ -48,12 +60,7 @@ handle (request& rq, response& rs)
MODULE_DIAG;
- // The module options object is not changed after being created once per
- // server process.
- //
- static const dir_path& root (options_->root ());
- static const fragment& logo (options_->logo ());
- static const vector<page_menu>& menu (options_->menu ());
+ const dir_path& root (options_->root ());
auto i (rq.path ().rbegin ());
version ver;
@@ -107,7 +114,7 @@ handle (request& rq, response& rs)
<< CSS_LINKS (path ("package-version-details.css"), root)
<< ~HEAD
<< BODY
- << DIV_HEADER (root, logo, menu)
+ << DIV_HEADER (root, options_->logo (), options_->menu ())
<< DIV(ID="content");
if (full)