--- parser3/src/targets/cgi/parser3.C 2001/05/15 11:36:15 1.78 +++ parser3/src/targets/cgi/parser3.C 2001/06/28 07:41:59 1.92 @@ -5,8 +5,9 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: parser3.C,v 1.78 2001/05/15 11:36:15 parser Exp $ + $Id: parser3.C,v 1.92 2001/06/28 07:41:59 parser Exp $ */ +static char *RCSId="$Id: parser3.C,v 1.92 2001/06/28 07:41:59 parser Exp $"; #include "pa_config_includes.h" @@ -21,6 +22,9 @@ #include "pa_socks.h" #include "pa_version.h" +//#define DEBUG_POOL_MALLOC + + /// IIS refuses to read bigger chunks const size_t READ_POST_CHUNK_SIZE=0x400*0x400; // 1M @@ -49,7 +53,8 @@ static LONG WINAPI TopLevelExceptionFilt #endif // SAPI -// appends to parser3.log located beside my binary + +// appends to parser3.log located beside my binary if openable, to stderr otherwize void SAPI::log(Pool& pool, const char *fmt, ...) { bool opened; FILE *f=0; @@ -80,6 +85,8 @@ void SAPI::log(Pool& pool, const char *f if(opened) fclose(f); + else + fflush(f); } const char *SAPI::get_env(Pool& pool, const char *name) { @@ -266,8 +273,13 @@ int main(int argc, char *argv[]) { // beside by binary static char site_auto_path[MAX_STRING]; - strncpy(site_auto_path, argv[0], MAX_STRING); // filespec of my binary - rsplit(site_auto_path, '/'); rsplit(site_auto_path, '\\');// strip filename + strncpy(site_auto_path, argv0, MAX_STRING); // filespec of my binary + if(!( + rsplit(site_auto_path, '/') || + rsplit(site_auto_path, '\\'))) { // strip filename + // no path, just filename + site_auto_path[0]='.'; site_auto_path[1]=0; + } // process the request request.core( @@ -278,8 +290,10 @@ int main(int argc, char *argv[]) { // done_socks(); +#ifdef DEBUG_POOL_MALLOC extern void log_pool_stats(Pool& pool); log_pool_stats(pool); +#endif // must be last in PTRY{}PCATCH #ifdef WIN32