You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cli-dev@httpd.apache.org by wr...@apache.org on 2004/11/23 19:06:42 UTC
svn commit: r106325 - /httpd/mod_aspdotnet/trunk/mod/mod_aspdotnet.cpp
Author: wrowe
Date: Tue Nov 23 10:06:42 2004
New Revision: 106325
Modified:
httpd/mod_aspdotnet/trunk/mod/mod_aspdotnet.cpp
Log:
conf is horribly ambigous. Use global_conf to name our process->pool
allocated, process lifetime scope configuration structure.
Modified: httpd/mod_aspdotnet/trunk/mod/mod_aspdotnet.cpp
Url: http://svn.apache.org/viewcvs/httpd/mod_aspdotnet/trunk/mod/mod_aspdotnet.cpp?view=diff&rev=106325&p1=httpd/mod_aspdotnet/trunk/mod/mod_aspdotnet.cpp&r1=106324&p2=httpd/mod_aspdotnet/trunk/mod/mod_aspdotnet.cpp&r2=106325
==============================================================================
--- httpd/mod_aspdotnet/trunk/mod/mod_aspdotnet.cpp (original)
+++ httpd/mod_aspdotnet/trunk/mod/mod_aspdotnet.cpp Tue Nov 23 10:06:42 2004
@@ -80,7 +80,7 @@
ICorRuntimeHost *pCorRuntime;
IApacheWebHostFactory *pHostFactory;
HANDLE lock_module;
-} *conf;
+} *global_conf;
// Initialized for each restart
typedef struct asp_net_alias_t {
@@ -152,21 +152,21 @@
// Recover the host matching this virtual+physical path combo,
// or create a new persistant host record (on the first pass.)
- mount->host = (asp_net_host_conf_t*)apr_hash_get(conf->hosts,
+ mount->host = (asp_net_host_conf_t*)apr_hash_get(global_conf->hosts,
mount->virtual_path,
combined_len);
if (!mount->host) {
- mount->host = (asp_net_host_conf_t*)apr_palloc(conf->pool,
+ mount->host = (asp_net_host_conf_t*)apr_palloc(global_conf->pool,
sizeof(*mount->host));
mount->host->combined_len = combined_len;
- mount->host->virtual_path = (const char*)apr_palloc(conf->pool,
+ mount->host->virtual_path = (const char*)apr_palloc(global_conf->pool,
combined_len);
mount->host->physical_path = mount->host->virtual_path
+ mount->virtual_path_len + 1;
memcpy((char*)mount->host->virtual_path,
mount->virtual_path, combined_len);
mount->host->host_key = -1;
- apr_hash_set(conf->hosts, mount->host->virtual_path,
+ apr_hash_set(global_conf->hosts, mount->host->virtual_path,
mount->host->combined_len, mount->host);
}
@@ -184,14 +184,14 @@
static apr_status_t asp_net_stop(void *dummy)
{
- conf->pHostFactory->Destroy();
+ global_conf->pHostFactory->Destroy();
- if (conf->pHostFactory) {
- conf->pHostFactory->Release();
+ if (global_conf->pHostFactory) {
+ global_conf->pHostFactory->Release();
}
- if (conf->pCorRuntime) {
- conf->pCorRuntime->Stop();
- conf->pCorRuntime->Release();
+ if (global_conf->pCorRuntime) {
+ global_conf->pCorRuntime->Stop();
+ global_conf->pCorRuntime->Release();
}
return APR_SUCCESS;
}
@@ -217,12 +217,12 @@
"mod_aspdotnet.so. (Was it renamed?)");
_com_raise_error(hr);
}
- conf->lock_module = LoadLibraryW(wAspNetPath);
+ global_conf->lock_module = LoadLibraryW(wAspNetPath);
// Now we are prepared to register our cleanup in the global
// process pool, because we trust the module cannot be unloaded
// by apr_dso_unload [the module instance is refcounted]
- apr_pool_cleanup_register(conf->pool, NULL, asp_net_stop,
+ apr_pool_cleanup_register(global_conf->pool, NULL, asp_net_stop,
apr_pool_cleanup_null);
// Now get the path to the apache.exe binary, as Apache.Web
@@ -267,7 +267,7 @@
STARTUP_CONCURRENT_GC,
CLSID_CorRuntimeHost,
IID_ICorRuntimeHost,
- (void **)&conf->pCorRuntime);
+ (void **)&global_conf->pCorRuntime);
if (FAILED(hr)) {
ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(hr), NULL,
"mod_aspdotnet: Could not CorBindToRuntimeEx "
@@ -275,7 +275,7 @@
_com_raise_error(hr);
}
- hr = conf->pCorRuntime->Start();
+ hr = global_conf->pCorRuntime->Start();
if (FAILED(hr)) {
ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(hr), NULL,
"mod_aspdotnet: Could not start the "
@@ -287,7 +287,7 @@
"mod_aspdotnet: Module started .NET CLR...");
IUnknown *pAppDomainIUnk = NULL;
- hr = conf->pCorRuntime->GetDefaultDomain(&pAppDomainIUnk);
+ hr = global_conf->pCorRuntime->GetDefaultDomain(&pAppDomainIUnk);
if (FAILED(hr)) {
ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(hr), NULL,
"mod_aspdotnet: Could not retrieve the .NET default "
@@ -363,7 +363,7 @@
}
hr = vHostFactory.pdispVal->QueryInterface(__uuidof(IApacheWebHostFactory),
- (void**)&conf->pHostFactory);
+ (void**)&global_conf->pHostFactory);
// Done with vHostFactory
VariantClear(&vHostFactory);
@@ -378,7 +378,7 @@
"mod_aspdotnet: Module initialized HostFactory...");
// Test invocation, assure we have a good hostfactory
- hr = conf->pHostFactory->Configure(L"");
+ hr = global_conf->pHostFactory->Configure(L"");
if (FAILED(hr)) {
ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(hr), NULL,
"mod_aspdotnet: Could not correctly configure the "
@@ -477,8 +477,8 @@
int status;
try {
- status = conf->pHostFactory->HandleHostRequest(host->host_key,
- (UINT_PTR)r);
+ status = global_conf->pHostFactory->HandleHostRequest(host->host_key,
+ (UINT_PTR)r);
}
catch (_com_error err) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(err.Error()), r,
@@ -518,8 +518,8 @@
// Recover or create the global, persistant configuration
// Setup and teardown can take a considerable amount of time,
// we do not want to repeat this twice per Apache process.
- if ((apr_pool_userdata_get((void**)&conf, "mod_aspdotnet::global_conf",
- process) != APR_SUCCESS) || !conf) {
+ if ((apr_pool_userdata_get((void**)&global_conf, "mod_aspdotnet::global_conf",
+ process) != APR_SUCCESS) || !global_conf) {
HRESULT hr = CoInitialize(NULL);
if (hr == RPC_E_CHANGED_MODE)
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
@@ -529,12 +529,12 @@
"COM engine for .NET CLR interop!");
return 1;
}
- conf = (asp_net_conf_t*)apr_palloc(process, sizeof(*conf));
- conf->pool = process;
- conf->hosts = apr_hash_make(process);
- conf->pCorRuntime = NULL;
- conf->pHostFactory = NULL;
- apr_pool_userdata_setn(conf, "mod_aspdotnet::global_conf",
+ global_conf = (asp_net_conf_t*)apr_palloc(process, sizeof(*global_conf));
+ global_conf->pool = process;
+ global_conf->hosts = apr_hash_make(process);
+ global_conf->pCorRuntime = NULL;
+ global_conf->pHostFactory = NULL;
+ apr_pool_userdata_setn(global_conf, "mod_aspdotnet::global_conf",
apr_pool_cleanup_null, process);
}
return APR_SUCCESS;
@@ -552,7 +552,7 @@
APW_STRINGIFY(APACHE_WEB_VER_MINOR));
// First time through, initialize .Net and the HostFactory
- if (!conf->pCorRuntime || !conf->pHostFactory) {
+ if (!global_conf->pCorRuntime || !global_conf->pHostFactory) {
try {
init_asp_engine();
}
@@ -583,7 +583,7 @@
}
}
- for (item = apr_hash_first(ptemp, conf->hosts); item;
+ for (item = apr_hash_first(ptemp, global_conf->hosts); item;
item = apr_hash_next(item))
{
asp_net_host_conf_t *host;
@@ -595,7 +595,7 @@
try {
// XXX: i18n these paths by treating them as UTF-8 -> Unicode!!!
- host->host_key = conf->pHostFactory->CreateHost(
+ host->host_key = global_conf->pHostFactory->CreateHost(
_bstr_t(host->virtual_path),
_bstr_t(host->physical_path),
(int) gs);