- 1.2.6
[packages/apache1-mod_jk.git] / jakarta-tomcat-connectors-jk-jkpass.patch
CommitLineData
d32bd8ae
MK
1diff -Nru jakarta-tomcat-connectors-jk-1.2.5-src.orig/jk/native/apache-1.3/mod_jk.c jakarta-tomcat-connectors-jk-1.2.5-src/jk/native/apache-1.3/mod_jk.c
2--- jakarta-tomcat-connectors-jk-1.2.5-src.orig/jk/native/apache-1.3/mod_jk.c 2004-05-14 15:02:21.110892712 +0000
3+++ jakarta-tomcat-connectors-jk-1.2.5-src/jk/native/apache-1.3/mod_jk.c 2004-05-14 19:43:05.275190512 +0000
670ec019 4@@ -134,8 +134,14 @@
d32bd8ae
MK
5 table *envvars;
6
7 server_rec *s;
8+
9+ array_header *pass_prefixes;
10+
11 } jk_server_conf_t;
12
13+typedef struct {
14+ char* prefix;
15+} pass_prefix;
16
17 /*
18 * The "private", or subclass portion of the web server service class for
670ec019 19@@ -1355,6 +1361,18 @@
d32bd8ae
MK
20 return NULL;
21 }
22
23+static const char * jk_set_pass_prefix(cmd_parms * cmd, void * dummy, char * pass) {
24+ server_rec * server;
25+ jk_server_conf_t * config;
670ec019 26+ pass_prefix *_prefix;
d32bd8ae
MK
27+ server = cmd->server;
28+ config = (jk_server_conf_t *) ap_get_module_config(server->module_config, &jk_module);
670ec019 29+ _prefix = ap_push_array (config->pass_prefixes);
d32bd8ae
MK
30+ _prefix->prefix = (char *) ap_palloc(cmd->pool, strlen(pass) + 1);
31+ strcpy(_prefix->prefix, pass);
32+ return NULL;
33+}
34+
35 /*
36 * JkEnvVar Directive Handling
37 *
670ec019 38@@ -1475,6 +1493,9 @@
d32bd8ae
MK
39 {"JkEnvVar", jk_add_env_var, NULL, RSRC_CONF, TAKE2,
40 "Adds a name of environment variable that should be sent to servlet-engine"},
41
42+ {"JkPass", jk_set_pass_prefix, NULL, RSRC_CONF, TAKE1,
43+ "Set the prefix for URIs that shouldn't be procceded to a servlet-engine worker (multiple)" },
44+
45 {NULL}
46 };
47
670ec019 48@@ -1490,11 +1511,30 @@
49 /* Retrieve the worker name stored by jk_translate() */
50 const char *worker_name = ap_table_get(r->notes, JK_WORKER_ID);
51 int rc;
d32bd8ae
MK
52+ server_rec * s;
53+ jk_server_conf_t * c;
d32bd8ae
MK
54+ pass_prefix *list;
55+ pass_prefix *item;
56+ int i;
670ec019 57
58 if(r->proxyreq) {
59 return HTTP_INTERNAL_SERVER_ERROR;
60 }
61
62+ s = r->server;
63+ c = (jk_server_conf_t *) ap_get_module_config(s->module_config, &jk_module);
d32bd8ae
MK
64+ list = (pass_prefix *) c->pass_prefixes->elts;
65+ for (i = 0; i < c->pass_prefixes->nelts; ++i) {
66+ item = &list[i];
67+ if (item->prefix) {
68+ char *pass = strstr(r->uri, item->prefix);
69+ if (pass && pass == r->uri) {
70+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, s, "Skipping URI: %s", r->uri);
71+ return DECLINED;
72+ }
73+ }
74+ }
75+
76 /* Set up r->read_chunked flags for chunked encoding, if present */
77 if(rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) {
78 return rc;
670ec019 79@@ -1651,6 +1691,9 @@
d32bd8ae
MK
80
81 c->s = s;
82
83+ c->pass_prefixes = ap_make_array(p, 4, sizeof(pass_prefix));
18e7d4c4 84+ ap_log_error( APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, s, "JkPass hack configured");
d32bd8ae
MK
85+
86 return c;
87 }
88
This page took 0.075332 seconds and 4 git commands to generate.