--- mod_czs.c 2000/08/09 06:54:43 1.1.1.1 +++ mod_czs.c 2000/08/10 13:39:31 1.9 @@ -28,6 +28,7 @@ #include "http_config.h" #include "http_log.h" #include "http_protocol.h" +#include "translate.c" module MODULE_VAR_EXPORT mod_czs; @@ -50,72 +51,58 @@ ap_log_reason("file permissions deny server access", r->filename, r); return FORBIDDEN; } +#ifdef DEBUG if(r->args != 0 || do_czs) { ap_table_setn(r->headers_out, "X-czs_filename", r->filename); - ap_table_setn(r->headers_out, "X-czs_args", r->args); + ap_table_setn(r->headers_out, "X-czs_content-type", r->content_type); + if (r->args != 0) { + ap_table_setn(r->headers_out, "X-czs_args", r->args); + } } +#endif - r->content_type = "text/html"; /* hm? */ +#ifdef TEST_QUERYSTRINGV + if(r->args == 0 && !do_czs || strstr(r->content_type,"cgi") != NULL) { +#else + if(!do_czs || strstr(r->content_type,"cgi") != NULL) { +#endif + return DECLINED; +/* ap_send_fd(in, r); */ + } else { - ap_soft_timeout("send", r); - ap_send_http_header(r); + ap_soft_timeout("send", r); + ap_send_http_header(r); - if(r->header_only) { - ap_kill_timeout(r); - ap_pfclose(r->pool, in); - return OK; - } + if(r->header_only) { + ap_kill_timeout(r); + ap_pfclose(r->pool, in); + return OK; + } -#ifdef TEST_QUERYSTRING - if(r->args == 0 && !do_czs) { - ap_send_fd(in, r); - } else { -#endif - while(fgets(buffer,MAX_STRING_LEN,in)) { - for(i=0; ipool, in); return OK; } -int translate_path(request_rec *r) { - char *uri = r->uri; - request_rec *subr; - - if (uri[0]=='/' && uri[1]=='_' && uri[2]=='/') { -#if 0 - ap_table_setn(r->headers_out, "Location", ap_pstrcat(r->pool, uri+2, "?czs", NULL)); - return REDIRECT; -#endif - subr = (request_rec *) ap_sub_req_lookup_uri(r->uri+2, r); - r->filename=ap_pstrdup(r->pool, subr->filename); - ap_destroy_sub_req(subr); - do_czs=1; - return OK; - } - - return DECLINED; -} - /* Dispatch list of content handlers */ static const handler_rec czs_handlers[] = { { "czs", czs_handler }, @@ -143,5 +130,11 @@ NULL, /* child_init */ NULL, /* child_exit */ NULL /* [#0] post read-request */ +#ifdef EAPI + ,NULL, /* EAPI: add_module */ + NULL, /* EAPI: remove_module */ + NULL, /* EAPI: rewrite_command */ + NULL /* EAPI: new_connection */ +#endif };