--- parser3/src/targets/cgi/parser3.C 2024/08/26 20:47:06 1.355 +++ parser3/src/targets/cgi/parser3.C 2024/11/04 22:58:37 1.357 @@ -1,11 +1,11 @@ /** @file Parser: scripting and CGI main. - Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ -volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.355 2024/08/26 20:47:06 moko Exp $"; +volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.357 2024/11/04 22:58:37 moko Exp $"; #include "pa_config_includes.h" @@ -46,6 +46,9 @@ extern "C" int GC_pthread_create(pthread #define PARSER_CONFIG_ENV_NAME "CGI_PARSER_CONFIG" #define PARSER_LOG_ENV_NAME "CGI_PARSER_LOG" +SAPI_Info_CGI cgi_is_default; +SAPI_Info *sapiInfo=&cgi_is_default; + static const char* filespec_to_process = 0; // [file] static const char* httpd_host_port = 0; // -p option static const char* config_filespec = 0; // -f option or from env or next to the executable if exists @@ -599,7 +602,7 @@ static void call_real_parser_handler__su static void usage(const char* program) { printf( "Parser/%s\n" - "Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com)\n" + "Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com)\n" "Authors: Konstantin Morshnev , Alexandr Petrosian \n" "\n" "Usage: %s [options] [file]\n" @@ -626,7 +629,8 @@ int main(int argc, char *argv[]) { // were we started as CGI? bool cgi=(getenv("SERVER_SOFTWARE") || getenv("SERVER_NAME") || getenv("GATEWAY_INTERFACE") || getenv("REQUEST_METHOD")) && !getenv("PARSER_VERSION"); - sapiInfo = cgi ? new SAPI_Info_CGI() : new SAPI_Info(); + if(!cgi) + sapiInfo = new SAPI_Info(); #ifdef SIGPIPE signal(SIGPIPE, SIGPIPE_handler);