--- parser3/src/targets/apache13/Attic/mod_parser3.C 2002/03/27 15:30:37 1.19 +++ parser3/src/targets/apache13/Attic/mod_parser3.C 2002/06/11 12:20:42 1.21 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: mod_parser3.C,v 1.19 2002/03/27 15:30:37 paf Exp $ + $Id: mod_parser3.C,v 1.21 2002/06/11 12:20:42 paf Exp $ */ #include "pa_config_includes.h" @@ -150,6 +150,35 @@ const char *SAPI::get_env(Pool& pool, co return (const char *)ap_table_get(r->subprocess_env, name); } +#ifndef DOXYGEN +struct SAPI_environment_append_info { + Pool *pool; + const char **cur; +}; +#endif +static const char *mk_env_pair(Pool& pool, const char *key, const char *value) { + char *result=(char *)pool.malloc(strlen(key)+1/*=*/+strlen(value)+1/*0*/); + strcpy(result, key); strcat(result, "="); strcat(result, value); + return result; +} +static int SAPI_environment_append(void *d, const char *k, const char *val) { + if( k && val ) { + SAPI_environment_append_info& info= + *static_cast(d); + *info.cur++=mk_env_pair(*info.pool, k, val); + } + return 1/*true*/; +} +const char *const *SAPI::environment(Pool& pool) { + request_rec *r=static_cast(pool.get_context()); + const table *t=r->subprocess_env; + const char **result= + (const char **)pool.malloc(sizeof(char *)*(ap_table_elts(t)->nelts+1/*0*/)); + SAPI_environment_append_info info={&pool, result}; + ap_table_do(SAPI_environment_append, &info, t, 0); *info.cur=0; // mark EOE + return result; +} + size_t SAPI::read_post(Pool& pool, char *buf, size_t max_bytes) { request_rec *r=static_cast(pool.get_context()); @@ -235,7 +264,6 @@ static void real_parser_handler(Pool& po const char *content_length=SAPI::get_env(pool, "CONTENT_LENGTH"); request_info.content_length=content_length?atoi(content_length):0; request_info.cookie=SAPI::get_env(pool, "HTTP_COOKIE"); - request_info.user_agent=SAPI::get_env(pool, "HTTP_USER_AGENT"); // config Parser_module_config *dcfg=our_dconfig(r); @@ -706,7 +734,7 @@ module MODULE_VAR_EXPORT parser3_module }; #if defined(_MSC_VER) -# define APACHE_WIN32_SRC "/parser3project/win32apache13/src" +# define APACHE_WIN32_SRC "/parser3project/win32/apache13/src" # ifdef _DEBUG # pragma comment(lib, APACHE_WIN32_SRC "/CoreD/ApacheCore.lib") # else