diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-14 18:46:26 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-14 18:46:26 +0000 |
commit | d6451b81703c809abcd0f51e74abdba7c732b513 (patch) | |
tree | fab2013702ae33a07e5bb43abad606e0201b485b /sca-cpp/trunk/modules/server/mod-wiring.cpp | |
parent | d090bd129574458379aa9997345e7ca5b2c24886 (diff) |
Some refactoring of the HTTP support, tunnel Memcached requests over HTTPS and add HTTPS config to store-cluster sample.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@985561 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/server/mod-wiring.cpp')
-rw-r--r-- | sca-cpp/trunk/modules/server/mod-wiring.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sca-cpp/trunk/modules/server/mod-wiring.cpp b/sca-cpp/trunk/modules/server/mod-wiring.cpp index 964f7efc82..7ed47c7f48 100644 --- a/sca-cpp/trunk/modules/server/mod-wiring.cpp +++ b/sca-cpp/trunk/modules/server/mod-wiring.cpp @@ -299,13 +299,15 @@ const failable<bool> virtualHostConfig(ServerConf& sc, request_rec* r) { * to the target component. */ int translate(request_rec *r) { - gc_scoped_pool pool(r->pool); + if(r->method_number != M_GET && r->method_number != M_POST && r->method_number != M_PUT && r->method_number != M_DELETE) + return DECLINED; - // No translation needed for a component request + // No translation needed for a component or tunnel request if (!strncmp(r->uri, "/components/", 12)) return DECLINED; // Get the server configuration + gc_scoped_pool pool(r->pool); const ServerConf& sc = httpd::serverConf<ServerConf>(r, &mod_tuscany_wiring); // Process dynamic virtual host configuration, if any @@ -329,14 +331,17 @@ int translate(request_rec *r) { * HTTP request handler, redirect to a target component. */ int handler(request_rec *r) { - gc_scoped_pool pool(r->pool); + if(r->method_number != M_GET && r->method_number != M_POST && r->method_number != M_PUT && r->method_number != M_DELETE) + return DECLINED; if(strcmp(r->handler, "mod_tuscany_wiring")) return DECLINED; + if (r->filename == NULL || strncmp(r->filename, "/redirect:", 10) != 0) + return DECLINED; + + gc_scoped_pool pool(r->pool); httpdDebugRequest(r, "modwiring::handler::input"); // Do an internal redirect - if (r->filename == NULL || strncmp(r->filename, "/redirect:", 10) != 0) - return DECLINED; debug(r->uri, "modwiring::handler::uri"); debug(r->filename, "modwiring::handler::filename"); debug(r->path_info, "modwiring::handler::path info"); @@ -364,7 +369,7 @@ const int postConfigMerge(const ServerConf& mainsc, server_rec* s) { return postConfigMerge(mainsc, s->next); } -int postConfig(unused apr_pool_t *p, unused apr_pool_t *plog, unused apr_pool_t *ptemp, server_rec *s) { +int postConfig(apr_pool_t *p, unused apr_pool_t *plog, unused apr_pool_t *ptemp, server_rec *s) { gc_scoped_pool pool(p); // Count the calls to post config, skip the first one as |