- 1.2.8
[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
94b14f20 4@@ -135,8 +135,14 @@
5 table *envvars;
d32bd8ae
MK
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
94b14f20 19@@ -1414,6 +1420,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 *
94b14f20 38@@ -1564,6 +1582,9 @@
39 {"JkWorkerProperty", jk_set_worker_property, NULL, RSRC_CONF, RAW_ARGS,
40 "Set workers.properties formated directive"},
d32bd8ae
MK
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
94b14f20 48@@ -1579,11 +1600,30 @@
670ec019 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
94b14f20 58 if (r->proxyreq) {
670ec019 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 64+ list = (pass_prefix *) c->pass_prefixes->elts;
94b14f20 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+
d32bd8ae 76 /* Set up r->read_chunked flags for chunked encoding, if present */
94b14f20 77 if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) {
78 return rc;
79@@ -1771,6 +1811,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.053125 seconds and 4 git commands to generate.