--- parser3/src/targets/apache13/modules/extra/Attic/mod_parser3.C 2001/03/21 14:06:49 1.2 +++ parser3/src/targets/apache13/modules/extra/Attic/mod_parser3.C 2001/03/21 15:53:26 1.4 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: mod_parser3.C,v 1.2 2001/03/21 14:06:49 paf Exp $ + $Id: mod_parser3.C,v 1.4 2001/03/21 15:53:26 paf Exp $ */ #include "httpd.h" @@ -448,6 +448,11 @@ static const char *cmd_example(cmd_parms // service funcs +const char *get_env(Pool& pool, const char *name) { + request_rec *r=static_cast(pool.info()); + return (const char *)ap_table_get(r->subprocess_env, name); +} + int read_post(Pool& pool, char *buf, int max_bytes) { return 0;/* @todo int read_size=0; @@ -465,7 +470,7 @@ int read_post(Pool& pool, char *buf, int void add_header_attribute(Pool& pool, const char *key, const char *value) { request_rec *r=static_cast(pool.info()); - if(strcmp(key, "content-type")==0) { + if(strcasecmp(key, "content-type")==0) { /* r->content_type, *not* r->headers_out("Content-type"). If you don't * set it, it will be filled in with the server's default type (typically * "text/plain"). You *must* also ensure that r->content_type is lower @@ -506,9 +511,9 @@ static int parser3_handler(request_rec * ap_soft_timeout("send example call trace", r); PTRY { // global try const char *filespec_to_process=r->filename; - PTHROW(0, 0, - 0, - "no file to process"); + + ap_add_common_vars(r); + ap_add_cgi_vars(r); // Request info Request::Info request_info; @@ -524,7 +529,8 @@ static int parser3_handler(request_rec * request_info.path_translated=filespec_to_process; request_info.method=r->method; request_info.query_string=r->args; - request_info.uri=r->uri; + request_info.uri= + (const char *)ap_table_get(r->subprocess_env, "REQUEST_URI"); request_info.content_type=r->content_type; const char *content_length = (const char *)ap_table_get(r->subprocess_env, "CONTENT_LENGTH"); @@ -548,7 +554,7 @@ static int parser3_handler(request_rec * strcat(sys_auto_path1, PATH_DELIMITER_STRING); #else // ~nobody - sys_auto_path1=getenv("HOME"); + sys_auto_path1=zgetenv("HOME"); #endif // beside by binary @@ -656,6 +662,7 @@ static void parser3_init(server_rec *s, globals_init(pool); // Service funcs + service_funcs.get_env=get_env; service_funcs.read_post=read_post; service_funcs.add_header_attribute=add_header_attribute; service_funcs.send_header=send_header;