NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <cgi/cgiapp.hpp>
#include <corelib/ncbienv.hpp>
#include <corelib/rwstream.hpp>
#include <corelib/stream_utils.hpp>
#include <corelib/ncbi_system.hpp>
#include <corelib/ncbi_safe_static.hpp>
#include <corelib/request_ctx.hpp>
#include <corelib/ncbi_strings.h>
#include <util/multi_writer.hpp>
#include <util/cache/cache_ref.hpp>
#include <cgi/cgictx.hpp>
#include <cgi/cgi_exception.hpp>
#include <cgi/cgi_serial.hpp>
#include <cgi/error_codes.hpp>
#include <signal.h>
#include <unistd.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
class | CCGIStreamReader |
class | CCgiStreamWrapperWriter |
class | CStderrDiagFactory |
class | CAsBodyDiagFactory |
Macros | |
#define | NCBI_USE_ERRCODE_X Cgi_Application |
Functions | |
NCBI_PARAM_DECL (bool, CGI, Print_Http_Referer) | |
NCBI_PARAM_DEF_EX (bool, CGI, Print_Http_Referer, true, eParam_NoThread, CGI_PRINT_HTTP_REFERER) | |
typedef | NCBI_PARAM_TYPE (CGI, Print_Http_Referer) TPrintRefererParam |
NCBI_PARAM_DECL (bool, CGI, Print_User_Agent) | |
NCBI_PARAM_DEF_EX (bool, CGI, Print_User_Agent, true, eParam_NoThread, CGI_PRINT_USER_AGENT) | |
typedef | NCBI_PARAM_TYPE (CGI, Print_User_Agent) TPrintUserAgentParam |
NCBI_PARAM_DECL (bool, CGI, Print_Self_Url) | |
NCBI_PARAM_DEF_EX (bool, CGI, Print_Self_Url, true, eParam_NoThread, CGI_PRINT_SELF_URL) | |
typedef | NCBI_PARAM_TYPE (CGI, Print_Self_Url) TPrintSelfUrlParam |
NCBI_PARAM_DECL (bool, CGI, Print_Request_Method) | |
NCBI_PARAM_DEF_EX (bool, CGI, Print_Request_Method, true, eParam_NoThread, CGI_PRINT_REQUEST_METHOD) | |
typedef | NCBI_PARAM_TYPE (CGI, Print_Request_Method) TPrintRequestMethodParam |
NCBI_PARAM_DECL (bool, CGI, Allow_Sigpipe) | |
NCBI_PARAM_DEF_EX (bool, CGI, Allow_Sigpipe, false, eParam_NoThread, CGI_ALLOW_SIGPIPE) | |
typedef | NCBI_PARAM_TYPE (CGI, Allow_Sigpipe) TParamAllowSigpipe |
NCBI_PARAM_DEF_EX (bool, CGI, Client_Connection_Interruption_Okay, false, eParam_NoThread, CGI_CLIENT_CONNECTION_INTERRUPTION_OKAY) | |
NCBI_PARAM_ENUM_ARRAY (EDiagSev, CGI, Client_Connection_Interruption_Severity) | |
NCBI_PARAM_ENUM_DEF_EX (EDiagSev, CGI, Client_Connection_Interruption_Severity, eDiag_Error, eParam_NoThread, CGI_CLIENT_CONNECTION_INTERRUPTION_SEVERITY) | |
NCBI_PARAM_DECL (bool, CGI, Count_Transfered) | |
NCBI_PARAM_DEF_EX (bool, CGI, Count_Transfered, true, eParam_NoThread, CGI_COUNT_TRANSFERED) | |
typedef | NCBI_PARAM_TYPE (CGI, Count_Transfered) TCGI_Count_Transfered |
void | SigTermHandler (int) |
static void | s_CleanupProcessor (CCgiRequestProcessor *processor, void *) |
NCBI_PARAM_DECL (bool, CGI, Merge_Log_Lines) | |
NCBI_PARAM_DEF_EX (bool, CGI, Merge_Log_Lines, true, eParam_NoThread, CGI_MERGE_LOG_LINES) | |
typedef | NCBI_PARAM_TYPE (CGI, Merge_Log_Lines) TMergeLogLines |
NCBI_PARAM_DECL (bool, CGI, EnableHelpRequest) | |
NCBI_PARAM_DEF_EX (bool, CGI, EnableHelpRequest, true, eParam_NoThread, CGI_ENABLE_HELP_REQUEST) | |
typedef | NCBI_PARAM_TYPE (CGI, EnableHelpRequest) TEnableHelpRequest |
string | FindContentType (CTempString format) |
NCBI_PARAM_DECL (string, CGI, EnableVersionRequest) | |
NCBI_PARAM_DEF_EX (string, CGI, EnableVersionRequest, "t", eParam_NoThread, CGI_ENABLE_VERSION_REQUEST) | |
typedef | NCBI_PARAM_TYPE (CGI, EnableVersionRequest) TEnableVersionRequest |
NCBI_PARAM_DECL (bool, CGI, ValidateCSRFToken) | |
NCBI_PARAM_DEF_EX (bool, CGI, ValidateCSRFToken, false, eParam_NoThread, CGI_VALIDATE_CSRF_TOKEN) | |
typedef | NCBI_PARAM_TYPE (CGI, ValidateCSRFToken) TParamValidateCSRFToken |
DEFINE_STATIC_FAST_MUTEX (s_RestartReasonMutex) | |
NCBI_PARAM_DECL (string, CGI, Exception_Message) | |
NCBI_PARAM_DEF_EX (string, CGI, Exception_Message, "", eParam_NoThread, CGI_EXCEPTION_MESSAGE) | |
typedef | NCBI_PARAM_TYPE (CGI, Exception_Message) TExceptionMessage |
NCBI_PARAM_DEF (bool, CGI, DisableTrackingCookie, false) | |
NCBI_PARAM_DEF (string, CGI, TrackingCookieName, "ncbi_sid") | |
NCBI_PARAM_DEF (string, CGI, TrackingTagName, "NCBI-SID") | |
NCBI_PARAM_DEF (string, CGI, TrackingCookieDomain, ".nih.gov") | |
NCBI_PARAM_DEF (string, CGI, TrackingCookiePath, "/") | |
Variables | |
const char * | kToolkitRcPath = "/etc/toolkitrc" |
const char * | kWebDirToPort = "Web_dir_to_port" |
static const char * | kStdFormats [] = { "html", "xml", "json" } |
static const char * | kStdContentTypes [] = { "text/html", "text/xml", "application/json" } |
static const char * | kCSRFTokenName = "NCBI_CSRF_TOKEN" |
#define NCBI_USE_ERRCODE_X Cgi_Application |
Definition at line 59 of file cgiapp.cpp.
DEFINE_STATIC_FAST_MUTEX | ( | s_RestartReasonMutex | ) |
|
inline |
Definition at line 1761 of file cgiapp.cpp.
References format, i, kEmptyStr, kStdContentTypes, and kStdFormats.
Referenced by CCgiRequestProcessor::ProcessHelpRequest().
NCBI_PARAM_DEF | ( | bool | , |
CGI | , | ||
DisableTrackingCookie | , | ||
false | |||
) |
NCBI_PARAM_DEF | ( | string | , |
CGI | , | ||
TrackingCookieDomain | , | ||
".nih.gov" | |||
) |
NCBI_PARAM_DEF | ( | string | , |
CGI | , | ||
TrackingCookieName | , | ||
"ncbi_sid" | |||
) |
NCBI_PARAM_DEF | ( | string | , |
CGI | , | ||
TrackingCookiePath | , | ||
"/" | |||
) |
NCBI_PARAM_DEF | ( | string | , |
CGI | , | ||
TrackingTagName | , | ||
"NCBI-SID" | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
Allow_Sigpipe | , | ||
false | , | ||
eParam_NoThread | , | ||
CGI_ALLOW_SIGPIPE | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
Client_Connection_Interruption_Okay | , | ||
false | , | ||
eParam_NoThread | , | ||
CGI_CLIENT_CONNECTION_INTERRUPTION_OKAY | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
Count_Transfered | , | ||
true | , | ||
eParam_NoThread | , | ||
CGI_COUNT_TRANSFERED | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
EnableHelpRequest | , | ||
true | , | ||
eParam_NoThread | , | ||
CGI_ENABLE_HELP_REQUEST | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
Merge_Log_Lines | , | ||
true | , | ||
eParam_NoThread | , | ||
CGI_MERGE_LOG_LINES | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
Print_Http_Referer | , | ||
true | , | ||
eParam_NoThread | , | ||
CGI_PRINT_HTTP_REFERER | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
Print_Request_Method | , | ||
true | , | ||
eParam_NoThread | , | ||
CGI_PRINT_REQUEST_METHOD | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
Print_Self_Url | , | ||
true | , | ||
eParam_NoThread | , | ||
CGI_PRINT_SELF_URL | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
Print_User_Agent | , | ||
true | , | ||
eParam_NoThread | , | ||
CGI_PRINT_USER_AGENT | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
CGI | , | ||
ValidateCSRFToken | , | ||
false | , | ||
eParam_NoThread | , | ||
CGI_VALIDATE_CSRF_TOKEN | |||
) |
NCBI_PARAM_DEF_EX | ( | string | , |
CGI | , | ||
EnableVersionRequest | , | ||
"t" | , | ||
eParam_NoThread | , | ||
CGI_ENABLE_VERSION_REQUEST | |||
) |
NCBI_PARAM_DEF_EX | ( | string | , |
CGI | , | ||
Exception_Message | , | ||
"" | , | ||
eParam_NoThread | , | ||
CGI_EXCEPTION_MESSAGE | |||
) |
NCBI_PARAM_ENUM_ARRAY | ( | EDiagSev | , |
CGI | , | ||
Client_Connection_Interruption_Severity | |||
) |
Definition at line 100 of file cgiapp.cpp.
References eDiag_Critical, eDiag_Error, eDiag_Fatal, eDiag_Info, eDiag_Trace, and eDiag_Warning.
NCBI_PARAM_ENUM_DEF_EX | ( | EDiagSev | , |
CGI | , | ||
Client_Connection_Interruption_Severity | , | ||
eDiag_Error | , | ||
eParam_NoThread | , | ||
CGI_CLIENT_CONNECTION_INTERRUPTION_SEVERITY | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
Allow_Sigpipe | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
Count_Transfered | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
EnableHelpRequest | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
EnableVersionRequest | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
Exception_Message | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
Merge_Log_Lines | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
Print_Http_Referer | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
Print_Request_Method | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
Print_Self_Url | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
Print_User_Agent | |||
) |
typedef NCBI_PARAM_TYPE | ( | CGI | , |
ValidateCSRFToken | |||
) |
|
static |
Definition at line 845 of file cgiapp.cpp.
Referenced by CCgiApplication::x_CreateProcessor().
void SigTermHandler | ( | int | ) |
Definition at line 463 of file cgiapp.cpp.
Referenced by CCgiApplication::Run().
|
static |
Definition at line 1880 of file cgiapp.cpp.
Referenced by CCgiRequestProcessor::ValidateSynchronizationToken().
Definition at line 1759 of file cgiapp.cpp.
Referenced by FindContentType(), and CCgiRequestProcessor::ProcessHelpRequest().
|
static |
Definition at line 1758 of file cgiapp.cpp.
Referenced by FindContentType(), and CCgiRequestProcessor::ProcessHelpRequest().
const char* kToolkitRcPath = "/etc/toolkitrc" |
Definition at line 1639 of file cgiapp.cpp.
Referenced by GetDefaultLogLocation(), and CCgiApplication::GetDefaultLogPath().
const char* kWebDirToPort = "Web_dir_to_port" |
Definition at line 1640 of file cgiapp.cpp.
Referenced by GetDefaultLogLocation(), and CCgiApplication::GetDefaultLogPath().