28 |
#include "http_config.h" |
#include "http_config.h" |
29 |
#include "http_log.h" |
#include "http_log.h" |
30 |
#include "http_protocol.h" |
#include "http_protocol.h" |
|
#include "translate.c" |
|
31 |
|
|
32 |
module MODULE_VAR_EXPORT mod_czs; |
module MODULE_VAR_EXPORT mod_czs; |
33 |
|
|
102 |
return OK; |
return OK; |
103 |
} |
} |
104 |
|
|
105 |
|
int translate_path(request_rec *r) { |
106 |
|
char *uri = r->uri; |
107 |
|
request_rec *subr; |
108 |
|
char *type = NULL; |
109 |
|
extern do_czs; |
110 |
|
|
111 |
|
do_czs=0; |
112 |
|
|
113 |
|
#ifdef DEBUG |
114 |
|
ap_table_setn(r->headers_out, "X-translate", r->uri); |
115 |
|
#endif |
116 |
|
if (uri[0]=='/' && (uri[1] | 0x20) =='c' && (uri[2] | 0x20)=='z' && (uri[3] | 0x20) =='s') { |
117 |
|
#if 0 |
118 |
|
ap_table_setn(r->headers_out, "Location", ap_pstrcat(r->pool, uri+2, "?czs", NULL)); |
119 |
|
return REDIRECT; |
120 |
|
#endif |
121 |
|
subr = (request_rec *) ap_sub_req_lookup_uri(r->uri+4, r); |
122 |
|
r->filename=ap_pstrdup(r->pool, subr->filename); |
123 |
|
type = subr->content_type; |
124 |
|
#ifdef DEBUG |
125 |
|
ap_table_setn(r->headers_out, "X-translate-content-type", type); |
126 |
|
#endif |
127 |
|
if (type == NULL) { |
128 |
|
return DECLINED; /* hm? */ |
129 |
|
} |
130 |
|
do_czs=1; |
131 |
|
ap_destroy_sub_req(subr); |
132 |
|
#ifdef XHEADER |
133 |
|
# ifdef DEBUG |
134 |
|
ap_table_setn(r->headers_out, "X-debug", XHEADER); |
135 |
|
# endif |
136 |
|
#endif |
137 |
|
return OK; |
138 |
|
} |
139 |
|
|
140 |
|
return DECLINED; |
141 |
|
} |
142 |
/* Dispatch list of content handlers */ |
/* Dispatch list of content handlers */ |
143 |
static const handler_rec czs_handlers[] = { |
static const handler_rec czs_handlers[] = { |
144 |
{ "czs", czs_handler }, |
{ "czs", czs_handler }, |