- jakarta-tomcat-connectors-jk-jkpass.patch
[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
4@@ -175,8 +175,14 @@
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
19@@ -1389,6 +1395,18 @@
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;
26+
27+ server = cmd->server;
28+ config = (jk_server_conf_t *) ap_get_module_config(server->module_config, &jk_module);
29+ pass_prefix *_prefix = ap_push_array (config->pass_prefixes);
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 *
38@@ -1509,6 +1527,9 @@
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
48@@ -1529,6 +1550,25 @@
49 return HTTP_INTERNAL_SERVER_ERROR;
50 }
51
52+ server_rec * s;
53+ jk_server_conf_t * c;
54+ s = r->server;
55+ c = (jk_server_conf_t *) ap_get_module_config(s->module_config, &jk_module);
56+ pass_prefix *list;
57+ pass_prefix *item;
58+ int i;
59+ list = (pass_prefix *) c->pass_prefixes->elts;
60+ for (i = 0; i < c->pass_prefixes->nelts; ++i) {
61+ item = &list[i];
62+ if (item->prefix) {
63+ char *pass = strstr(r->uri, item->prefix);
64+ if (pass && pass == r->uri) {
65+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, s, "Skipping URI: %s", r->uri);
66+ return DECLINED;
67+ }
68+ }
69+ }
70+
71 /* Set up r->read_chunked flags for chunked encoding, if present */
72 if(rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) {
73 return rc;
74@@ -1685,6 +1725,9 @@
75
76 c->s = s;
77
78+ c->pass_prefixes = ap_make_array(p, 4, sizeof(pass_prefix));
79+ ap_log_error( APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, s, "AMG.net hack configured");
80+
81 return c;
82 }
83
This page took 0.072022 seconds and 4 git commands to generate.