--- parser3/src/targets/cgi/parser3.C 2001/05/19 19:10:20 1.84 +++ parser3/src/targets/cgi/parser3.C 2001/05/21 08:01:36 1.87 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: parser3.C,v 1.84 2001/05/19 19:10:20 parser Exp $ + $Id: parser3.C,v 1.87 2001/05/21 08:01:36 parser Exp $ */ #include "pa_config_includes.h" @@ -52,7 +52,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; @@ -83,6 +84,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) { @@ -254,7 +257,7 @@ int main(int argc, char *argv[]) { // prepare to process request Request request(pool, request_info, - true ||cgi ? String::UL_USER_HTML : String::UL_AS_IS + cgi ? String::UL_USER_HTML : String::UL_AS_IS ); // some root-controlled location @@ -271,6 +274,9 @@ int main(int argc, char *argv[]) { 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 + printf("content-type:text/plain\n\nr=%s, s=%s", + root_auto_path, + site_auto_path); // process the request request.core(