--- parser3/src/targets/cgi/parser3.C 2020/12/16 14:51:27 1.337 +++ parser3/src/targets/cgi/parser3.C 2020/12/21 23:35:50 1.340 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.337 2020/12/16 14:51:27 moko Exp $"; +volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.340 2020/12/21 23:35:50 moko Exp $"; #include "pa_config_includes.h" @@ -200,12 +200,6 @@ static void log_signal(const char* signa SAPI::log(*sapiInfo, "%s received %s processing request", signal_name, request ? "while" : "before or after"); } -#ifdef SIGUSR1 -static void SIGUSR1_handler(int /*sig*/){ - log_signal("SIGUSR1"); -} -#endif - #ifdef SIGPIPE #define SIGPIPE_NAME "SIGPIPE" static const String sigpipe_name(SIGPIPE_NAME); @@ -340,8 +334,10 @@ static void connection_handler(SAPI_Info } catch(const Exception& e) { // exception in connection handling or unhandled exception SAPI::log(info, "%s", e.comment()); const char *status = info.exception_http_status(e.type()); - if(status) + if(*status){ + info.clear_response_headers(); SAPI::send_error(info, e.comment(), status); + } } } @@ -393,6 +389,7 @@ static void httpd_mode() { connection.sock = -1; break; #else +#ifdef HAVE_TLS pthread_t thread; pthread_attr_t attr; pthread_attr_init(&attr); @@ -402,6 +399,7 @@ static void httpd_mode() { throw Exception("httpd.fork", 0, "thread creation failed (%d)", result); connection.sock=-1; break; +#endif case HTTPD_Server::PARALLEL: pid=fork(); if(pid<0) @@ -591,9 +589,6 @@ int main(int argc, char *argv[]) { 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(); -#ifdef SIGUSR1 - signal(SIGUSR1, SIGUSR1_handler); -#endif #ifdef SIGPIPE signal(SIGPIPE, SIGPIPE_handler); #endif