--- parser3/src/targets/cgi/parser3.C 2002/12/05 09:41:56 1.207 +++ parser3/src/targets/cgi/parser3.C 2002/12/09 13:02:36 1.211 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_PARSER3_C="$Date: 2002/12/05 09:41:56 $"; +static const char* IDENT_PARSER3_C="$Date: 2002/12/09 13:02:36 $"; #include "pa_config_includes.h" @@ -88,6 +88,9 @@ static void log(const char *fmt, va_list if(!opened) f=stderr; + // use no memory [so that we could log out-of-memory error] + setbuf(f, 0); // stderr stream is unbuffered by default, but still... + // prefix time_t t=time(0); if(const char *stamp=ctime(&t)) { // never saw that @@ -154,7 +157,8 @@ void SAPI::die(const char *fmt, ...) { // body SAPI::send_body(global_pool, body, content_length); - exit(1); + // exit & try to produce core dump + abort(); } const char *SAPI::get_env(Pool& , const char *name) { @@ -209,9 +213,9 @@ static void full_file_spec(const char *f if(file_name) if(file_name[0]=='/' #ifdef WIN32 - || (file_name[0] && file_name[1]==':') + || file_name[0] && file_name[1]==':' #endif - ) + ) strncpy(buf, file_name, buf_size); else { char cwd[MAX_STRING]; getcwd(cwd, MAX_STRING); @@ -491,9 +495,11 @@ int main(int argc, char *argv[]) { getenv("REQUEST_METHOD"); char *raw_filespec_to_process; - if(cgi) + if(cgi) { raw_filespec_to_process=getenv("PATH_TRANSLATED"); - else { + if(raw_filespec_to_process && !*raw_filespec_to_process) + raw_filespec_to_process=0; + } else { optind = 1; opterr = 0; int c;