NCBI C++ ToolKit
Classes | Macros | Functions | Variables
ncbicgi.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbienv.hpp>
#include <corelib/ncbitime.hpp>
#include <corelib/ncbi_param.hpp>
#include <corelib/ncbiapp.hpp>
#include <corelib/ncbi_safe_static.hpp>
#include <corelib/request_ctx.hpp>
#include <corelib/ncbi_strings.h>
#include <cgi/cgi_exception.hpp>
#include <cgi/cgi_serial.hpp>
#include <cgi/cgi_session.hpp>
#include <cgi/error_codes.hpp>
#include <cgi/impl/cgi_entry_reader.hpp>
#include <util/checksum.hpp>
#include <util/ncbi_url.hpp>
#include "cgi_impl.hpp"
#include <algorithm>
#include <stdio.h>
#include <time.h>
+ Include dependency graph for ncbicgi.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CTrackingEnvHolder
 
class  CStringEntryCollector
 

Macros

#define STDIN_FILENO   0
 
#define NCBI_USE_ERRCODE_X   Cgi_API
 

Functions

 NCBI_PARAM_ENUM_DECL (EDiagSev, CGI, Cookie_Error_Severity)
 
 NCBI_PARAM_ENUM_ARRAY (EDiagSev, CGI, Cookie_Error_Severity)
 
 NCBI_PARAM_ENUM_DEF_EX (EDiagSev, CGI, Cookie_Error_Severity, eDiag_Error, eParam_NoThread, CGI_COOKIE_ERROR_SEVERITY)
 
typedef NCBI_PARAM_TYPE (CGI, Cookie_Error_Severity) TCookieErrorSeverity
 
 NCBI_PARAM_ENUM_DECL (CCgiCookie::ECookieEncoding, CGI, Cookie_Encoding)
 
 NCBI_PARAM_ENUM_ARRAY (CCgiCookie::ECookieEncoding, CGI, Cookie_Encoding)
 
 NCBI_PARAM_ENUM_DEF_EX (CCgiCookie::ECookieEncoding, CGI, Cookie_Encoding, CCgiCookie::eCookieEnc_Url, eParam_NoThread, CGI_COOKIE_ENCODING)
 
typedef NCBI_PARAM_TYPE (CGI, Cookie_Encoding) TCookieEncoding
 
 NCBI_PARAM_DECL (string, CGI, cookie_auth_token)
 
 NCBI_PARAM_DEF (string, CGI, cookie_auth_token, "WebCubbyUser")
 
typedef NCBI_PARAM_TYPE (CGI, cookie_auth_token) TCookieAuthToken
 
bool s_IsZeroTime (const tm &date)
 
static bool s_CookieLess (const string &name1, const string &domain1, const string &path1, const string &name2, const string &domain2, const string &path2)
 
 NCBI_PARAM_DECL (string, CGI, Cookie_Name_Banned_Symbols)
 
 NCBI_PARAM_DEF_EX (string, CGI, Cookie_Name_Banned_Symbols, " ,;=", eParam_NoThread, CGI_COOKIE_NAME_BANNED_SYMBOLS)
 
typedef NCBI_PARAM_TYPE (CGI, Cookie_Name_Banned_Symbols) TCookieNameBannedSymbols
 
const char * s_GetCookieNameBannedSymbols (void)
 
static void s_AddEntry (TCgiEntries &entries, const string &name, const string &value, unsigned int position, const string &filename=kEmptyStr, const string &type=kEmptyStr)
 
 NCBI_PARAM_ENUM_ARRAY (CCgiCookies::EOnBadCookie, CGI, On_Bad_Cookie)
 
 NCBI_PARAM_ENUM_DEF_EX (CCgiCookies::EOnBadCookie, CGI, On_Bad_Cookie, CCgiCookies::eOnBadCookie_Store, eParam_NoThread, CGI_ON_BAD_COOKIE)
 
typedef NCBI_PARAM_TYPE (CGI, On_Bad_Cookie) TOnBadCookieParam
 
static CTempString x_FirstWord (const CTempStringEx &forward)
 
 NCBI_PARAM_DECL (string, CGI, LOG_EXCLUDE_ARGS)
 
 NCBI_PARAM_DEF_EX (string, CGI, LOG_EXCLUDE_ARGS, "", eParam_NoThread, CGI_LOG_EXCLUDE_ARGS)
 
typedef NCBI_PARAM_TYPE (CGI, LOG_EXCLUDE_ARGS) TCGI_LogExcludeArgs
 
 NCBI_PARAM_DECL (string, CGI, LOG_LIMIT_ARGS)
 
 NCBI_PARAM_DEF_EX (string, CGI, LOG_LIMIT_ARGS, "*:1000000", eParam_NoThread, CGI_LOG_LIMIT_ARGS)
 
typedef NCBI_PARAM_TYPE (CGI, LOG_LIMIT_ARGS) TCGI_LogLimitArgs
 
bool s_Is_ISO_8859_1 (const string &charset)
 
bool s_Is_Windows_1252 (const string &charset)
 
bool s_Is_UTF_8 (const string &charset)
 
EEncodingForm GetCharsetEncodingForm (const string &charset, CCgiEntry::EOnCharsetError on_error)
 

Variables

static const tm kZeroTime = { 0 }
 
static const char * kTrackingVars []
 
static const char * s_PropName [eCgi_NProperties+1]
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Cgi_API

Definition at line 65 of file ncbicgi.cpp.

◆ STDIN_FILENO

#define STDIN_FILENO   0

Definition at line 61 of file ncbicgi.cpp.

Function Documentation

◆ GetCharsetEncodingForm()

EEncodingForm GetCharsetEncodingForm ( const string charset,
CCgiEntry::EOnCharsetError  on_error 
)

◆ NCBI_PARAM_DECL() [1/4]

NCBI_PARAM_DECL ( string  ,
CGI  ,
cookie_auth_token   
)

◆ NCBI_PARAM_DECL() [2/4]

NCBI_PARAM_DECL ( string  ,
CGI  ,
Cookie_Name_Banned_Symbols   
)

◆ NCBI_PARAM_DECL() [3/4]

NCBI_PARAM_DECL ( string  ,
CGI  ,
LOG_EXCLUDE_ARGS   
)

◆ NCBI_PARAM_DECL() [4/4]

NCBI_PARAM_DECL ( string  ,
CGI  ,
LOG_LIMIT_ARGS   
)

◆ NCBI_PARAM_DEF()

NCBI_PARAM_DEF ( string  ,
CGI  ,
cookie_auth_token  ,
"WebCubbyUser"   
)

◆ NCBI_PARAM_DEF_EX() [1/3]

NCBI_PARAM_DEF_EX ( string  ,
CGI  ,
Cookie_Name_Banned_Symbols  ,
 
)

◆ NCBI_PARAM_DEF_EX() [2/3]

NCBI_PARAM_DEF_EX ( string  ,
CGI  ,
LOG_EXCLUDE_ARGS  ,
""  ,
eParam_NoThread  ,
CGI_LOG_EXCLUDE_ARGS   
)

◆ NCBI_PARAM_DEF_EX() [3/3]

NCBI_PARAM_DEF_EX ( string  ,
CGI  ,
LOG_LIMIT_ARGS  ,
"*:1000000"  ,
eParam_NoThread  ,
CGI_LOG_LIMIT_ARGS   
)

◆ NCBI_PARAM_ENUM_ARRAY() [1/3]

NCBI_PARAM_ENUM_ARRAY ( CCgiCookie::ECookieEncoding  ,
CGI  ,
Cookie_Encoding   
)

Definition at line 94 of file ncbicgi.cpp.

References CCgiCookie::eCookieEnc_Quote, and CCgiCookie::eCookieEnc_Url.

◆ NCBI_PARAM_ENUM_ARRAY() [2/3]

NCBI_PARAM_ENUM_ARRAY ( CCgiCookies::EOnBadCookie  ,
CGI  ,
On_Bad_Cookie   
)

◆ NCBI_PARAM_ENUM_ARRAY() [3/3]

NCBI_PARAM_ENUM_ARRAY ( EDiagSev  ,
CGI  ,
Cookie_Error_Severity   
)

Definition at line 78 of file ncbicgi.cpp.

References eDiag_Critical, eDiag_Error, eDiag_Fatal, eDiag_Info, eDiag_Trace, and eDiag_Warning.

◆ NCBI_PARAM_ENUM_DECL() [1/2]

NCBI_PARAM_ENUM_DECL ( CCgiCookie::ECookieEncoding  ,
CGI  ,
Cookie_Encoding   
)

◆ NCBI_PARAM_ENUM_DECL() [2/2]

NCBI_PARAM_ENUM_DECL ( EDiagSev  ,
CGI  ,
Cookie_Error_Severity   
)

◆ NCBI_PARAM_ENUM_DEF_EX() [1/3]

NCBI_PARAM_ENUM_DEF_EX ( CCgiCookie::ECookieEncoding  ,
CGI  ,
Cookie_Encoding  ,
CCgiCookie::eCookieEnc_Url  ,
eParam_NoThread  ,
CGI_COOKIE_ENCODING   
)

◆ NCBI_PARAM_ENUM_DEF_EX() [2/3]

NCBI_PARAM_ENUM_DEF_EX ( CCgiCookies::EOnBadCookie  ,
CGI  ,
On_Bad_Cookie  ,
CCgiCookies::eOnBadCookie_Store  ,
eParam_NoThread  ,
CGI_ON_BAD_COOKIE   
)

◆ NCBI_PARAM_ENUM_DEF_EX() [3/3]

NCBI_PARAM_ENUM_DEF_EX ( EDiagSev  ,
CGI  ,
Cookie_Error_Severity  ,
eDiag_Error  ,
eParam_NoThread  ,
CGI_COOKIE_ERROR_SEVERITY   
)

◆ NCBI_PARAM_TYPE() [1/7]

typedef NCBI_PARAM_TYPE ( CGI  ,
cookie_auth_token   
)

◆ NCBI_PARAM_TYPE() [2/7]

typedef NCBI_PARAM_TYPE ( CGI  ,
Cookie_Encoding   
)

◆ NCBI_PARAM_TYPE() [3/7]

typedef NCBI_PARAM_TYPE ( CGI  ,
Cookie_Error_Severity   
)

◆ NCBI_PARAM_TYPE() [4/7]

typedef NCBI_PARAM_TYPE ( CGI  ,
Cookie_Name_Banned_Symbols   
)

◆ NCBI_PARAM_TYPE() [5/7]

typedef NCBI_PARAM_TYPE ( CGI  ,
LOG_EXCLUDE_ARGS   
)

◆ NCBI_PARAM_TYPE() [6/7]

typedef NCBI_PARAM_TYPE ( CGI  ,
LOG_LIMIT_ARGS   
)

◆ NCBI_PARAM_TYPE() [7/7]

typedef NCBI_PARAM_TYPE ( CGI  ,
On_Bad_Cookie   
)

◆ s_AddEntry()

static void s_AddEntry ( TCgiEntries entries,
const string name,
const string value,
unsigned int  position,
const string filename = kEmptyStr,
const string type = kEmptyStr 
)
static

Definition at line 961 of file ncbicgi.cpp.

References entries, and rapidjson::value.

Referenced by CCgiRequest::x_Init().

◆ s_CookieLess()

static bool s_CookieLess ( const string name1,
const string domain1,
const string path1,
const string name2,
const string domain2,
const string path2 
)
static

Definition at line 332 of file ncbicgi.cpp.

Referenced by CCgiCookies::Find(), and CCgiCookie::operator<().

◆ s_GetCookieNameBannedSymbols()

const char* s_GetCookieNameBannedSymbols ( void  )

Definition at line 492 of file ncbicgi.cpp.

References CSafeStatic< T, Callbacks >::Get().

Referenced by CCgiCookies::Add().

◆ s_Is_ISO_8859_1()

bool s_Is_ISO_8859_1 ( const string charset)
inline

Definition at line 1856 of file ncbicgi.cpp.

References NStr::CompareNocase(), and i.

Referenced by GetCharsetEncodingForm().

◆ s_Is_UTF_8()

bool s_Is_UTF_8 ( const string charset)
inline

Definition at line 1886 of file ncbicgi.cpp.

References NStr::CompareNocase().

Referenced by GetCharsetEncodingForm().

◆ s_Is_Windows_1252()

bool s_Is_Windows_1252 ( const string charset)
inline

Definition at line 1878 of file ncbicgi.cpp.

References NStr::CompareNocase().

Referenced by GetCharsetEncodingForm().

◆ s_IsZeroTime()

bool s_IsZeroTime ( const tm &  date)
inline

Definition at line 140 of file ncbicgi.cpp.

References kZeroTime, and true.

Referenced by CCgiCookie::GetExpDate().

◆ x_FirstWord()

static CTempString x_FirstWord ( const CTempStringEx forward)
static

Variable Documentation

◆ kTrackingVars

const char* kTrackingVars[]
static
Initial value:
=
{
"HTTP_CAF_PROXIED_HOST",
"HTTP_X_FORWARDED_FOR",
"PROXIED_IP",
"HTTP_X_FWD_IP_ADDR",
"HTTP_CLIENT_HOST",
"HTTP_X_REAL_IP",
"REMOTE_HOST",
"REMOTE_ADDR",
"NI_CLIENT_IPADDR",
}
#define NULL
Definition: ncbistd.hpp:225

Definition at line 841 of file ncbicgi.cpp.

Referenced by CTrackingEnvHolder::CTrackingEnvHolder().

◆ kZeroTime

const tm kZeroTime = { 0 }
static

Definition at line 138 of file ncbicgi.cpp.

Referenced by CCgiCookie::CCgiCookie(), CCgiCookie::Reset(), s_IsZeroTime(), and s_ZeroTime().

◆ s_PropName

const char* s_PropName[eCgi_NProperties+1]
static

Definition at line 916 of file ncbicgi.cpp.

Referenced by CCgiRequest::GetPropertyName().

Modified on Fri Sep 20 14:58:18 2024 by modify_doxy.py rev. 669887