Convert more strings to references.
[shibboleth/sp.git] / apache / mod_apache.cpp
index ecedbe0..d98a066 100644 (file)
@@ -242,12 +242,16 @@ public:
 
     m_dc = (shib_dir_config*)ap_get_module_config(req->per_dir_config, &mod_shib);
 
-    const char* ct = ap_table_get(req->headers_in, "Content-type");
-
-    init(g_Config, string(m_sc->szScheme ? m_sc->szScheme : ap_http_method(req)),
-        string(ap_get_server_name(req)), (int)ap_get_server_port(req),
-        string(req->unparsed_uri), string(ct ? ct : ""),
-        string(req->connection->remote_ip), string(req->method));
+    init(
+        g_Config,
+        m_sc->szScheme ? m_sc->szScheme : ap_http_method(req),
+           ap_get_server_name(req),
+        (int)ap_get_server_port(req),
+           req->unparsed_uri,
+        ap_table_get(req->headers_in, "Content-type"),
+           req->connection->remote_ip,
+        req->method
+        );
 
     m_req = req;
   }
@@ -346,7 +350,7 @@ public:
                  "REQUIRE all: %d", m_dc->bRequireAll);
 
     HTAccessInfo* ht = new HTAccessInfo();
-    ht->requireAll = (m_dc->bRequireAll >= 0);
+    ht->requireAll = (m_dc->bRequireAll == 1);
     ht->elements.reserve(reqs_arr->nelts);
     for (int x = 0; x < reqs_arr->nelts; x++) {
       HTAccessInfo::RequireLine* rline = new HTAccessInfo::RequireLine();
@@ -378,8 +382,8 @@ public:
   }
 
   virtual void* sendPage(
-    const string &msg,
-    const string content_type,
+    const stringmsg,
+    const string& content_type,
        const saml::Iterator<header_t>& headers=EMPTY(header_t),
     int code=200
     ) {
@@ -392,7 +396,7 @@ public:
     ap_rprintf(m_req, msg.c_str());
     return (void*)DONE;
   }
-  virtual void* sendRedirect(const string url) {
+  virtual void* sendRedirect(const string& url) {
     ap_table_set(m_req->headers_out, "Location", url.c_str());
     return (void*)REDIRECT;
   }