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;
}
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
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);
}
// 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;