summaryrefslogtreecommitdiffstats
path: root/sca-cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-09-21 05:48:57 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-09-21 05:48:57 +0000
commit2f8f97099f90ec1cfb5c0f46c3b94793efc439cc (patch)
treef3f829240f01d8cbb49e2bb87d8046b04a66e11f /sca-cpp
parent7767e482aaf4ddc6b2f33c9f7fb87768c295f581 (diff)
Fix core dump when running Python components in a virtual host.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1173503 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp')
-rw-r--r--sca-cpp/trunk/modules/python/mod-python.cpp4
-rw-r--r--sca-cpp/trunk/modules/server/mod-eval.hpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/sca-cpp/trunk/modules/python/mod-python.cpp b/sca-cpp/trunk/modules/python/mod-python.cpp
index 24e0b3bcb0..f4d2febf10 100644
--- a/sca-cpp/trunk/modules/python/mod-python.cpp
+++ b/sca-cpp/trunk/modules/python/mod-python.cpp
@@ -46,7 +46,7 @@ struct pythonLifecycle {
const value operator()(const list<value>& params) const {
const value func = car(params);
if (func == "pythonRuntime")
- return (gc_ptr<value>)(value*)(void*)&py;
+ return (gc_ptr<value>)(value*)&py;
return lambda<value(const list<value>&)>();
}
};
@@ -67,7 +67,7 @@ const value applyLifecycle(unused const list<value>& params) {
const failable<lambda<value(const list<value>&)> > evalImplementation(const string& path, const value& impl, const list<value>& px, const lambda<value(const list<value>&)>& lifecycle) {
const string itype(elementName(impl));
if (contains(itype, ".python")) {
- const void* p = (gc_ptr<value>)lifecycle(mklist<value>("pythonRuntime"));
+ const value* p = (gc_ptr<value>)lifecycle(mklist<value>("pythonRuntime"));
return modpython::evalImplementation(path, impl, px, *(python::PythonRuntime*)p);
}
if (contains(itype, ".cpp"))
diff --git a/sca-cpp/trunk/modules/server/mod-eval.hpp b/sca-cpp/trunk/modules/server/mod-eval.hpp
index 34cdfdbb29..00f59b9dda 100644
--- a/sca-cpp/trunk/modules/server/mod-eval.hpp
+++ b/sca-cpp/trunk/modules/server/mod-eval.hpp
@@ -724,6 +724,7 @@ const failable<bool> startComponents(ServerConf& sc) {
class VirtualHostConf {
public:
VirtualHostConf(const gc_pool& p, const ServerConf& sc) : sc(sc), vsc(pool(p), sc.server) {
+ vsc.lifecycle = sc.lifecycle;
vsc.virtualHostContributionPath = sc.virtualHostContributionPath;
vsc.virtualHostCompositeName = sc.virtualHostCompositeName;
vsc.ca = sc.ca;
@@ -878,6 +879,7 @@ const int postConfigMerge(const ServerConf& mainsc, server_rec* s) {
if (sc.wiringServerName == "")
sc.wiringServerName = mainsc.wiringServerName != ""? mainsc.wiringServerName : httpd::serverName(s);
debug(sc.wiringServerName, "modeval::postConfigMerge::wiringServerName");
+ sc.lifecycle = mainsc.lifecycle;
sc.contributionPath = mainsc.contributionPath;
sc.compositeName = mainsc.compositeName;
sc.virtualHostContributionPath = mainsc.virtualHostContributionPath;
@@ -922,6 +924,7 @@ int postConfig(apr_pool_t *p, unused apr_pool_t *plog, unused apr_pool_t *ptemp,
const failable<value> r = failableResult(applyLifecycle(mklist<value>("start")));
if (!hasContent(r))
return -1;
+ debug("modeval::postConfig::setlifecycle");
sc.lifecycle = content(r);
}
if (count > 1) {
@@ -929,6 +932,7 @@ int postConfig(apr_pool_t *p, unused apr_pool_t *plog, unused apr_pool_t *ptemp,
const failable<value> r = failableResult(applyLifecycle(mklist<value>("restart")));
if (!hasContent(r))
return -1;
+ debug("modeval::postConfig::setlifecycle");
sc.lifecycle = content(r);
}