--- parser3/src/targets/cgi/parser3.C 2006/04/09 13:38:47 1.239 +++ parser3/src/targets/cgi/parser3.C 2007/08/17 08:16:11 1.243 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_PARSER3_C="$Date: 2006/04/09 13:38:47 $"; +static const char * const IDENT_PARSER3_C="$Date: 2007/08/17 08:16:11 $"; #include "pa_config_includes.h" @@ -238,7 +238,7 @@ size_t SAPI::read_post(SAPI_Info& , char } void SAPI::add_header_attribute(SAPI_Info& , const char* dont_store_key, const char* dont_store_value) { - if(cgi) + if( cgi && (!request || !request->console.was_used()) ) printf("%s: %s\n", dont_store_key, dont_store_value); } @@ -297,8 +297,15 @@ static void SIGUSR1_handler(int /*sig*/) #endif #ifdef SIGPIPE +#define SIGPIPE_NAME "SIGPIPE" +static const String sigpipe_name(SIGPIPE_NAME); static void SIGPIPE_handler(int /*sig*/){ + Value* sigpipe=0; + if(request) + sigpipe=request->main_class.get_element(sigpipe_name, request->main_class, false); + if(sigpipe && sigpipe->as_bool()) log_signal("SIGPIPE"); + execution_canceled=true; if(request) request->set_interrupted(true); @@ -384,7 +391,7 @@ static void real_parser_handler(const ch memcpy(document_root_buf, filespec_to_process, len); document_root_buf[len]=0; request_info.document_root=document_root_buf; } else - throw Exception("parser.runtime", + throw Exception(PARSER_RUNTIME, 0, "CGI: no PATH_INFO defined(in reinventing DOCUMENT_ROOT)"); } else { @@ -588,7 +595,7 @@ static void call_real_parser_handler__su static void usage(const char* program) { printf( "Parser/%s\n" - "Copyright(c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com)\n" + "Copyright(c) 2001-2007 ArtLebedev Group (http://www.artlebedev.com)\n" "Author: Alexandr Petrosian (http://paf.design.ru)\n" "\n" "Usage: %s [options] file\n"