--- parser3/src/targets/cgi/parser3.C 2016/11/28 00:37:16 1.274 +++ parser3/src/targets/cgi/parser3.C 2019/12/05 23:09:02 1.279 @@ -1,11 +1,11 @@ /** @file Parser: scripting and CGI main. - Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.274 2016/11/28 00:37:16 moko Exp $"; +volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.279 2019/12/05 23:09:02 moko Exp $"; #include "pa_config_includes.h" @@ -28,7 +28,7 @@ volatile const char * IDENT_PARSER3_C="$ // comment remove me after debugging //#define PA_DEBUG_CGI_ENTRY_EXIT "c:\\parser\\debug-parser3.log" -#if _MSC_VER && !defined(_DEBUG) +#if defined(_MSC_VER) && !defined(_DEBUG) # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif @@ -58,7 +58,8 @@ bool execution_canceled=false; // SAPI -struct SAPI_Info { +class SAPI_Info { +public: int http_response_code; } SAPI_info = { 0 }; @@ -257,9 +258,9 @@ static void full_file_spec(const char* f #ifdef WIN32 || file_name[0] && file_name[1]==':' #endif - ) - strncpy(buf, file_name, buf_size); - else { + ){ + strncpy(buf, file_name, buf_size-1); buf[buf_size-1]=0; + } else { char cwd[MAX_STRING]; snprintf(buf, buf_size, "%s/%s", getcwd(cwd, MAX_STRING) ? cwd : "", file_name); } @@ -301,7 +302,7 @@ static void SIGPIPE_handler(int /*sig*/) execution_canceled=true; if(request) - request->set_interrupted(true); + request->set_skip(Request::SKIP_INTERRUPTED); } #endif @@ -569,7 +570,7 @@ static void call_real_parser_handler__su static void usage(const char* program) { printf( "Parser/%s\n" - "Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com)\n" + "Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com)\n" "Author: Alexandr Petrosian (http://paf.design.ru)\n" "\n" "Usage: %s [options] file\n"