--- parser3/src/targets/cgi/parser3.C 2024/11/09 15:38:21 1.358 +++ parser3/src/targets/cgi/parser3.C 2024/11/10 00:28:42 1.360 @@ -5,7 +5,7 @@ Authors: Konstantin Morshnev , Alexandr Petrosian */ -volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.358 2024/11/09 15:38:21 moko Exp $"; +volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.360 2024/11/10 00:28:42 moko Exp $"; #include "pa_config_includes.h" @@ -192,10 +192,14 @@ void SAPI::add_header_attribute(SAPI_Inf info.add_header(dont_store_key, dont_store_value); } -void SAPI::send_header(SAPI_Info& info) { +void SAPI::send_headers(SAPI_Info& info) { info.send_headers(); } +void SAPI::clear_headers(SAPI_Info& info) { + info.headers.clear(); +} + size_t SAPI::send_body(SAPI_Info& info, const void *buf, size_t size) { return info.send_body(buf, size); } @@ -730,7 +734,8 @@ int main(int argc, char *argv[]) { REAL_PARSER_HANDLER(cgi); } catch(const Exception& e) { // exception in unhandled exception - SAPI::die("%s", e.comment()); + SAPI::log(*sapi_info, "%s", e.comment()); + SAPI::send_error(*sapi_info, e.comment(), strcmp(e.type(), "file.missing") ? "500" : "404"); } #ifdef PA_DEBUG_CGI_ENTRY_EXIT