aboutsummaryrefslogtreecommitdiff
path: root/web/apache/service.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-03-14 14:38:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-03-17 12:59:35 +0300
commit0b6b57f9acaa2ec648bf582ff67851331f8e6eef (patch)
tree7ce5da6a1c37f3674762d5514b0a34bf05e38df7 /web/apache/service.cxx
parent637d5650b91cb1da2605e5f7049ccc8bab5591f3 (diff)
Use serializable transaction isolation level
Diffstat (limited to 'web/apache/service.cxx')
-rw-r--r--web/apache/service.cxx42
1 files changed, 25 insertions, 17 deletions
diff --git a/web/apache/service.cxx b/web/apache/service.cxx
index 2ca8cf0..da44530 100644
--- a/web/apache/service.cxx
+++ b/web/apache/service.cxx
@@ -4,10 +4,10 @@
#include <web/apache/service>
-#include <apr_pools.h>
+#include <apr_pools.h> // apr_palloc()
-#include <httpd.h>
-#include <http_config.h>
+#include <httpd.h> // server_rec
+#include <http_config.h> // command_rec, cmd_*, ap_get_module_config()
#include <memory> // unique_ptr
#include <string>
@@ -16,7 +16,10 @@
#include <cstring> // strlen()
#include <exception>
+#include <butl/optional>
+
#include <web/module>
+#include <web/apache/log>
using namespace std;
@@ -29,12 +32,12 @@ namespace web
{
assert (cmds == nullptr);
- // Fill apache module directive definitions. Directives share
- // common name space in apache configuration file, so to prevent name
- // clash have to form directive name as a combination of module and
- // option names: <module name>-<option name>. This why for option
- // bar of module foo the corresponding directive will appear in apache
- // configuration file as foo-bar.
+ // Fill apache module directive definitions. Directives share common
+ // name space in apache configuration file, so to prevent name clash
+ // have to form directive name as a combination of module and option
+ // names: <module name>-<option name>. This why for option bar of module
+ // foo the corresponding directive will appear in apache configuration
+ // file as foo-bar.
//
const option_descriptions& od (exemplar_.options ());
unique_ptr<command_rec[]> directives (new command_rec[od.size () + 1]);
@@ -42,7 +45,8 @@ namespace web
for (const auto& o: od)
{
- auto i (option_descriptions_.emplace (name_ + "-" + o.first, o.second));
+ auto i (
+ option_descriptions_.emplace (name_ + "-" + o.first, o.second));
assert (i.second);
*d++ =
@@ -73,8 +77,8 @@ namespace web
create_server_context (apr_pool_t* pool, server_rec*) noexcept
{
// Create the object using the configuration memory pool provided by the
- // Apache API. The lifetime of the object is equal to the lifetime of the
- // pool.
+ // Apache API. The lifetime of the object is equal to the lifetime of
+ // the pool.
//
void* p (apr_palloc (pool, sizeof (context)));
assert (p != nullptr);
@@ -104,10 +108,10 @@ namespace web
service& srv (*reinterpret_cast<service*> (parms->cmd->cmd_data));
if (srv.options_parsed_)
- // Apache have started the second pass of its messy initialization cycle
- // (more details at http://wiki.apache.org/httpd/ModuleLife). This time
- // we are parsing for real. Cleanup the existing config, and start
- // building the new one.
+ // Apache have started the second pass of its messy initialization
+ // cycle (more details at http://wiki.apache.org/httpd/ModuleLife).
+ // This time we are parsing for real. Cleanup the existing config, and
+ // start building the new one.
//
srv.clear_config ();
@@ -214,8 +218,12 @@ namespace web
// context options as a result of the merge_server_context() calls.
//
for (const auto& o: options_)
- if (o.first->server != nullptr) // Is a directory configuration context.
+ {
+ // Is a directory configuration context.
+ //
+ if (o.first->server != nullptr)
complement (o.first, o.first->server);
+ }
options_parsed_ = true;
}