Eliminated some extra string wrapping.
authorScott Cantor <cantor.2@osu.edu>
Thu, 31 Mar 2005 05:26:15 +0000 (05:26 +0000)
committerScott Cantor <cantor.2@osu.edu>
Thu, 31 Mar 2005 05:26:15 +0000 (05:26 +0000)
apache/mod_apache.cpp
shib-target/shib-target.cpp
shib-target/shib-target.h

index db38496..10ffd03 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;
   }
index f4aa7f7..a336a1e 100644 (file)
@@ -165,13 +165,13 @@ ShibTarget::~ShibTarget(void)
 
 void ShibTarget::init(
     ShibTargetConfig *config,
-    string protocol,
-    string hostname,
+    const char* protocol,
+    const char* hostname,
     int port,
-    string uri,
-    string content_type,
-    string remote_host,
-    string method
+    const char* uri,
+    const char* content_type,
+    const char* remote_host,
+    const char* method
     )
 {
 #ifdef _DEBUG
@@ -183,11 +183,11 @@ void ShibTarget::init(
   if (!config)
     throw runtime_error("config is NULL.  Oops.");
 
-  m_priv->m_protocol = protocol;
-  m_priv->m_content_type = content_type;
-  m_priv->m_remote_addr = remote_host;
+  if (protocol) m_priv->m_protocol = protocol;
+  if (content_type) m_priv->m_content_type = content_type;
+  if (remote_host) m_priv->m_remote_addr = remote_host;
+  if (method) m_priv->m_method = method;
   m_priv->m_Config = config;
-  m_priv->m_method = method;
   m_priv->get_application(protocol, hostname, port, uri);
 }
 
index 90a1b15..c800809 100644 (file)
@@ -499,10 +499,16 @@ namespace shibtarget {
     // port == server port
     // uri == resource path
     // method == GET, POST, etc.
-    void init(ShibTargetConfig *config,
-             std::string protocol, std::string hostname, int port,
-             std::string uri, std::string content_type, std::string remote_host,
-             std::string method);
+    void init(
+        ShibTargetConfig *config,
+           const char* protocol,
+        const char* hostname,
+        int port,
+           const char* uri,
+        const char* content_type,
+        const char* remote_host,
+           const char* method
+       );
 
   private:
     mutable ShibTargetPriv *m_priv;