--- parser3/src/targets/cgi/parser3.C 2001/03/18 20:31:29 1.21 +++ parser3/src/targets/cgi/parser3.C 2001/03/19 21:39:35 1.26 @@ -3,7 +3,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: parser3.C,v 1.21 2001/03/18 20:31:29 paf Exp $ + $Id: parser3.C,v 1.26 2001/03/19 21:39:35 paf Exp $ */ #ifdef HAVE_CONFIG_H @@ -20,9 +20,9 @@ #include #include +#include "pa_common.h" #include "pa_globals.h" #include "pa_request.h" -#include "pa_common.h" Pool pool; // global pool bool cgi; @@ -54,6 +54,12 @@ LONG WINAPI TopLevelExceptionFilter ( return EXCEPTION_EXECUTE_HANDLER; // never reached } # endif + +void fix_slashes(char *s) { + for(; *s; s++) + if(*s=='\\') + *s='/'; +} #endif // service funcs @@ -86,7 +92,7 @@ void output_body(const char *buf, size_t // main int main(int argc, char *argv[]) { - //TODO: umask(2); + // TODO:umask(2); #ifdef WIN32 _setmode(fileno(stdin), _O_BINARY); _setmode(fileno(stdout), _O_BINARY); @@ -113,7 +119,10 @@ int main(int argc, char *argv[]) { } } - const char *filespec_to_process=cgi?getenv("PATH_TRANSLATED"):argv[1]; + char *filespec_to_process=cgi?getenv("PATH_TRANSLATED"):argv[1]; +#ifdef WIN32 + fix_slashes(filespec_to_process); +#endif PTRY { // global try // must be first in PTRY{}PCATCH @@ -133,7 +142,6 @@ int main(int argc, char *argv[]) { "no file to process"); // Request info - // TODO: ifdef WIN32 flip \\ to / Request::Info request_info; const char *document_root=getenv("DOCUMENT_ROOT"); if(!document_root) { @@ -184,20 +192,15 @@ int main(int argc, char *argv[]) { // request.exception not not handled here, but all // request' data are associated with it's pool=exception - // must be last in PTRY{}PCATCH + // must be last in PTRY{}PCATCH #ifdef WIN32 # if _MSC_VER SetUnhandledExceptionFilter(0); # endif +#endif // successful finish return 0; -#endif } PCATCH(e) { // global problem - // @globals fill - // @Request create - // @prepare to .core() - // @request.core when reporting request exception - // @write result const char *body=e.comment(); int content_length=strlen(body);