NCBI C++ ToolKit
Classes | Typedefs | Enumerations | Enumerator | Functions | Variables | Friends
CGI Request/Response APIs
+ Collaboration diagram for CGI Request/Response APIs:

Classes

class  CCgiEntryReader
 
class  CCgiEntryReaderContext
 
class  CCgiCookie
 CCgiCookie:: More...
 
struct  CCgiCookie::PLessCPtr
 
class  CCgiCookies
 CCgiCookies:: More...
 
class  CCgiEntry
 
struct  CCgiEntry::SData
 
class  CEntryCollector_Base
 
class  CExtraEntryCollector
 
class  CCgiRequest
 CCgiRequest:: More...
 
class  CCgiResponse
 
class  CRefArgs
 CRefArgs:: More...
 

Typedefs

typedef CCgiEntryReaderContext CCgiEntryReader::TContext
 
typedef int CCgiEntryReader::TState
 
typedef CCgiEntryReader CCgiEntryReaderContext::TReader
 
typedef const CCgiCookieCCgiCookie::TCPtr
 Predicate for the cookie comparison. More...
 
typedef int CCgiCookie::TInvalidFlag
 
typedef set< CCgiCookie *, CCgiCookie::PLessCPtrCCgiCookies::TSet
 
typedef TSet::iterator CCgiCookies::TIter
 
typedef TSet::const_iterator CCgiCookies::TCIter
 
typedef pair< TIter, TIterCCgiCookies::TRange
 
typedef pair< TCIter, TCIterCCgiCookies::TCRange
 
typedef map< string, stringTCgiProperties
 
typedef multimap< string, CCgiEntry, PNocase_ConditionalTCgiEntries
 
typedef TCgiEntries::iterator TCgiEntriesI
 
typedef TCgiEntries::const_iterator TCgiEntriesCI
 
typedef list< stringTCgiIndexes
 
typedef int CCgiRequest::TFlags
 Startup initialization. More...
 
typedef map< string, string, PNocaseCCgiResponse::TMap
 
typedef multimap< string, stringCRefArgs::THostMap
 

Enumerations

enum  CCgiEntryReader::EState {
  CCgiEntryReader::fUnread = 0x1 , CCgiEntryReader::fHitCR = 0x2 , CCgiEntryReader::fHitLF = 0x4 , CCgiEntryReader::fHitCRLF = fHitCR | fHitLF ,
  CCgiEntryReader::fHitBoundary = 0x8
}
 
enum  CCgiEntryReaderContext::EContentType { CCgiEntryReaderContext::eCT_Null , CCgiEntryReaderContext::eCT_URLEncoded , CCgiEntryReaderContext::eCT_Multipart }
 
enum  CCgiEntryReaderContext::EReadTerminator { CCgiEntryReaderContext::eRT_Delimiter , CCgiEntryReaderContext::eRT_EOF , CCgiEntryReaderContext::eRT_LengthBound , CCgiEntryReaderContext::eRT_PartialDelimiter }
 
enum  CCgiCookie::EWriteMethod { CCgiCookie::eHTTPResponse , CCgiCookie::eHTTPRequest }
 Whether the cookie is sent as a part of HTTP request or HTTP response. More...
 
enum  CCgiCookie::EInvalidFlag { CCgiCookie::fValid = 0 , CCgiCookie::fInvalid_Name = 1<<0 , CCgiCookie::fInvalid_Value = 1<<1 , CCgiCookie::fInvalid_Any = fInvalid_Name | fInvalid_Value }
 
enum  CCgiCookie::EFieldType { CCgiCookie::eField_Name , CCgiCookie::eField_Value , CCgiCookie::eField_Other }
 
enum  CCgiCookie::ECookieEncoding { CCgiCookie::eCookieEnc_Url , CCgiCookie::eCookieEnc_Quote }
 
enum  CCgiCookies::EOnBadCookie {
  CCgiCookies::eOnBadCookie_ThrowException , CCgiCookies::eOnBadCookie_SkipAndError , CCgiCookies::eOnBadCookie_Skip , CCgiCookies::eOnBadCookie_StoreAndError ,
  CCgiCookies::eOnBadCookie_Store
}
 How to handle badly formed cookies. More...
 
enum  CCgiCookies::ECheckResult { CCgiCookies::eCheck_Valid , CCgiCookies::eCheck_SkipInvalid , CCgiCookies::eCheck_StoreInvalid }
 
enum  ECgiProp {
  eCgi_ServerSoftware = 0 , eCgi_ServerName , eCgi_GatewayInterface , eCgi_ServerProtocol ,
  eCgi_ServerPort , eCgi_RemoteHost , eCgi_RemoteAddr , eCgi_ContentType ,
  eCgi_ContentLength , eCgi_RequestMethod , eCgi_PathInfo , eCgi_PathTranslated ,
  eCgi_ScriptName , eCgi_QueryString , eCgi_AuthType , eCgi_RemoteUser ,
  eCgi_RemoteIdent , eCgi_HttpAccept , eCgi_HttpCookie , eCgi_HttpIfModifiedSince ,
  eCgi_HttpReferer , eCgi_HttpUserAgent , eCgi_NProperties
}
 Set of "standard" HTTP request properties. More...
 
enum  CCgiEntry::EOnCharsetError { CCgiEntry::eCharsetError_Ignore , CCgiEntry::eCharsetError_Throw }
 Action to perform if the explicit charset is not supported. More...
 
enum  CCgiRequest::Flags {
  CCgiRequest::fIndexesNotEntries = (1 << 0) , CCgiRequest::fIgnoreQueryString = (1 << 1) , CCgiRequest::fOwnEnvironment = (1 << 2) , CCgiRequest::fDoNotParseContent = (1 << 3) ,
  CCgiRequest::fCaseInsensitiveArgs = (1 << 4) , CCgiRequest::fCookies_Unencoded = (1 << 5) , CCgiRequest::fCookies_SpaceAsHex = (1 << 6) , CCgiRequest::fSaveRequestContent = (1 << 7) ,
  CCgiRequest::fIgnorePageHitId = (1 << 8) , CCgiRequest::fSkipDiagProperties = (1 << 9) , CCgiRequest::fSetDiagProperties = 0 , CCgiRequest::fParseInputOnDemand = (1 << 10) ,
  CCgiRequest::fSemicolonIsNotArgDelimiter = (1 << 11) , CCgiRequest::fDisableTrackingCookie = (1 << 12) , CCgiRequest::fIncludePreparsedEntries = (1 << 13) , CCgiRequest::fDisableParsingAsIndex = (1 << 14)
}
 
enum  CCgiRequest::ESessionCreateMode { CCgiRequest::eCreateIfNotExist , CCgiRequest::eDontCreateIfNotExist , CCgiRequest::eDontLoad }
 
enum  CCgiRequest::ERequestMethod {
  CCgiRequest::eMethod_GET , CCgiRequest::eMethod_POST , CCgiRequest::eMethod_HEAD , CCgiRequest::eMethod_PUT ,
  CCgiRequest::eMethod_DELETE , CCgiRequest::eMethod_OPTIONS , CCgiRequest::eMethod_TRACE , CCgiRequest::eMethod_CONNECT ,
  CCgiRequest::eMethod_Other
}
 Standard request methods. More...
 
enum  CCgiResponse::EMultipartMode { CCgiResponse::eMultipart_none , CCgiResponse::eMultipart_mixed , CCgiResponse::eMultipart_related , CCgiResponse::eMultipart_replace }
 

Functions

ERW_Result CCgiEntryReader::Read (void *buf, size_t count, size_t *bytes_read)
 Read as many as "count" bytes into a buffer pointed to by the "buf" argument. More...
 
ERW_Result CCgiEntryReader::PendingCount (size_t *count)
 Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking. More...
 
 CCgiEntryReader::CCgiEntryReader (TContext &context)
 
 CCgiEntryReader::~CCgiEntryReader ()
 
void CCgiEntryReader::x_FillBuffer (SIZE_TYPE count)
 
void CCgiEntryReader::x_Flush (void)
 
void CCgiEntryReader::x_HitBoundary (bool final)
 
 CCgiEntryReaderContext::CCgiEntryReaderContext (CNcbiIstream &in, TCgiEntries &out, const string &content_type, size_t content_length=CCgiRequest::kContentLengthUnknown, string *content_log=NULL)
 
 CCgiEntryReaderContext::~CCgiEntryReaderContext ()
 
TCgiEntriesI CCgiEntryReaderContext::GetNextEntry (void)
 
void CCgiEntryReaderContext::IncludePreparsedEntries (void)
 
void CCgiEntryReaderContext::x_FlushCurrentEntry (void)
 
EReadTerminator CCgiEntryReaderContext::x_DelimitedRead (string &s, SIZE_TYPE n=NPOS)
 
void CCgiEntryReaderContext::x_ReadURLEncodedEntry (string &name, string &value)
 
void CCgiEntryReaderContext::x_ReadMultipartHeaders (string &name, string &filename, string &content_type)
 
 CCgiCookie::CCgiCookie (const CCgiCookie &cookie)
 Copy constructor. More...
 
 CCgiCookie::CCgiCookie (const string &name, const string &value, const string &domain=NcbiEmptyString, const string &path=NcbiEmptyString)
 Throw the "invalid_argument" if "name" or "value" have invalid format. More...
 
const stringCCgiCookie::GetName (void) const
 The cookie name cannot be changed during its whole timelife. More...
 
CNcbiOstreamCCgiCookie::Write (CNcbiOstream &os, EWriteMethod wmethod=eHTTPResponse, EUrlEncode flag=eUrlEncode_SkipMarkChars) const
 Compose and write to output stream "os": More...
 
void CCgiCookie::Reset (void)
 Reset everything but name to default state like CCgiCookie(m_Name, "") More...
 
void CCgiCookie::CopyAttributes (const CCgiCookie &cookie)
 Set all attribute values(but name!) to those from "cookie". More...
 
void CCgiCookie::SetValue (const string &str)
 All SetXXX(const string&) methods beneath: More...
 
void CCgiCookie::SetDomain (const string &str)
 
void CCgiCookie::SetPath (const string &str)
 
void CCgiCookie::SetExpDate (const tm &exp_date)
 
void CCgiCookie::SetExpTime (const CTime &exp_time)
 
void CCgiCookie::SetSecure (bool secure)
 
void CCgiCookie::SetHttpOnly (bool http_only)
 
const stringCCgiCookie::GetValue (void) const
 All "const string& GetXXX(...)" methods beneath return reference to "NcbiEmptyString" if the requested attributre is not set. More...
 
const stringCCgiCookie::GetDomain (void) const
 
const stringCCgiCookie::GetPath (void) const
 
string CCgiCookie::GetExpDate (void) const
 Day, dd-Mon-yyyy hh:mm:ss GMT (return empty string if not set) More...
 
bool CCgiCookie::GetExpDate (tm *exp_date) const
 If exp.date is not set then return FALSE and dont assign "*exp_date". More...
 
bool CCgiCookie::GetSecure (void) const
 
bool CCgiCookie::GetHttpOnly (void) const
 
bool CCgiCookie::operator< (const CCgiCookie &cookie) const
 Compare two cookies. More...
 
bool CCgiCookie::PLessCPtr::operator() (const TCPtr &c1, const TCPtr &c2) const
 
TInvalidFlag CCgiCookie::IsInvalid (void) const
 
void CCgiCookie::SetInvalid (TInvalidFlag flag)
 
void CCgiCookie::ResetInvalid (TInvalidFlag flag)
 
static void CCgiCookie::x_CheckField (const string &str, EFieldType ftype, const char *banned_symbols, const string *cookie_name=NULL)
 
static string CCgiCookie::x_EncodeCookie (const string &str, EFieldType ftype, NStr::EUrlEncode flag)
 
static bool CCgiCookie::x_GetString (string *str, const string &val)
 
CCgiCookieCCgiCookie::operator= (const CCgiCookie &)
 
CNcbiOstreamoperator<< (CNcbiOstream &os, const CCgiCookie &cookie)
 
 CCgiCookies::CCgiCookies (void)
 Empty set of cookies. More...
 
 CCgiCookies::CCgiCookies (EUrlEncode encode_flag)
 Use the specified method of string encoding. More...
 
 CCgiCookies::CCgiCookies (const string &str, EOnBadCookie on_bad_cookie=eOnBadCookie_SkipAndError, EUrlEncode encode_flag=eUrlEncode_SkipMarkChars)
 Format of the string: "name1=value1; name2=value2; ...". More...
 
 CCgiCookies::~CCgiCookies (void)
 Destructor. More...
 
bool CCgiCookies::Empty (void) const
 Return TRUE if this set contains no cookies. More...
 
EUrlEncode CCgiCookies::GetUrlEncodeFlag (void) const
 
void CCgiCookies::SetUrlEncodeFlag (EUrlEncode encode_flag)
 
CCgiCookieCCgiCookies::Add (const string &name, const string &value, const string &domain=kEmptyStr, const string &path=kEmptyStr, EOnBadCookie on_bad_cookie=eOnBadCookie_SkipAndError)
 All Add() functions: if the added cookie has the same {name, domain, path} as an already existing one then the new cookie will override the old one. More...
 
CCgiCookieCCgiCookies::Add (const string &name, const string &value, EOnBadCookie on_bad_cookie)
 
CCgiCookieCCgiCookies::Add (const CCgiCookie &cookie)
 Update with a copy of "cookie". More...
 
void CCgiCookies::Add (const CCgiCookies &cookies)
 Update by a set of cookies. More...
 
void CCgiCookies::Add (const string &str, EOnBadCookie on_bad_cookie=eOnBadCookie_SkipAndError)
 Update with a HTTP request like string: "name1=value1; name2=value2; ...". More...
 
CCgiCookieCCgiCookies::Find (const string &name, const string &domain, const string &path)
 Return NULL if cannot find this exact cookie. More...
 
const CCgiCookieCCgiCookies::Find (const string &name, const string &domain, const string &path) const
 
CCgiCookieCCgiCookies::Find (const string &name, TRange *range=0)
 Return the first matched cookie with name "name", or NULL if there is no such cookie(s). More...
 
const CCgiCookieCCgiCookies::Find (const string &name, TCRange *range=0) const
 
TCRange CCgiCookies::GetAll (void) const
 Return the full range [begin():end()] on the underlying container. More...
 
bool CCgiCookies::Remove (CCgiCookie *cookie, bool destroy=true)
 Remove "cookie" from this set; deallocate it if "destroy" is true Return FALSE if can not find "cookie" in this set. More...
 
size_t CCgiCookies::Remove (TRange &range, bool destroy=true)
 Remove (and destroy if "destroy" is true) all cookies belonging to range "range". More...
 
size_t CCgiCookies::Remove (const string &name, bool destroy=true)
 Remove (and destroy if "destroy" is true) all cookies with the given "name". More...
 
void CCgiCookies::Clear (void)
 Remove all stored cookies. More...
 
CNcbiOstreamCCgiCookies::Write (CNcbiOstream &os, CCgiCookie::EWriteMethod wmethod=CCgiCookie::eHTTPResponse) const
 Printout all cookies into the stream "os". More...
 
void CCgiCookies::SetSecure (bool secure)
 Set secure connection flag. More...
 
void CCgiCookies::SetAllCookiesSecure (bool value)
 Mark all cookies as secure. More...
 
bool CCgiCookies::GetAllCookiesSecure (void) const
 
void CCgiCookies::SetAllCookiesHttpOnly (bool value)
 Mark all cookies as HTTP_ONLY. More...
 
bool CCgiCookies::GetAllCookiesHttpOnly (void) const
 
static ECheckResult CCgiCookies::x_CheckField (const string &str, CCgiCookie::EFieldType ftype, const char *banned_symbols, EOnBadCookie on_bad_cookie, const string *cookie_name=NULL)
 
 CCgiCookies::CCgiCookies (const CCgiCookies &)
 prohibit default initialization and assignment More...
 
CCgiCookiesCCgiCookies::operator= (const CCgiCookies &)
 
CNcbiOstreamoperator<< (CNcbiOstream &os, const CCgiCookies &cookies)
 
 CCgiEntry::SData::SData (const string &value, const string &filename, unsigned int position, const string &type)
 
 CCgiEntry::SData::SData (const SData &data)
 
 CCgiEntry::CCgiEntry (const string &value=kEmptyStr, const string &filename=kEmptyStr, unsigned int position=0, const string &type=kEmptyStr)
 
 CCgiEntry::CCgiEntry (const char *value, const string &filename=kEmptyStr, unsigned int position=0, const string &type=kEmptyStr)
 
 CCgiEntry::CCgiEntry (const CCgiEntry &e)
 
CCgiEntryCCgiEntry::operator= (const CCgiEntry &e)
 
const stringCCgiEntry::GetValue () const
 Get the value as a string, (necessarily) prefetching it all if applicable; the result remains available for future calls to GetValue and relatives. More...
 
stringCCgiEntry::SetValue ()
 
void CCgiEntry::SetValue (const string &v)
 
void CCgiEntry::SetValue (IReader *r)
 
void CCgiEntry::SetValue (CNcbiIstream &is, EOwnership own=eNoOwnership)
 
IReaderCCgiEntry::GetValueReader ()
 Get the value via a reader, potentially on the fly – in which case the caller takes ownership of the source, and subsequent calls to GetValue and relatives will yield NO data. More...
 
CNcbiIstreamCCgiEntry::GetValueStream ()
 Get the value as a stream, potentially on the fly – in which case the caller takes ownership of the source, and subsequent calls to GetValue and relatives will yield NO data. More...
 
CStringUTF8 CCgiEntry::GetValueAsUTF8 (EOnCharsetError on_error=eCharsetError_Ignore) const
 
const stringCCgiEntry::GetFilename () const
 Only available for certain fields of POSTed forms. More...
 
stringCCgiEntry::SetFilename ()
 
void CCgiEntry::SetFilename (const string &f)
 
unsigned int CCgiEntry::GetPosition () const
 CGI parameter number – automatic image name parameter is #0, explicit parameters start at #1. More...
 
unsigned intCCgiEntry::SetPosition ()
 
void CCgiEntry::SetPosition (int p)
 
const stringCCgiEntry::GetContentType () const
 May be available for some fields of POSTed forms. More...
 
stringCCgiEntry::SetContentType ()
 
void CCgiEntry::SetContentType (const string &f)
 
 CCgiEntry::operator const string & () const
 
 CCgiEntry::operator string & ()
 
 CCgiEntry::operator const CTempStringEx () const
 
SIZE_TYPE CCgiEntry::size () const
 commonly-requested string:: operations... More...
 
bool CCgiEntry::empty () const
 
const char * CCgiEntry::c_str () const
 
int CCgiEntry::compare (const string &s) const
 
int CCgiEntry::compare (const char *s) const
 
string CCgiEntry::substr (SIZE_TYPE i=0, SIZE_TYPE n=NPOS) const
 
SIZE_TYPE CCgiEntry::find (const char *s, SIZE_TYPE pos=0) const
 
SIZE_TYPE CCgiEntry::find (const string &s, SIZE_TYPE pos=0) const
 
SIZE_TYPE CCgiEntry::find (char c, SIZE_TYPE pos=0) const
 
SIZE_TYPE CCgiEntry::find_first_of (const string &s, SIZE_TYPE pos=0) const
 
SIZE_TYPE CCgiEntry::find_first_of (const char *s, SIZE_TYPE pos=0) const
 
bool CCgiEntry::operator== (const CCgiEntry &e2) const
 
bool CCgiEntry::operator!= (const CCgiEntry &v) const
 
bool CCgiEntry::operator== (const string &v) const
 
bool CCgiEntry::operator!= (const string &v) const
 
bool CCgiEntry::operator== (const char *v) const
 
bool CCgiEntry::operator!= (const char *v) const
 
void CCgiEntry::x_ForceUnique ()
 
void CCgiEntry::x_ForceComplete () const
 
string CCgiEntry::x_GetCharset (void) const
 
string operator+ (const CCgiEntry &e, const string &s)
 
string operator+ (const string &s, const CCgiEntry &e)
 
CNcbiOstreamoperator<< (CNcbiOstream &o, const CCgiEntry &e)
 
virtual CEntryCollector_Base::~CEntryCollector_Base (void)
 
virtual void CEntryCollector_Base::AddEntry (const string &name, const string &value, const string &filename, bool is_index=false)=0
 
 CExtraEntryCollector::CExtraEntryCollector (void)
 
 CExtraEntryCollector::~CExtraEntryCollector (void) override
 
void CExtraEntryCollector::AddEntry (const string &name, const string &value, const string &filename, bool is_index) override
 
CDiagContext_Extra::TExtraArgsCExtraEntryCollector::GetArgs (void)
 
 CCgiRequest::CCgiRequest (const CNcbiArguments *args=0, const CNcbiEnvironment *env=0, CNcbiIstream *istr=0, TFlags flags=0, int ifd=-1, size_t errbuf_size=256)
 
 CCgiRequest::CCgiRequest (int argc, const char *const *argv, const char *const *envp=0, CNcbiIstream *istr=0, TFlags flags=0, int ifd=-1, size_t errbuf_size=256)
 args := CNcbiArguments(argc,argv), env := CNcbiEnvironment(envp) More...
 
 CCgiRequest::CCgiRequest (CNcbiIstream &is, TFlags flags=0, size_t errbuf_size=256)
 
 CCgiRequest::~CCgiRequest (void)
 Destructor. More...
 
static const string CCgiRequest::GetPropertyName (ECgiProp prop)
 Get name (not value!) of a "standard" property. More...
 
const stringCCgiRequest::GetProperty (ECgiProp prop) const
 Get value of a "standard" property (return empty string if not defined) More...
 
const stringCCgiRequest::GetRandomProperty (const string &key, bool http=true) const
 Get value of a random client property; if "http" is TRUE then add prefix "HTTP_" to the property name. More...
 
size_t CCgiRequest::GetContentLength (void) const
 
const stringCCgiRequest::GetContent (void) const
 Get request content. More...
 
const CCgiCookiesCCgiRequest::GetCookies (void) const
 Retrieve the request cookies. More...
 
CCgiCookiesCCgiRequest::GetCookies (void)
 
const TCgiEntriesCCgiRequest::GetEntries (void) const
 Get a set of entries(decoded) received from the client. More...
 
TCgiEntriesCCgiRequest::GetEntries (void)
 
const CCgiEntryCCgiRequest::GetEntry (const string &name, bool *is_found=0) const
 Get entry value by name. More...
 
TCgiEntriesI CCgiRequest::GetNextEntry (void)
 Get next entry when parsing input on demand. More...
 
CCgiEntryCCgiRequest::GetPossiblyUnparsedEntry (const string &name)
 Get entry value by name, calling GetNextEntry() as needed. More...
 
void CCgiRequest::ParseRemainingContent (void)
 Parse any remaining POST content for use by GetEntries() et al. More...
 
const TCgiIndexesCCgiRequest::GetIndexes (void) const
 Get a set of indexes(decoded) received from the client. More...
 
TCgiIndexesCCgiRequest::GetIndexes (void)
 
CCgiSessionCCgiRequest::GetSession (ESessionCreateMode mode=eCreateIfNotExist) const
 Get session. More...
 
CNcbiIstreamCCgiRequest::GetInputStream (void) const
 Return pointer to the input stream. More...
 
int CCgiRequest::GetInputFD (void) const
 Returns file descriptor of input stream, or -1 if unavailable. More...
 
void CCgiRequest::SetInputStream (CNcbiIstream *is, bool own=false, int fd=-1)
 Set input stream to "is". More...
 
static SIZE_TYPE CCgiRequest::ParseEntries (const string &str, TCgiEntries &entries)
 Decode the URL-encoded(FORM or ISINDEX) string "str" into a set of entries <"name", "value"> and add them to the "entries" set. More...
 
static SIZE_TYPE CCgiRequest::ParseIndexes (const string &str, TCgiIndexes &indexes)
 Decode the URL-encoded string "str" into a set of ISINDEX-like entries and add them to the "indexes" set. More...
 
const char *constCCgiRequest::GetClientTrackingEnv (void) const
 Return client tracking environment variables These variables are stored in the form "name=value". More...
 
void CCgiRequest::Serialize (CNcbiOstream &os) const
 Serialize/Deserialize a request to/from a stream. More...
 
void CCgiRequest::Deserialize (CNcbiIstream &is, TFlags flags=0)
 
const CNcbiEnvironmentCCgiRequest::GetEnvironment () const
 
void CCgiRequest::GetCGIEntries (CEntryCollector_Base &collector) const
 Get full set of arguments (both GET and POST), URL-encoded. More...
 
string CCgiRequest::GetCGIEntriesStr (void) const
 Shortcut for collecting arguments into a URL-style string. More...
 
bool CCgiRequest::CalcChecksum (string &checksum, string &content) const
 
const stringCCgiRequest::GetRequestMethodName (void) const
 Get request method name. More...
 
ERequestMethod CCgiRequest::GetRequestMethod (void) const
 Get request method. More...
 
void CCgiRequest::SetTrackingCookie (const string &cookie_value)
 Store/retrieve tracking cookie value. More...
 
const stringCCgiRequest::GetTrackingCookie (void) const
 
void CCgiRequest::x_Init (const CNcbiArguments *args, const CNcbiEnvironment *env, CNcbiIstream *istr, TFlags flags, int ifd)
 the real constructor code More...
 
const stringCCgiRequest::x_GetPropertyByName (const string &name) const
 retrieve(and cache) a property of given name More...
 
void CCgiRequest::x_ProcessQueryString (TFlags flags, const CNcbiArguments *args)
 Parse entries or indexes from "$QUERY_STRING" or cmd.-line args. More...
 
void CCgiRequest::x_ProcessInputStream (TFlags flags, CNcbiIstream *istr, int ifd)
 Parse input stream if needed. More...
 
void CCgiRequest::x_SetClientIpProperty (TFlags flags) const
 Set client-ip property for logging. More...
 
void CCgiRequest::x_InitRequestContext (TFlags flags)
 Set the properties of CRequestContext (HitId, Dtab etc.). More...
 
 CCgiRequest::CCgiRequest (const CCgiRequest &)
 prohibit default initialization and assignment More...
 
CCgiRequestCCgiRequest::operator= (const CCgiRequest &)
 
string CCgiRequest::x_RetrieveSessionId () const
 
void CCgiRequest::x_SetSession (CCgiSession &session)
 
 CCgiResponse::CCgiResponse (CNcbiOstream *os=NULL, int ofd=-1)
 
 CCgiResponse::~CCgiResponse (void)
 
void CCgiResponse::SetRawCgi (bool is_raw)
 
bool CCgiResponse::IsRawCgi (void) const
 
void CCgiResponse::SetStatus (unsigned int code, const string &reason=kEmptyStr)
 
void CCgiResponse::SetHeaderValue (const string &name, const string &value)
 
void CCgiResponse::SetHeaderValue (const string &name, const struct tm &value)
 
void CCgiResponse::SetHeaderValue (const string &name, const CTime &value)
 
void CCgiResponse::RemoveHeaderValue (const string &name)
 
string CCgiResponse::GetHeaderValue (const string &name) const
 
bool CCgiResponse::HaveHeaderValue (const string &name) const
 
void CCgiResponse::SetContentType (const string &type)
 Set content type (text/html by default if not provided) More...
 
string CCgiResponse::GetContentType (void) const
 Get content type. More...
 
void CCgiResponse::SetFilename (const string &name, size_t size=0)
 
void CCgiResponse::SetLocation (const CUrl &url, const IUrlEncoder *encoder=0)
 Set the "Location:" HTTP header. More...
 
void CCgiResponse::SetMultipartMode (EMultipartMode mode=eMultipart_mixed)
 
EMultipartMode CCgiResponse::GetMultipartMode (void)
 
void CCgiResponse::BeginPart (const string &name, const string &type, size_t size=0)
 
void CCgiResponse::EndPart (void)
 
void CCgiResponse::EndLastPart (void)
 
void CCgiResponse::BeginPart (const string &name, const string &type, CNcbiOstream &os, size_t size=0)
 
void CCgiResponse::EndPart (CNcbiOstream &os)
 
void CCgiResponse::EndLastPart (CNcbiOstream &os)
 
const CCgiCookiesCCgiResponse::Cookies (void) const
 
CCgiCookiesCCgiResponse::Cookies (void)
 
void CCgiResponse::SetOutput (CNcbiOstream *os, int fd=-1)
 Set output stream (NULL here means "no output stream"). More...
 
CNcbiOstreamCCgiResponse::GetOutput (void) const
 Get output stream (NULL here means "no output stream"). More...
 
int CCgiResponse::GetOutputFD (void) const
 Get file descriptor of the output stream (-1 if not applicable) More...
 
CNcbiOstreamCCgiResponse::out (void) const
 Get output stream. Throw exception if GetOutput() is NULL. More...
 
void CCgiResponse::Flush (void) const
 Flush output stream. More...
 
CNcbiOstreamCCgiResponse::WriteHeader (void) const
 Write HTTP response header to the output stream. More...
 
CNcbiOstreamCCgiResponse::WriteHeader (CNcbiOstream &os) const
 
bool CCgiResponse::IsHeaderWritten () const
 
void CCgiResponse::RequireWriteHeader (bool require)
 Define if WriteHeader() must be called or can be skipped. More...
 
void CCgiResponse::SetTrackingCookie (const string &name, const string &value, const string &domain, const string &path, const CTime &exp_time=CTime())
 
void CCgiResponse::DisableTrackingCookie (void)
 
void CCgiResponse::SetThrowOnBadOutput (bool throw_on_bad_output)
 If set to TRUE then the writes to a "bad" output stream will throw exceptions of type std::ios_base::failure. More...
 
void CCgiResponse::SetExceptionAfterHEAD (bool expt_after_head)
 
bool CCgiResponse::AcceptRangesBytes (void) const
 Check if 'Accept-Ranges' header is set to 'bytes'. More...
 
bool CCgiResponse::HaveContentRange (void) const
 Check if 'Content-Range' header is set. More...
 
void CCgiResponse::InitCORSHeaders (const string &origin, const string &jquery_callback=kEmptyStr)
 This method is called automatically by CCgiContext. More...
 
void CCgiResponse::SetRequestMethod (CCgiRequest::ERequestMethod method)
 Set HTTP request method. More...
 
void CCgiResponse::Finalize (void) const
 Called by the CGI framework after a ProcessRequest(), unless the latter threw an exception. More...
 
void CCgiResponse::SetRetryContext (const CRetryContext &ctx)
 Set retry headers from the context. More...
 
void CCgiResponse::SetCgiRequest (const CCgiRequest &request)
 
bool CCgiResponse::GetChunkedTransferEnabled (void) const
 Check/change chunked transfer encoding status. More...
 
void CCgiResponse::SetChunkedTransferEnabled (bool value)
 
static size_t CCgiResponse::GetChunkSize (void)
 
void CCgiResponse::FinishChunkedTransfer (void)
 Finish chunked transfer, append zero chunk and trailers, if any. More...
 
void CCgiResponse::AbortChunkedTransfer (void)
 Abort chunked transfer, block any writes to the output stream. More...
 
bool CCgiResponse::CanSendTrailer (void) const
 Check if trailer can be sent: chunked transfer must be enabled and the request's TE header must include 'trailers'. More...
 
void CCgiResponse::AddTrailer (const string &name)
 Prepare to send trailer. More...
 
void CCgiResponse::RemoveTrailer (const string &name)
 Remove trailer. Must be called before WriteHeader(). More...
 
bool CCgiResponse::HaveTrailer (const string &name) const
 Check if trailer has been added and its value can be set. More...
 
string CCgiResponse::GetTrailerValue (const string &name) const
 Get current trailer value. More...
 
void CCgiResponse::SetTrailerValue (const string &name, const string &value)
 Set trailer value. More...
 
void CCgiResponse::x_SetSession (const CCgiSession &session)
 
 CCgiResponse::CCgiResponse (const CCgiResponse &)
 
CCgiResponseCCgiResponse::operator= (const CCgiResponse &)
 
void CCgiResponse::x_RestoreOutputExceptions (void)
 
bool CCgiResponse::x_ValidateHeader (const string &name, const string &value) const
 
static bool CCgiResponse::x_ClientSupportsChunkedTransfer (const CNcbiEnvironment &env)
 
 CCgiResponse::NCBI_PARAM_DECL (bool, CGI, ThrowOnBadOutput)
 
typedef CCgiResponse::NCBI_PARAM_TYPE (CGI, ThrowOnBadOutput) TCGI_ThrowOnBadOutput
 
 CCgiResponse::NCBI_PARAM_DECL (bool, CGI, ExceptionAfterHEAD)
 
typedef CCgiResponse::NCBI_PARAM_TYPE (CGI, ExceptionAfterHEAD) TCGI_ExceptionAfterHEAD
 
 CRefArgs::CRefArgs (const string &definitions=kEmptyStr)
 Create referrer parser from a set of definitions. More...
 
 CRefArgs::~CRefArgs (void)
 
void CRefArgs::AddDefinitions (const string &definitions)
 Add mappings between host mask and CGI argument name for query string. More...
 
void CRefArgs::AddDefinitions (const string &host_mask, const string &arg_names)
 
string CRefArgs::GetQueryString (const string &referrer) const
 Find query string in the referrer. More...
 
static string CRefArgs::GetDefaultDefinitions (void)
 Get default set of search engine definitions. More...
 
bool CRefArgs::IsListedHost (const string &referrer) const
 Check if the host from the referrer string is listed in definitions. More...
 

Variables

TContextCCgiEntryReader::m_Context
 
string CCgiEntryReader::m_Buffer
 
TState CCgiEntryReader::m_State
 
CNcbiIstreamCCgiEntryReaderContext::m_In
 
TCgiEntriesCCgiEntryReaderContext::m_Out
 
TCgiEntriesI CCgiEntryReaderContext::m_OutIter
 
bool CCgiEntryReaderContext::m_OutIterated
 
EContentType CCgiEntryReaderContext::m_ContentType
 
bool CCgiEntryReaderContext::m_ContentTypeDeclared
 
size_t CCgiEntryReaderContext::m_ContentLength
 
string CCgiEntryReaderContext::m_Boundary
 
stringCCgiEntryReaderContext::m_ContentLog
 
unsigned int CCgiEntryReaderContext::m_Position
 
SIZE_TYPE CCgiEntryReaderContext::m_BytePos
 
CCgiEntryCCgiEntryReaderContext::m_CurrentEntry
 
TReaderCCgiEntryReaderContext::m_CurrentReader
 
string CCgiCookie::m_Name
 
string CCgiCookie::m_Value
 
string CCgiCookie::m_Domain
 
string CCgiCookie::m_Path
 
tm CCgiCookie::m_Expires
 
bool CCgiCookie::m_Secure
 
bool CCgiCookie::m_HttpOnly
 
TInvalidFlag CCgiCookie::m_InvalidFlag
 
NStr::EUrlEncode CCgiCookies::m_EncodeFlag
 
TSet CCgiCookies::m_Cookies
 
bool CCgiCookies::m_Secure
 
bool CCgiCookies::m_AllSecure
 
bool CCgiCookies::m_AllHttpOnly
 
 NCBI_XCGI_EXPORT
 Parameter to control error handling of incoming cookies. More...
 
 CGI
 
 On_Bad_Cookie
 
string CCgiEntry::SData::m_Value
 
string CCgiEntry::SData::m_Filename
 
string CCgiEntry::SData::m_ContentType
 
unsigned int CCgiEntry::SData::m_Position
 
unique_ptr< IReaderCCgiEntry::SData::m_Reader
 
CRef< SDataCCgiEntry::m_Data
 
CDiagContext_Extra::TExtraArgs CExtraEntryCollector::m_Args
 
static const size_t CCgiRequest::kContentLengthUnknown = (size_t)(-1)
 Get content length using value of the property 'eCgi_ContentLength'. More...
 
const CNcbiEnvironmentCCgiRequest::m_Env
 set of environment variables More...
 
unique_ptr< CNcbiEnvironmentCCgiRequest::m_OwnEnv
 
unique_ptr< stringCCgiRequest::m_Content
 Original request content or NULL if fSaveRequestContent is not set. More...
 
TCgiEntries CCgiRequest::m_Entries
 set of the request FORM-like entries(already retrieved; cached) More...
 
TCgiIndexes CCgiRequest::m_Indexes
 set of the request ISINDEX-like indexes(already retrieved; cached) More...
 
CCgiCookies CCgiRequest::m_Cookies
 set of the request cookies(already retrieved; cached) More...
 
CNcbiIstreamCCgiRequest::m_Input
 input stream More...
 
int CCgiRequest::m_InputFD
 input file descriptor, if available. More...
 
bool CCgiRequest::m_OwnInput
 
size_t CCgiRequest::m_ErrBufSize
 Request initialization error buffer size; when initialization code hits unexpected EOF it will try to add diagnostics and print out accumulated request buffer 0 in this variable means no buffer diagnostics. More...
 
string CCgiRequest::m_TrackingCookie
 
bool CCgiRequest::m_QueryStringParsed
 
unique_ptr< CTrackingEnvHolderCCgiRequest::m_TrackingEnvHolder
 
CCgiSessionCCgiRequest::m_Session
 
CCgiEntryReaderContextCCgiRequest::m_EntryReaderContext
 
static const char * CCgiResponse::sm_ContentTypeName = "Content-Type"
 
static const char * CCgiResponse::sm_LocationName = "Location"
 
static const char * CCgiResponse::sm_ContentTypeDefault = "text/html"
 
static const char * CCgiResponse::sm_ContentTypeMixed = "multipart/mixed"
 
static const char * CCgiResponse::sm_ContentTypeRelated = "multipart/related"
 
static const char * CCgiResponse::sm_ContentTypeXMR = "multipart/x-mixed-replace"
 
static const char * CCgiResponse::sm_ContentDispoName = "Content-Disposition"
 
static const char * CCgiResponse::sm_FilenamePrefix = "attachment; filename=\""
 
static const char * CCgiResponse::sm_HTTPStatusName = "Status"
 
static const char * CCgiResponse::sm_HTTPStatusDefault = "200 OK"
 
static const char * CCgiResponse::sm_BoundaryPrefix = "NCBI_CGI_Boundary_"
 
static const char * CCgiResponse::sm_CacheControl = "Cache-Control"
 
static const char * CCgiResponse::sm_AcceptRanges = "Accept-Ranges"
 
static const char * CCgiResponse::sm_AcceptRangesBytes = "bytes"
 
static const char * CCgiResponse::sm_ContentRange = "Content-Range"
 
bool CCgiResponse::m_IsRawCgi
 
EMultipartMode CCgiResponse::m_IsMultipart
 
bool CCgiResponse::m_BetweenParts
 
string CCgiResponse::m_Boundary
 
TMap CCgiResponse::m_HeaderValues
 
TMap CCgiResponse::m_TrailerValues
 
CCgiCookies CCgiResponse::m_Cookies
 
CNcbiOstreamCCgiResponse::m_Output
 
int CCgiResponse::m_OutputFD
 
bool CCgiResponse::m_HeaderWritten
 
bool CCgiResponse::m_RequireWriteHeader
 
CNcbiOstream::iostate CCgiResponse::m_OutputExpt
 
CCgiRequest::ERequestMethod CCgiResponse::m_RequestMethod
 
const CCgiSessionCCgiResponse::m_Session
 
unique_ptr< CCgiCookieCCgiResponse::m_TrackingCookie
 
bool CCgiResponse::m_DisableTrackingCookie
 
TCGI_ThrowOnBadOutput CCgiResponse::m_ThrowOnBadOutput
 
TCGI_ExceptionAfterHEAD CCgiResponse::m_ExceptionAfterHEAD
 
const CCgiRequestCCgiResponse::m_Request
 
bool CCgiResponse::m_ChunkedTransfer
 
unique_ptr< boolCCgiResponse::m_TrailerEnabled
 
string CCgiResponse::m_JQuery_Callback
 
THostMap CRefArgs::m_HostMap
 

Friends

class CCgiEntryReader::CCgiEntryReaderContext
 
class CCgiEntryReaderContext::CCgiEntryReader
 
class CCgiCookie::CCgiCookies
 
class CCgiResponse::CCgiContext
 
class CCgiResponse::CCgiApplication
 

Detailed Description

Typedef Documentation

◆ TCgiEntries

Definition at line 638 of file ncbicgi.hpp.

◆ TCgiEntriesCI

Definition at line 640 of file ncbicgi.hpp.

◆ TCgiEntriesI

Definition at line 639 of file ncbicgi.hpp.

◆ TCgiIndexes

typedef list<string> TCgiIndexes

Definition at line 641 of file ncbicgi.hpp.

◆ TCgiProperties

Definition at line 637 of file ncbicgi.hpp.

◆ TCIter

Definition at line 223 of file ncbicgi.hpp.

◆ TContext

Definition at line 52 of file cgi_entry_reader.hpp.

◆ TCPtr

Predicate for the cookie comparison.

Definition at line 136 of file ncbicgi.hpp.

◆ TCRange

Definition at line 225 of file ncbicgi.hpp.

◆ TFlags

Startup initialization.

  • retrieve request's properties and cookies from environment;
  • retrieve request's entries from "$QUERY_STRING".

If "$REQUEST_METHOD" == "POST" and "$CONTENT_TYPE" is empty or either "application/x-www-form-urlencoded" or "multipart/form-data", and "fDoNotParseContent" flag is not set, then retrieve and parse entries from the input stream "istr". If "$CONTENT_TYPE" is empty, the contents is not stripped from the stream but remains available (pushed back) whether or not the form parsing was successful.

If "$REQUEST_METHOD" is undefined then try to retrieve the request's entries from the 1st cmd.-line argument, and do not use "$QUERY_STRING" and "istr" at all.

Definition at line 703 of file ncbicgi.hpp.

◆ THostMap

Definition at line 86 of file ref_args.hpp.

◆ TInvalidFlag

Definition at line 149 of file ncbicgi.hpp.

◆ TIter

Definition at line 222 of file ncbicgi.hpp.

◆ TMap

typedef map<string, string, PNocase> CCgiResponse::TMap
protected

Definition at line 267 of file ncbicgir.hpp.

◆ TRange

Definition at line 224 of file ncbicgi.hpp.

◆ TReader

Definition at line 99 of file cgi_entry_reader.hpp.

◆ TSet

Definition at line 221 of file ncbicgi.hpp.

◆ TState

typedef int CCgiEntryReader::TState
private

Definition at line 65 of file cgi_entry_reader.hpp.

Enumeration Type Documentation

◆ ECgiProp

enum ECgiProp

Set of "standard" HTTP request properties.

See also
CCgiRequest
Enumerator
eCgi_ServerSoftware 
eCgi_ServerName 
eCgi_GatewayInterface 
eCgi_ServerProtocol 
eCgi_ServerPort 
eCgi_RemoteHost 
eCgi_RemoteAddr 
eCgi_ContentType 
eCgi_ContentLength 
eCgi_RequestMethod 
eCgi_PathInfo 
eCgi_PathTranslated 
eCgi_ScriptName 
eCgi_QueryString 
eCgi_AuthType 
eCgi_RemoteUser 
eCgi_RemoteIdent 
eCgi_HttpAccept 
eCgi_HttpCookie 
eCgi_HttpIfModifiedSince 
eCgi_HttpReferer 
eCgi_HttpUserAgent 
eCgi_NProperties 

Definition at line 378 of file ncbicgi.hpp.

◆ ECheckResult

Enumerator
eCheck_Valid 
eCheck_SkipInvalid 
eCheck_StoreInvalid 

Definition at line 331 of file ncbicgi.hpp.

◆ EContentType

Enumerator
eCT_Null 
eCT_URLEncoded 
eCT_Multipart 

Definition at line 100 of file cgi_entry_reader.hpp.

◆ ECookieEncoding

Enumerator
eCookieEnc_Url 
eCookieEnc_Quote 

Definition at line 185 of file ncbicgi.hpp.

◆ EFieldType

enum CCgiCookie::EFieldType
private
Enumerator
eField_Name 
eField_Value 
eField_Other 

Definition at line 165 of file ncbicgi.hpp.

◆ EInvalidFlag

Enumerator
fValid 
fInvalid_Name 
fInvalid_Value 
fInvalid_Any 

Definition at line 143 of file ncbicgi.hpp.

◆ EMultipartMode

Enumerator
eMultipart_none 
eMultipart_mixed 
eMultipart_related 
eMultipart_replace 

Definition at line 98 of file ncbicgir.hpp.

◆ EOnBadCookie

How to handle badly formed cookies.

Enumerator
eOnBadCookie_ThrowException 

Throw exception, ignore bad cookie.

eOnBadCookie_SkipAndError 

Report error, ignore bad cookie.

eOnBadCookie_Skip 

Silently ignore bad cookie.

eOnBadCookie_StoreAndError 

Report error, store bad cookie as-is.

eOnBadCookie_Store 

Store bad cookie without URL-decoding.

Definition at line 228 of file ncbicgi.hpp.

◆ EOnCharsetError

Action to perform if the explicit charset is not supported.

Enumerator
eCharsetError_Ignore 

Ignore unknown charset (try to autodetect)

eCharsetError_Throw 

Throw exception if charset is not supported.

Definition at line 499 of file ncbicgi.hpp.

◆ EReadTerminator

Enumerator
eRT_Delimiter 
eRT_EOF 
eRT_LengthBound 
eRT_PartialDelimiter 

Definition at line 105 of file cgi_entry_reader.hpp.

◆ ERequestMethod

Standard request methods.

Enumerator
eMethod_GET 
eMethod_POST 
eMethod_HEAD 
eMethod_PUT 
eMethod_DELETE 
eMethod_OPTIONS 
eMethod_TRACE 
eMethod_CONNECT 
eMethod_Other 

Unknown method, use GetRequestMethodName to read.

Definition at line 905 of file ncbicgi.hpp.

◆ ESessionCreateMode

Enumerator
eCreateIfNotExist 

If Session does not exist the new one will be created.

eDontCreateIfNotExist 

If Session does not exist the exception will be thrown.

Do not try to load or create session

eDontLoad 

Definition at line 835 of file ncbicgi.hpp.

◆ EState

Enumerator
fUnread 
fHitCR 
fHitLF 
fHitCRLF 
fHitBoundary 

Definition at line 58 of file cgi_entry_reader.hpp.

◆ EWriteMethod

Whether the cookie is sent as a part of HTTP request or HTTP response.

Enumerator
eHTTPResponse 
eHTTPRequest 

Definition at line 85 of file ncbicgi.hpp.

◆ Flags

Enumerator
fIndexesNotEntries 

do not handle indexes as regular FORM entries with empty value

fIgnoreQueryString 

do not parse $QUERY_STRING (or cmd.line if $REQUEST_METHOD not def)

fOwnEnvironment 

own the passed "env" (and destroy it in the destructor)

fDoNotParseContent 

do not automatically parse the request's content body (from "istr")

fCaseInsensitiveArgs 

use case insensitive CGI arguments

fCookies_Unencoded 

Do not use URL-encoding/decoding for cookies.

fCookies_SpaceAsHex 

Use hex code for encoding spaces rather than '+'.

fSaveRequestContent 

Save request content (available through GetContent())

fIgnorePageHitId 

Do not check if page hit id is present, do not generate one if it's missing.

fSkipDiagProperties 

Set client-ip and session-id properties for logging.

fSetDiagProperties 

Old (deprecated) flag controlling diag properties.

fParseInputOnDemand 

Enable on-demand parsing via GetNextEntry()

fSemicolonIsNotArgDelimiter 

Do not treat semicolon as query string argument separator.

fDisableTrackingCookie 

Do not set outgoing tracking cookie.

This can also be done per-request using CCgiResponce::DisableTrackingCookie().

fIncludePreparsedEntries 

When parsing input on demand iterate all existing entries (e.g.

those read from QUERY_STRING) before parsing POST data.

See also
fParseInputOnDemand
fDisableParsingAsIndex 

Disable parsing input as 'indexed' query (RFC3875) even if no '=' is present.

Definition at line 704 of file ncbicgi.hpp.

Function Documentation

◆ AbortChunkedTransfer()

void CCgiResponse::AbortChunkedTransfer ( void  )

Abort chunked transfer, block any writes to the output stream.

Definition at line 689 of file ncbicgir.cpp.

References CCgiStreamWrapper::AbortChunkedTransfer(), CCgiStreamWrapper::eChunkedWrites, CCgiStreamWrapper::GetWriterMode(), and CCgiResponse::m_Output.

◆ AcceptRangesBytes()

bool CCgiResponse::AcceptRangesBytes ( void  ) const

◆ Add() [1/5]

CCgiCookie * CCgiCookies::Add ( const CCgiCookie cookie)

◆ Add() [2/5]

void CCgiCookies::Add ( const CCgiCookies cookies)

Update by a set of cookies.

Definition at line 443 of file ncbicgi.cpp.

References CCgiCookies::Add(), ITERATE, and CCgiCookies::m_Cookies.

◆ Add() [3/5]

CCgiCookie * CCgiCookies::Add ( const string name,
const string value,
const string domain = kEmptyStr,
const string path = kEmptyStr,
EOnBadCookie  on_bad_cookie = eOnBadCookie_SkipAndError 
)

◆ Add() [4/5]

CCgiCookie * CCgiCookies::Add ( const string name,
const string value,
EOnBadCookie  on_bad_cookie 
)

Definition at line 421 of file ncbicgi.cpp.

References CCgiCookies::Add(), kEmptyStr, and rapidjson::value.

◆ Add() [5/5]

void CCgiCookies::Add ( const string str,
EOnBadCookie  on_bad_cookie = eOnBadCookie_SkipAndError 
)

◆ AddDefinitions() [1/2]

void CRefArgs::AddDefinitions ( const string definitions)

Add mappings between host mask and CGI argument name for query string.

See also
CRefArgs::CRefArgs

Definition at line 72 of file ref_args.cpp.

References NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, ITERATE, NStr::Split(), and NStr::SplitInTwo().

Referenced by CRefArgs::CRefArgs().

◆ AddDefinitions() [2/2]

void CRefArgs::AddDefinitions ( const string host_mask,
const string arg_names 
)

◆ AddEntry() [1/2]

void CExtraEntryCollector::AddEntry ( const string name,
const string value,
const string filename,
bool  is_index 
)
overridevirtual

Implements CEntryCollector_Base.

Definition at line 1953 of file ncbicgi.cpp.

References _ASSERT, CExtraEntryCollector::m_Args, and rapidjson::value.

◆ AddEntry() [2/2]

virtual void CEntryCollector_Base::AddEntry ( const string name,
const string value,
const string filename,
bool  is_index = false 
)
pure virtual

◆ AddTrailer()

void CCgiResponse::AddTrailer ( const string name)

Prepare to send trailer.

This must be called before WriteHeader() to allow the trailer value to be set later. Some fields are not allowed to be sent as trailers - see RFC7230: https://tools.ietf.org/html/rfc7230#section-4.1.2

Definition at line 717 of file ncbicgir.cpp.

References CCgiResponse::CanSendTrailer(), and CCgiResponse::m_TrailerValues.

◆ BeginPart() [1/2]

void CCgiResponse::BeginPart ( const string name,
const string type,
CNcbiOstream os,
size_t  size = 0 
)

◆ BeginPart() [2/2]

void CCgiResponse::BeginPart ( const string name,
const string type,
size_t  size = 0 
)
inline

Definition at line 365 of file ncbicgir.hpp.

References CCgiResponse::out().

◆ c_str()

const char* CCgiEntry::c_str ( ) const
inline

Definition at line 539 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ CalcChecksum()

bool CCgiRequest::CalcChecksum ( string checksum,
string content 
) const

◆ CanSendTrailer()

bool CCgiResponse::CanSendTrailer ( void  ) const

Check if trailer can be sent: chunked transfer must be enabled and the request's TE header must include 'trailers'.

All trailer getters/setters are no-op if this condition is false. This will always return false after FinishChunkedTransfer() has been called.

Definition at line 698 of file ncbicgir.cpp.

References NStr::EqualNocase(), NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, CCgiResponse::GetChunkedTransferEnabled(), CCgiRequest::GetRandomProperty(), ITERATE, CCgiResponse::m_HeaderWritten, CCgiResponse::m_Request, CCgiResponse::m_TrailerEnabled, and NStr::Split().

Referenced by CCgiResponse::AddTrailer().

◆ CCgiCookie() [1/2]

CCgiCookie::CCgiCookie ( const CCgiCookie cookie)

Copy constructor.

Definition at line 146 of file ncbicgi.cpp.

References CCgiCookie::m_Expires, CCgiCookie::m_HttpOnly, and CCgiCookie::m_Secure.

◆ CCgiCookie() [2/2]

CCgiCookie::CCgiCookie ( const string name,
const string value,
const string domain = NcbiEmptyString,
const string path = NcbiEmptyString 
)

Throw the "invalid_argument" if "name" or "value" have invalid format.

  • the "name" must not be empty; it must not contain '='
  • "name", "value", "domain" – must consist of printable ASCII characters, and not: semicolons(;), commas(,), or space characters.
  • "path" – can have space characters.

Definition at line 159 of file ncbicgi.cpp.

References kZeroTime, CCgiCookie::m_Expires, CCgiCookie::m_HttpOnly, CCgiCookie::m_Name, CCgiCookie::m_Secure, NCBI_THROW2, CCgiCookie::SetDomain(), CCgiCookie::SetPath(), CCgiCookie::SetValue(), and rapidjson::value.

◆ CCgiCookies() [1/4]

CCgiCookies::CCgiCookies ( const CCgiCookies )
private

prohibit default initialization and assignment

◆ CCgiCookies() [2/4]

CCgiCookies::CCgiCookies ( const string str,
EOnBadCookie  on_bad_cookie = eOnBadCookie_SkipAndError,
EUrlEncode  encode_flag = eUrlEncode_SkipMarkChars 
)
inline

Format of the string: "name1=value1; name2=value2; ...".

Definition at line 1088 of file ncbicgi.hpp.

References CCgiCookies::Add(), and str().

◆ CCgiCookies() [3/4]

CCgiCookies::CCgiCookies ( EUrlEncode  encode_flag)
inline

Use the specified method of string encoding.

Definition at line 1078 of file ncbicgi.hpp.

◆ CCgiCookies() [4/4]

CCgiCookies::CCgiCookies ( void  )
inline

Empty set of cookies.

Definition at line 1068 of file ncbicgi.hpp.

◆ CCgiEntry() [1/3]

CCgiEntry::CCgiEntry ( const CCgiEntry e)
inline

Definition at line 453 of file ncbicgi.hpp.

◆ CCgiEntry() [2/3]

CCgiEntry::CCgiEntry ( const char *  value,
const string filename = kEmptyStr,
unsigned int  position = 0,
const string type = kEmptyStr 
)
inline

Definition at line 448 of file ncbicgi.hpp.

◆ CCgiEntry() [3/3]

CCgiEntry::CCgiEntry ( const string value = kEmptyStr,
const string filename = kEmptyStr,
unsigned int  position = 0,
const string type = kEmptyStr 
)
inline

Definition at line 442 of file ncbicgi.hpp.

◆ CCgiEntryReader()

CCgiEntryReader::CCgiEntryReader ( TContext context)
inlineprivate

Definition at line 67 of file cgi_entry_reader.hpp.

◆ CCgiEntryReaderContext()

CCgiEntryReaderContext::CCgiEntryReaderContext ( CNcbiIstream in,
TCgiEntries out,
const string content_type,
size_t  content_length = CCgiRequest::kContentLengthUnknown,
string content_log = NULL 
)

◆ CCgiRequest() [1/4]

CCgiRequest::CCgiRequest ( CNcbiIstream is,
TFlags  flags = 0,
size_t  errbuf_size = 256 
)

◆ CCgiRequest() [2/4]

CCgiRequest::CCgiRequest ( const CCgiRequest )
private

prohibit default initialization and assignment

◆ CCgiRequest() [3/4]

CCgiRequest::CCgiRequest ( const CNcbiArguments args = 0,
const CNcbiEnvironment env = 0,
CNcbiIstream istr = 0,
TFlags  flags = 0,
int  ifd = -1,
size_t  errbuf_size = 256 
)

Definition at line 1005 of file ncbicgi.cpp.

References env, flags, and CCgiRequest::x_Init().

◆ CCgiRequest() [4/4]

CCgiRequest::CCgiRequest ( int  argc,
const char *const argv,
const char *const envp = 0,
CNcbiIstream istr = 0,
TFlags  flags = 0,
int  ifd = -1,
size_t  errbuf_size = 256 
)

◆ CCgiResponse() [1/2]

CCgiResponse::CCgiResponse ( CNcbiOstream os = NULL,
int  ofd = -1 
)
Note
By default set output stream to "cout" and file descr to STDOUT_FILENO

Definition at line 85 of file ncbicgir.cpp.

References NcbiCout, CCgiResponse::SetOutput(), and STDOUT_FILENO.

◆ CCgiResponse() [2/2]

CCgiResponse::CCgiResponse ( const CCgiResponse )
protected

◆ CExtraEntryCollector()

CExtraEntryCollector::CExtraEntryCollector ( void  )
inline

Definition at line 662 of file ncbicgi.hpp.

◆ Clear()

void CCgiCookies::Clear ( void  )

Remove all stored cookies.

Definition at line 792 of file ncbicgi.cpp.

References set< Key, Compare >::clear(), ITERATE, and CCgiCookies::m_Cookies.

Referenced by ReadCgiCookies(), and CCgiCookies::~CCgiCookies().

◆ compare() [1/2]

int CCgiEntry::compare ( const char *  s) const
inline

Definition at line 541 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ compare() [2/2]

int CCgiEntry::compare ( const string s) const
inline

Definition at line 540 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ Cookies() [1/2]

CCgiCookies & CCgiResponse::Cookies ( void  )
inline

Definition at line 386 of file ncbicgir.hpp.

References CCgiResponse::m_Cookies.

◆ Cookies() [2/2]

const CCgiCookies & CCgiResponse::Cookies ( void  ) const
inline

Definition at line 381 of file ncbicgir.hpp.

References CCgiResponse::m_Cookies.

Referenced by CCgiContext::x_InitSession().

◆ CopyAttributes()

void CCgiCookie::CopyAttributes ( const CCgiCookie cookie)

◆ CRefArgs()

CRefArgs::CRefArgs ( const string definitions = kEmptyStr)

Create referrer parser from a set of definitions.

Parameters
definitionsMultiple definitions should be separated by new line ('
'). Host mask should be followed by space(s). Multiple argument names should be separated with commas. E.g. ".google. q, query\n.foo. bar".

Definition at line 60 of file ref_args.cpp.

References CRefArgs::AddDefinitions().

◆ Deserialize()

void CCgiRequest::Deserialize ( CNcbiIstream is,
TFlags  flags = 0 
)

◆ DisableTrackingCookie()

void CCgiResponse::DisableTrackingCookie ( void  )

◆ empty()

bool CCgiEntry::empty ( ) const
inline

◆ Empty()

bool CCgiCookies::Empty ( void  ) const
inline

Return TRUE if this set contains no cookies.

Definition at line 1112 of file ncbicgi.hpp.

References set< Key, Compare >::empty(), and CCgiCookies::m_Cookies.

Referenced by CCgiResponse::WriteHeader().

◆ EndLastPart() [1/2]

void CCgiResponse::EndLastPart ( CNcbiOstream os)

◆ EndLastPart() [2/2]

void CCgiResponse::EndLastPart ( void  )
inline

Definition at line 376 of file ncbicgir.hpp.

References CCgiResponse::out().

◆ EndPart() [1/2]

void CCgiResponse::EndPart ( CNcbiOstream os)

◆ EndPart() [2/2]

void CCgiResponse::EndPart ( void  )
inline

Definition at line 371 of file ncbicgir.hpp.

References CCgiResponse::out().

◆ Finalize()

void CCgiResponse::Finalize ( void  ) const

Called by the CGI framework after a ProcessRequest(), unless the latter threw an exception.

Note
It still gets called if ProcessRequest() returns non-zero code.
Attention
Do not call it directly from the user code!

Definition at line 458 of file ncbicgir.cpp.

References ERR_POST_X, CCgiResponse::m_HeaderWritten, CCgiResponse::m_JQuery_Callback, CCgiResponse::m_Output, and CCgiResponse::m_RequireWriteHeader.

◆ find() [1/3]

SIZE_TYPE CCgiEntry::find ( char  c,
SIZE_TYPE  pos = 0 
) const
inline

Definition at line 548 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ find() [2/3]

SIZE_TYPE CCgiEntry::find ( const char *  s,
SIZE_TYPE  pos = 0 
) const
inline

Definition at line 544 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

Referenced by CCgiApplication::ConfigureDiagDestination().

◆ Find() [1/4]

CCgiCookie * CCgiCookies::Find ( const string name,
const string domain,
const string path 
)

◆ Find() [2/4]

const CCgiCookie * CCgiCookies::Find ( const string name,
const string domain,
const string path 
) const

Definition at line 712 of file ncbicgi.cpp.

References CCgiCookies::Find().

◆ Find() [3/4]

const CCgiCookie * CCgiCookies::Find ( const string name,
TCRange range = 0 
) const

Definition at line 746 of file ncbicgi.cpp.

References CCgiCookies::Find(), and compile_time_bits::range().

◆ Find() [4/4]

CCgiCookie * CCgiCookies::Find ( const string name,
TRange range = 0 
)

Return the first matched cookie with name "name", or NULL if there is no such cookie(s).

Also, if "range" is non-NULL then assign its "first" and "second" fields to the beginning and the end of the range of cookies matching the name "name". NOTE: if there is a cookie with empty domain and path then this cookie is guaranteed to be returned.

Definition at line 720 of file ncbicgi.cpp.

References set< Key, Compare >::begin(), set< Key, Compare >::end(), CCgiCookies::m_Cookies, and compile_time_bits::range().

◆ find() [3/3]

SIZE_TYPE CCgiEntry::find ( const string s,
SIZE_TYPE  pos = 0 
) const
inline

Definition at line 546 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ find_first_of() [1/2]

SIZE_TYPE CCgiEntry::find_first_of ( const char *  s,
SIZE_TYPE  pos = 0 
) const
inline

Definition at line 552 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ find_first_of() [2/2]

SIZE_TYPE CCgiEntry::find_first_of ( const string s,
SIZE_TYPE  pos = 0 
) const
inline

Definition at line 550 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ FinishChunkedTransfer()

void CCgiResponse::FinishChunkedTransfer ( void  )

Finish chunked transfer, append zero chunk and trailers, if any.

All trailers must be set before calling this method.

Definition at line 676 of file ncbicgir.cpp.

References CCgiStreamWrapper::eBlockWrites, CCgiStreamWrapper::eChunkedWrites, CCgiStreamWrapper::FinishChunkedTransfer(), CCgiStreamWrapper::GetWriterMode(), CCgiResponse::m_Output, CCgiResponse::m_TrailerValues, and CCgiStreamWrapper::SetWriterMode().

◆ Flush()

void CCgiResponse::Flush ( void  ) const

Flush output stream.

Definition at line 529 of file ncbicgir.cpp.

References CCgiResponse::GetOutput(), and NcbiFlush.

Referenced by CPsgCgiApp::Help(), main(), CSoapServerApplication::ProcessRequest(), and s_Demo().

◆ GetAll()

CCgiCookies::TCRange CCgiCookies::GetAll ( void  ) const

Return the full range [begin():end()] on the underlying container.

Definition at line 763 of file ncbicgi.cpp.

References set< Key, Compare >::begin(), set< Key, Compare >::end(), and CCgiCookies::m_Cookies.

◆ GetAllCookiesHttpOnly()

bool CCgiCookies::GetAllCookiesHttpOnly ( void  ) const
inline

Definition at line 328 of file ncbicgi.hpp.

References CCgiCookies::m_AllHttpOnly.

Referenced by CCgiResponse::WriteHeader().

◆ GetAllCookiesSecure()

bool CCgiCookies::GetAllCookiesSecure ( void  ) const
inline

Definition at line 324 of file ncbicgi.hpp.

References CCgiCookies::m_AllSecure.

Referenced by CCgiResponse::WriteHeader().

◆ GetArgs()

CDiagContext_Extra::TExtraArgs& CExtraEntryCollector::GetArgs ( void  )
inline

Definition at line 670 of file ncbicgi.hpp.

References CExtraEntryCollector::m_Args.

Referenced by CCgiApplication::x_OnEvent().

◆ GetCGIEntries()

void CCgiRequest::GetCGIEntries ( CEntryCollector_Base collector) const

Get full set of arguments (both GET and POST), URL-encoded.

A &-separated list of exclusions can be set in CGI_LOG_EXCLUDE_ARGS variable or [CGI] LOG_EXCLUDE_ARGS value in ini file.

Definition at line 1648 of file ncbicgi.cpp.

References CEntryCollector_Base::AddEntry(), ERR_POST, Error(), NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, if(), ITERATE, kEmptyStr, CCgiRequest::m_Entries, CCgiRequest::m_Indexes, NStr::Split(), NStr::SplitInTwo(), string, NStr::StringToInt(), and val.

Referenced by CCgiRequest::GetCGIEntriesStr(), and CCgiApplication::x_OnEvent().

◆ GetCGIEntriesStr()

string CCgiRequest::GetCGIEntriesStr ( void  ) const

Shortcut for collecting arguments into a URL-style string.

See also
GetCGIEntries

Definition at line 1763 of file ncbicgi.cpp.

References CStringEntryCollector::GetArgs(), and CCgiRequest::GetCGIEntries().

◆ GetChunkedTransferEnabled()

bool CCgiResponse::GetChunkedTransferEnabled ( void  ) const

Check/change chunked transfer encoding status.

This flag is used only if CGI_CHUNKED_TRANSFER is not set.

Definition at line 647 of file ncbicgir.cpp.

References eChunked_Default, eChunked_Disable, CCgiRequest::GetEnvironment(), CCgiResponse::m_ChunkedTransfer, CCgiResponse::m_Request, and CCgiResponse::x_ClientSupportsChunkedTransfer().

Referenced by CCgiResponse::CanSendTrailer(), and CCgiResponse::WriteHeader().

◆ GetChunkSize()

size_t CCgiResponse::GetChunkSize ( void  )
static

Definition at line 633 of file ncbicgir.cpp.

Referenced by CCgiStreamWrapperWriter::SetMode().

◆ GetClientTrackingEnv()

const char *const * CCgiRequest::GetClientTrackingEnv ( void  ) const

Return client tracking environment variables These variables are stored in the form "name=value".

The last element in the returned array is 0.

Definition at line 1557 of file ncbicgi.cpp.

References CCgiRequest::m_Env, and CCgiRequest::m_TrackingEnvHolder.

◆ GetContent()

const string & CCgiRequest::GetContent ( void  ) const

Get request content.

The content is saved only when fSaveRequestContent flag is set. Otherwise the method will throw an exception.

Definition at line 1416 of file ncbicgi.cpp.

References eRead, CCgiRequest::m_Content, and NCBI_THROW.

Referenced by CCgi2RCgiApp::SubmitJob().

◆ GetContentLength()

size_t CCgiRequest::GetContentLength ( void  ) const

◆ GetContentType() [1/2]

const string& CCgiEntry::GetContentType ( void  ) const
inline

May be available for some fields of POSTed forms.

Definition at line 525 of file ncbicgi.hpp.

References CCgiEntry::m_Data.

Referenced by CCgiEntry::operator=(), CCgiEntry::operator==(), CContElemConverter< CCgiEntry >::ToString(), and CCgiEntry::x_GetCharset().

◆ GetContentType() [2/2]

string CCgiResponse::GetContentType ( void  ) const
inline

Get content type.

Definition at line 342 of file ncbicgir.hpp.

References CCgiResponse::GetHeaderValue(), and CCgiResponse::sm_ContentTypeName.

◆ GetCookies() [1/2]

CCgiCookies & CCgiRequest::GetCookies ( void  )
inline

Definition at line 1176 of file ncbicgi.hpp.

References CCgiRequest::m_Cookies.

◆ GetCookies() [2/2]

const CCgiCookies & CCgiRequest::GetCookies ( void  ) const
inline

Retrieve the request cookies.

Definition at line 1173 of file ncbicgi.hpp.

References CCgiRequest::m_Cookies.

Referenced by CCgiRequest::Deserialize(), CCgiSession::RetrieveSessionId(), CCgiRequest::Serialize(), and CCgiApplication::x_OnEvent().

◆ GetDefaultDefinitions()

string CRefArgs::GetDefaultDefinitions ( void  )
static

Get default set of search engine definitions.

Definition at line 45 of file ref_args.cpp.

◆ GetDomain()

const string & CCgiCookie::GetDomain ( void  ) const
inline

Definition at line 1037 of file ncbicgi.hpp.

References CCgiCookie::m_Domain.

Referenced by CCgiCookies::Add().

◆ GetEntries() [1/2]

TCgiEntries & CCgiRequest::GetEntries ( void  )
inline

Definition at line 1184 of file ncbicgi.hpp.

References CCgiRequest::m_Entries.

◆ GetEntries() [2/2]

const TCgiEntries & CCgiRequest::GetEntries ( void  ) const
inline

◆ GetEntry()

const CCgiEntry & CCgiRequest::GetEntry ( const string name,
bool is_found = 0 
) const

◆ GetEnvironment()

const CNcbiEnvironment& CCgiRequest::GetEnvironment ( ) const
inline

Definition at line 891 of file ncbicgi.hpp.

References CCgiRequest::m_Env.

Referenced by CCgiResponse::GetChunkedTransferEnabled(), and SRemoteCgi::Input().

◆ GetExpDate() [1/2]

bool CCgiCookie::GetExpDate ( tm *  exp_date) const

If exp.date is not set then return FALSE and dont assign "*exp_date".

Definition at line 221 of file ncbicgi.cpp.

References eUnknown, CCgiCookie::m_Expires, NCBI_THROW, and s_IsZeroTime().

◆ GetExpDate() [2/2]

string CCgiCookie::GetExpDate ( void  ) const

Day, dd-Mon-yyyy hh:mm:ss GMT (return empty string if not set)

Definition at line 206 of file ncbicgi.cpp.

References kEmptyStr, CCgiCookie::m_Expires, NCBI_THROW, s_IsZeroTime(), str(), and string.

Referenced by CCgiCookie::Write().

◆ GetFilename()

const string& CCgiEntry::GetFilename ( void  ) const
inline

Only available for certain fields of POSTed forms.

Definition at line 508 of file ncbicgi.hpp.

References CCgiEntry::m_Data.

Referenced by CCgiEntry::operator=(), CCgiEntry::operator==(), and CContElemConverter< CCgiEntry >::ToString().

◆ GetHeaderValue()

string CCgiResponse::GetHeaderValue ( const string name) const

◆ GetHttpOnly()

bool CCgiCookie::GetHttpOnly ( void  ) const
inline

Definition at line 1046 of file ncbicgi.hpp.

References CCgiCookie::m_HttpOnly.

◆ GetIndexes() [1/2]

TCgiIndexes & CCgiRequest::GetIndexes ( void  )
inline

Definition at line 1189 of file ncbicgi.hpp.

References CCgiRequest::m_Indexes.

◆ GetIndexes() [2/2]

const TCgiIndexes & CCgiRequest::GetIndexes ( void  ) const
inline

Get a set of indexes(decoded) received from the client.

It will always be empty if "indexes_as_entries" in the constructor was TRUE (default).

Definition at line 1192 of file ncbicgi.hpp.

References CCgiRequest::m_Indexes.

Referenced by CCgiRequest::Deserialize(), and CCgiRequest::Serialize().

◆ GetInputFD()

int CCgiRequest::GetInputFD ( void  ) const
inline

Returns file descriptor of input stream, or -1 if unavailable.

Definition at line 1200 of file ncbicgi.hpp.

References CCgiRequest::m_InputFD.

◆ GetInputStream()

CNcbiIstream * CCgiRequest::GetInputStream ( void  ) const
inline

Return pointer to the input stream.

Return NULL if the input stream is absent, or if it has been automagically read and parsed already (the "POST" method, and "application/x-www-form-urlencoded" or "multipart/form-data" type, and "fDoNotParseContent" flag was not passed to the constructor).

Definition at line 1196 of file ncbicgi.hpp.

References CCgiRequest::m_Input.

Referenced by CCgiRequest::Serialize(), and CSoapServerApplication::x_ProcessSoapRequest().

◆ GetMultipartMode()

CCgiResponse::EMultipartMode CCgiResponse::GetMultipartMode ( void  )
inline

Definition at line 360 of file ncbicgir.hpp.

References CCgiResponse::m_IsMultipart.

◆ GetName()

const string & CCgiCookie::GetName ( void  ) const
inline

The cookie name cannot be changed during its whole timelife.

Definition at line 1031 of file ncbicgi.hpp.

References CCgiCookie::m_Name.

Referenced by CCgiCookies::Add().

◆ GetNextEntry() [1/2]

TCgiEntriesI CCgiEntryReaderContext::GetNextEntry ( void  )

◆ GetNextEntry() [2/2]

TCgiEntriesI CCgiRequest::GetNextEntry ( void  )

Get next entry when parsing input on demand.

Returns GetEntries().end() when all entries have been parsed.

Definition at line 1462 of file ncbicgi.cpp.

References multimap_checker< Container >::end(), CCgiEntryReaderContext::GetNextEntry(), CCgiRequest::m_Entries, and CCgiRequest::m_EntryReaderContext.

Referenced by CCgiRequest::GetPossiblyUnparsedEntry(), and CCgiRequest::ParseRemainingContent().

◆ GetOutput()

CNcbiOstream * CCgiResponse::GetOutput ( void  ) const

Get output stream (NULL here means "no output stream").

Attention
If the output stream is in a "bad" state and the SetThrowOnBadOutput() is set to TRUE, then:
  • a warning will be posted
  • SetThrowOnBadOutput(false) will be called

Definition at line 239 of file ncbicgir.cpp.

References CCgiResponse::AcceptRangesBytes(), CCgiRequest::eMethod_HEAD, ERR_POST_X, CCgiResponse::HaveContentRange(), CCgiResponse::m_HeaderWritten, CCgiResponse::m_Output, CCgiResponse::m_RequestMethod, CCgiResponse::m_ThrowOnBadOutput, and CCgiResponse::SetThrowOnBadOutput().

Referenced by CCgiResponse::Flush(), CCgiResponse::out(), CCgiRequestProcessor::ProcessHelpRequest(), CCgiRequestProcessor::ProcessVersionRequest(), and CCgiApplication::x_OnEvent().

◆ GetOutputFD()

int CCgiResponse::GetOutputFD ( void  ) const
inline

Get file descriptor of the output stream (-1 if not applicable)

Definition at line 391 of file ncbicgir.hpp.

References CCgiResponse::m_OutputFD.

Referenced by CCgiContext::GetStreamStatus().

◆ GetPath()

const string & CCgiCookie::GetPath ( void  ) const
inline

Definition at line 1040 of file ncbicgi.hpp.

References CCgiCookie::m_Path.

Referenced by CCgiCookies::Add().

◆ GetPosition()

unsigned int CCgiEntry::GetPosition ( void  ) const
inline

CGI parameter number – automatic image name parameter is #0, explicit parameters start at #1.

Definition at line 517 of file ncbicgi.hpp.

References CCgiEntry::m_Data.

Referenced by CCgiEntry::operator=(), and CContElemConverter< CCgiEntry >::ToString().

◆ GetPossiblyUnparsedEntry()

CCgiEntry * CCgiRequest::GetPossiblyUnparsedEntry ( const string name)

Get entry value by name, calling GetNextEntry() as needed.

NOTE: There can be more than one entry with the same name; only one of these entry will be returned.

To get all matches, use GetEntries() and "multimap::" member functions. If there is no such entry, this method will parse (and save) any remaining input and return NULL.

Definition at line 1469 of file ncbicgi.cpp.

References multimap_checker< Container >::end(), multimap_checker< Container >::find(), CCgiRequest::GetNextEntry(), CCgiRequest::m_Entries, and NULL.

◆ GetProperty()

const string & CCgiRequest::GetProperty ( ECgiProp  prop) const

◆ GetPropertyName()

const string CCgiRequest::GetPropertyName ( ECgiProp  prop)
static

◆ GetQueryString()

string CRefArgs::GetQueryString ( const string referrer) const

Find query string in the referrer.

Parameters
referrerFull HTTP referrer
Returns
Query string assigned to one of the names associated with the host in the referrer or empty string.

Definition at line 101 of file ref_args.cpp.

References ERR_POST_X, NStr::FindNoCase(), CUrl::GetArgs(), CUrl::GetHost(), CUrlArgs::GetValue(), CUrl::HaveArgs(), CUrlArgs::IsSetValue(), ITERATE, kEmptyStr, CRefArgs::m_HostMap, NPOS, and Warning().

◆ GetRandomProperty()

const string & CCgiRequest::GetRandomProperty ( const string key,
bool  http = true 
) const

Get value of a random client property; if "http" is TRUE then add prefix "HTTP_" to the property name.

NOTE: usually, the value is extracted from the environment variable named "$[HTTP]_<key>". Be advised, however, that in the case of FastCGI application, the set (and values) of env.variables change from request to request, and they differ from those returned by CNcbiApplication::GetEnvironment()!

Definition at line 1438 of file ncbicgi.cpp.

References ncbi::grid::netcache::search::fields::key, and CCgiRequest::x_GetPropertyByName().

Referenced by CCgiResponse::CanSendTrailer(), CGridCgiContext::CGridCgiContext(), CCgiContext::GetSelfURL(), CCgiContext::ProcessCORSRequest(), CCgiRequestProcessor::ValidateSynchronizationToken(), CCgiRequest::x_InitRequestContext(), CCgiContext::x_IsSecure(), and CCgiApplication::x_OnEvent().

◆ GetRequestMethod()

CCgiRequest::ERequestMethod CCgiRequest::GetRequestMethod ( void  ) const

◆ GetRequestMethodName()

const string & CCgiRequest::GetRequestMethodName ( void  ) const

Get request method name.

Definition at line 1804 of file ncbicgi.cpp.

References eCgi_RequestMethod, and CCgiRequest::GetProperty().

Referenced by CCgiRequest::GetRequestMethod(), and SRemoteCgi::Input().

◆ GetSecure()

bool CCgiCookie::GetSecure ( void  ) const
inline

Definition at line 1043 of file ncbicgi.hpp.

References CCgiCookie::m_Secure.

◆ GetSession()

CCgiSession & CCgiRequest::GetSession ( ESessionCreateMode  mode = eCreateIfNotExist) const

◆ GetTrackingCookie()

const string& CCgiRequest::GetTrackingCookie ( void  ) const
inline

◆ GetTrailerValue()

string CCgiResponse::GetTrailerValue ( const string name) const

Get current trailer value.

Definition at line 736 of file ncbicgir.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), kEmptyStr, and CCgiResponse::m_TrailerValues.

◆ GetUrlEncodeFlag()

EUrlEncode CCgiCookies::GetUrlEncodeFlag ( void  ) const
inline

Definition at line 1101 of file ncbicgi.hpp.

References CCgiCookies::m_EncodeFlag.

◆ GetValue() [1/2]

const string& CCgiEntry::GetValue ( void  ) const
inline

◆ GetValue() [2/2]

const string & CCgiCookie::GetValue ( void  ) const
inline

All "const string& GetXXX(...)" methods beneath return reference to "NcbiEmptyString" if the requested attributre is not set.

Definition at line 1034 of file ncbicgi.hpp.

References CCgiCookie::m_Value.

Referenced by CCgiSession::RetrieveSessionId(), CCgiContext::RetrieveTrackingId(), s_CheckCookieForTID(), and CHttpRequest::x_GetCookieValue().

◆ GetValueAsUTF8()

CStringUTF8 CCgiEntry::GetValueAsUTF8 ( EOnCharsetError  on_error = eCharsetError_Ignore) const

◆ GetValueReader()

IReader * CCgiEntry::GetValueReader ( )
inline

Get the value via a reader, potentially on the fly – in which case the caller takes ownership of the source, and subsequent calls to GetValue and relatives will yield NO data.

(In either case, the caller owns the resulting object.)

See also
GetValue, GetValueStream

Definition at line 1136 of file ncbicgi.hpp.

References CCgiEntry::m_Data.

◆ GetValueStream()

CNcbiIstream * CCgiEntry::GetValueStream ( )
inline

Get the value as a stream, potentially on the fly – in which case the caller takes ownership of the source, and subsequent calls to GetValue and relatives will yield NO data.

(In either case, the caller owns the resulting object.)

See also
GetValue, GetValueReader

Definition at line 1147 of file ncbicgi.hpp.

References CRWStreambuf::fOwnReader, CCgiEntry::GetValue(), and CCgiEntry::m_Data.

◆ HaveContentRange()

bool CCgiResponse::HaveContentRange ( void  ) const

Check if 'Content-Range' header is set.

Definition at line 586 of file ncbicgir.cpp.

References CCgiResponse::HaveHeaderValue(), and CCgiResponse::sm_ContentRange.

Referenced by CCgiResponse::GetOutput(), and CCgiApplication::x_OnEvent().

◆ HaveHeaderValue()

bool CCgiResponse::HaveHeaderValue ( const string name) const

◆ HaveTrailer()

bool CCgiResponse::HaveTrailer ( const string name) const

Check if trailer has been added and its value can be set.

Definition at line 730 of file ncbicgir.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), and CCgiResponse::m_TrailerValues.

Referenced by CCgiResponse::SetTrailerValue().

◆ IncludePreparsedEntries()

void CCgiEntryReaderContext::IncludePreparsedEntries ( void  )

◆ InitCORSHeaders()

void CCgiResponse::InitCORSHeaders ( const string origin,
const string jquery_callback = kEmptyStr 
)

This method is called automatically by CCgiContext.

Initialize cross-origin resource sharing (CORS) headers.

Parameters
originMust match allowed origins for the CORS to be enabled.
jquery_callbackUsed to enable JQuery JSONP hack to allow cross-origin resource sharing for browsers that don't support CORS (e.g. IE versions earlier than 11). For more info about this (hopefully temporary) hack see the sources.
Deprecated:
Use CCgiContext::ProcessCORSRequest

Definition at line 592 of file ncbicgir.cpp.

◆ IsHeaderWritten()

bool CCgiResponse::IsHeaderWritten ( void  ) const
inline

◆ IsInvalid()

CCgiCookie::TInvalidFlag CCgiCookie::IsInvalid ( void  ) const
inline

Definition at line 1050 of file ncbicgi.hpp.

References CCgiCookie::m_InvalidFlag.

Referenced by CCgiCookie::CopyAttributes().

◆ IsListedHost()

bool CRefArgs::IsListedHost ( const string referrer) const

Check if the host from the referrer string is listed in definitions.

Definition at line 120 of file ref_args.cpp.

References NStr::Find(), NStr::FindNoCase(), ITERATE, CRefArgs::m_HostMap, and NPOS.

◆ IsRawCgi()

bool CCgiResponse::IsRawCgi ( void  ) const
inline

Definition at line 332 of file ncbicgir.hpp.

References CCgiResponse::m_IsRawCgi.

Referenced by CCgiResponse::WriteHeader().

◆ NCBI_PARAM_DECL() [1/2]

CCgiResponse::NCBI_PARAM_DECL ( bool  ,
CGI  ,
ExceptionAfterHEAD   
)
private

◆ NCBI_PARAM_DECL() [2/2]

CCgiResponse::NCBI_PARAM_DECL ( bool  ,
CGI  ,
ThrowOnBadOutput   
)
private

◆ NCBI_PARAM_TYPE() [1/2]

typedef CCgiResponse::NCBI_PARAM_TYPE ( CGI  ,
ExceptionAfterHEAD   
)
private

◆ NCBI_PARAM_TYPE() [2/2]

typedef CCgiResponse::NCBI_PARAM_TYPE ( CGI  ,
ThrowOnBadOutput   
)
private

◆ operator const CTempStringEx()

CCgiEntry::operator const CTempStringEx ( ) const
inline

Definition at line 534 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ operator const string &()

CCgiEntry::operator const string & ( ) const
inline

Definition at line 532 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ operator string &()

CCgiEntry::operator string & ( )
inline

Definition at line 533 of file ncbicgi.hpp.

References CCgiEntry::SetValue().

◆ operator!=() [1/3]

bool CCgiEntry::operator!= ( const CCgiEntry v) const
inline

Definition at line 565 of file ncbicgi.hpp.

◆ operator!=() [2/3]

bool CCgiEntry::operator!= ( const char *  v) const
inline

Definition at line 585 of file ncbicgi.hpp.

◆ operator!=() [3/3]

bool CCgiEntry::operator!= ( const string v) const
inline

Definition at line 575 of file ncbicgi.hpp.

◆ operator()()

bool CCgiCookie::PLessCPtr::operator() ( const TCPtr c1,
const TCPtr c2 
) const
inline

Definition at line 138 of file ncbicgi.hpp.

◆ operator+() [1/2]

string operator+ ( const CCgiEntry e,
const string s 
)
inline

Definition at line 611 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ operator+() [2/2]

string operator+ ( const string s,
const CCgiEntry e 
)
inline

Definition at line 617 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ operator<()

bool CCgiCookie::operator< ( const CCgiCookie cookie) const

Compare two cookies.

Definition at line 355 of file ncbicgi.cpp.

References CCgiCookie::m_Domain, CCgiCookie::m_Name, CCgiCookie::m_Path, and s_CookieLess().

◆ operator<<() [1/3]

CNcbiOstream& operator<< ( CNcbiOstream o,
const CCgiEntry e 
)
inline

Definition at line 623 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ operator<<() [2/3]

CNcbiOstream& operator<< ( CNcbiOstream os,
const CCgiCookie cookie 
)
inline

Definition at line 195 of file ncbicgi.hpp.

References CCgiCookie::Write().

◆ operator<<() [3/3]

CNcbiOstream& operator<< ( CNcbiOstream os,
const CCgiCookies cookies 
)
inline

Definition at line 364 of file ncbicgi.hpp.

References CCgiCookies::Write().

◆ operator=() [1/5]

CCgiCookie& CCgiCookie::operator= ( const CCgiCookie )
private

◆ operator=() [2/5]

CCgiCookies& CCgiCookies::operator= ( const CCgiCookies )
private

◆ operator=() [3/5]

CCgiEntry& CCgiEntry::operator= ( const CCgiEntry e)
inline

◆ operator=() [4/5]

CCgiRequest& CCgiRequest::operator= ( const CCgiRequest )
private

◆ operator=() [5/5]

CCgiResponse& CCgiResponse::operator= ( const CCgiResponse )
protected

◆ operator==() [1/3]

bool CCgiEntry::operator== ( const CCgiEntry e2) const
inline

◆ operator==() [2/3]

bool CCgiEntry::operator== ( const char *  v) const
inline

Definition at line 580 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ operator==() [3/3]

bool CCgiEntry::operator== ( const string v) const
inline

Definition at line 570 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ out()

CNcbiOstream & CCgiResponse::out ( void  ) const

◆ ParseEntries()

SIZE_TYPE CCgiRequest::ParseEntries ( const string str,
TCgiEntries entries 
)
static

Decode the URL-encoded(FORM or ISINDEX) string "str" into a set of entries <"name", "value"> and add them to the "entries" set.

The new entries are added without overriding the original ones, even if they have the same names. FORM format: "name1=value1&.....", ('=' and 'value' are optional) ISINDEX format: "val1+val2+val3+....." If the "str" is in ISINDEX format then the entry "value" will be empty. On success, return zero; otherwise return location(1-based) of error

Definition at line 1530 of file ncbicgi.cpp.

References entries, CParseTemplException< TBase >::GetPos(), CUrlArgs_Parser::SetQueryString(), and str().

Referenced by CCgiRequest::CalcChecksum(), CFactory< Type >::CgiFactory(), CGridCgiContext::CGridCgiContext(), and CGridCgiApplication::IsCachingNeeded().

◆ ParseIndexes()

SIZE_TYPE CCgiRequest::ParseIndexes ( const string str,
TCgiIndexes indexes 
)
static

Decode the URL-encoded string "str" into a set of ISINDEX-like entries and add them to the "indexes" set.

Returns
zero on success; otherwise, 1-based location of error

Definition at line 1543 of file ncbicgi.cpp.

References CCgiRequest::fIndexesNotEntries, CParseTemplException< TBase >::GetPos(), CUrlArgs_Parser::SetQueryString(), and str().

◆ ParseRemainingContent()

void CCgiRequest::ParseRemainingContent ( void  )

Parse any remaining POST content for use by GetEntries() et al.

Definition at line 1484 of file ncbicgi.cpp.

References multimap_checker< Container >::end(), CCgiRequest::GetNextEntry(), and CCgiRequest::m_Entries.

Referenced by CCgiRequest::x_ProcessInputStream().

◆ PendingCount()

ERW_Result CCgiEntryReader::PendingCount ( size_t *  count)
virtual

Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking.

Return eRW_Success if the number of pending bytes has been stored at the location pointed to by "count". Return eRW_NotImplemented if the number cannot be determined. Otherwise, return other eRW_... condition to reflect the problem ("*count" does not need to be updated in the case of non-eRW_Success). Note that if reporting 0 bytes ready, the method may return either both eRW_Success and zero "*count", or return eRW_NotImplemented alone.

Implements IReader.

Definition at line 91 of file cgi_entry_reader.cpp.

References _ASSERT, count, CT_EQ_INT_TYPE, CT_TO_INT_TYPE, eRW_Eof, eRW_NotImplemented, eRW_Success, CCgiEntryReader::fHitBoundary, CCgiEntryReader::fHitCRLF, CCgiEntryReader::m_Buffer, CCgiEntryReader::m_Context, CCgiEntryReaderContext::m_In, and CCgiEntryReader::m_State.

◆ Read()

ERW_Result CCgiEntryReader::Read ( void *  buf,
size_t  count,
size_t *  bytes_read 
)
virtual

Read as many as "count" bytes into a buffer pointed to by the "buf" argument.

Always store the number of bytes actually read (0 if read none) via the pointer "bytes_read", if provided non-NULL. Return non-eRW_Success code if EOF / error condition has been encountered during the operation (some data may have been read, nevertheless, and reflected in "*bytes_read"). Special case: if "count" is passed as 0, then the value of "buf" must be ignored, and no change should be made to the state of the input device (but may return non-eRW_Success to indicate that the input device has already been in an error condition).

Note
Apparently, may not return eRW_Success if hasn't been able to read "count" bytes as requested, and "bytes_read" was provided as NULL.
When returning "*bytes_read" as zero for a non-zero "count" requested, the return status should not indicate eRW_Success.
Warning
"*bytes_read" may never be returned greater than "count".
Attention
It is implementation-dependent whether the call blocks until the entire buffer is read or the call returns when at least some data are available. In general, it is advised that this call is made within a loop that checks for EOF condition and proceeds with the reading until the required amount of data has been retrieved.

Implements IReader.

Definition at line 67 of file cgi_entry_reader.cpp.

References _ASSERT, buf, count, CCgiEntryReaderContext::eCT_Multipart, eRW_Eof, eRW_Success, CCgiEntryReader::fHitBoundary, CCgiEntryReader::m_Buffer, CCgiEntryReaderContext::m_ContentType, CCgiEntryReader::m_Context, CCgiEntryReader::m_State, min(), n, and CCgiEntryReader::x_FillBuffer().

◆ Remove() [1/3]

bool CCgiCookies::Remove ( CCgiCookie cookie,
bool  destroy = true 
)

Remove "cookie" from this set; deallocate it if "destroy" is true Return FALSE if can not find "cookie" in this set.

Definition at line 770 of file ncbicgi.cpp.

References destroy(), set< Key, Compare >::erase(), and CCgiCookies::m_Cookies.

Referenced by CCgiCookies::Remove().

◆ Remove() [2/3]

size_t CCgiCookies::Remove ( const string name,
bool  destroy = true 
)
inline

Remove (and destroy if "destroy" is true) all cookies with the given "name".

Return # of found and removed cookies.

Definition at line 1117 of file ncbicgi.hpp.

References destroy(), CCgiCookies::Find(), compile_time_bits::range(), and CCgiCookies::Remove().

◆ Remove() [3/3]

size_t CCgiCookies::Remove ( TRange range,
bool  destroy = true 
)

Remove (and destroy if "destroy" is true) all cookies belonging to range "range".

Return # of found and removed cookies.

Definition at line 780 of file ncbicgi.cpp.

References count, destroy(), set< Key, Compare >::erase(), CCgiCookies::m_Cookies, and compile_time_bits::range().

◆ RemoveHeaderValue()

void CCgiResponse::RemoveHeaderValue ( const string name)

◆ RemoveTrailer()

void CCgiResponse::RemoveTrailer ( const string name)

Remove trailer. Must be called before WriteHeader().

Definition at line 724 of file ncbicgir.cpp.

References map_checker< Container >::erase(), and CCgiResponse::m_TrailerValues.

◆ RequireWriteHeader()

void CCgiResponse::RequireWriteHeader ( bool  require)
inline

Define if WriteHeader() must be called or can be skipped.

Parameters
requiretrue - report (to application log) if WriteHeader has not been called by the end of ProcessRequest(); false - allow to skip WriteHeader call (e.g when the user writes custom HTTP header directly to the output stream). The default setting is 'true'.

Definition at line 401 of file ncbicgir.hpp.

References CCgiResponse::m_RequireWriteHeader.

Referenced by CCgi2RCgiApp::ProcessRequest().

◆ Reset()

void CCgiCookie::Reset ( void  )

◆ ResetInvalid()

void CCgiCookie::ResetInvalid ( TInvalidFlag  flag)
inline

Definition at line 1058 of file ncbicgi.hpp.

References CCgiCookie::m_InvalidFlag.

Referenced by CCgiCookie::CopyAttributes(), and CCgiCookie::Reset().

◆ SData() [1/2]

CCgiEntry::SData::SData ( const SData data)
inline

Definition at line 429 of file ncbicgi.hpp.

References _ASSERT, and data.

◆ SData() [2/2]

CCgiEntry::SData::SData ( const string value,
const string filename,
unsigned int  position,
const string type 
)
inline

Definition at line 425 of file ncbicgi.hpp.

◆ Serialize()

void CCgiRequest::Serialize ( CNcbiOstream os) const

◆ SetAllCookiesHttpOnly()

void CCgiCookies::SetAllCookiesHttpOnly ( bool  value)

Mark all cookies as HTTP_ONLY.

Definition at line 810 of file ncbicgi.cpp.

References CCgiCookies::m_AllHttpOnly, CCgiCookies::m_Cookies, NON_CONST_ITERATE, and rapidjson::value.

◆ SetAllCookiesSecure()

void CCgiCookies::SetAllCookiesSecure ( bool  value)

Mark all cookies as secure.

Definition at line 801 of file ncbicgi.cpp.

References CCgiCookies::m_AllSecure, CCgiCookies::m_Cookies, NON_CONST_ITERATE, and rapidjson::value.

◆ SetCgiRequest()

void CCgiResponse::SetCgiRequest ( const CCgiRequest request)
inline

Definition at line 411 of file ncbicgir.hpp.

References CCgiResponse::m_Request.

Referenced by CCgiContext::CCgiContext().

◆ SetChunkedTransferEnabled()

void CCgiResponse::SetChunkedTransferEnabled ( bool  value)

◆ SetContentType() [1/3]

string& CCgiEntry::SetContentType ( )
inline

Definition at line 527 of file ncbicgi.hpp.

References CCgiEntry::m_Data, and CCgiEntry::x_ForceUnique().

Referenced by CCgiEntry::operator=().

◆ SetContentType() [2/3]

void CCgiEntry::SetContentType ( const string f)
inline

Definition at line 529 of file ncbicgi.hpp.

References f, CCgiEntry::m_Data, and CCgiEntry::x_ForceUnique().

◆ SetContentType() [3/3]

void CCgiResponse::SetContentType ( const string type)
inline

◆ SetDomain()

void CCgiCookie::SetDomain ( const string str)
inline

◆ SetExceptionAfterHEAD()

void CCgiResponse::SetExceptionAfterHEAD ( bool  expt_after_head)

Definition at line 573 of file ncbicgir.cpp.

References CCgiResponse::m_ExceptionAfterHEAD.

◆ SetExpDate()

void CCgiCookie::SetExpDate ( const tm &  exp_date)
inline

Definition at line 1019 of file ncbicgi.hpp.

References CCgiCookie::m_Expires.

◆ SetExpTime()

void CCgiCookie::SetExpTime ( const CTime exp_time)

◆ SetFilename() [1/3]

string& CCgiEntry::SetFilename ( void  )
inline

Definition at line 510 of file ncbicgi.hpp.

References CCgiEntry::m_Data, and CCgiEntry::x_ForceUnique().

Referenced by CCgiEntry::operator=().

◆ SetFilename() [2/3]

void CCgiEntry::SetFilename ( const string f)
inline

Definition at line 512 of file ncbicgi.hpp.

References f, CCgiEntry::m_Data, and CCgiEntry::x_ForceUnique().

◆ SetFilename() [3/3]

void CCgiResponse::SetFilename ( const string name,
size_t  size = 0 
)

◆ SetHeaderValue() [1/3]

void CCgiResponse::SetHeaderValue ( const string name,
const CTime value 
)

◆ SetHeaderValue() [2/3]

void CCgiResponse::SetHeaderValue ( const string name,
const string value 
)

◆ SetHeaderValue() [3/3]

void CCgiResponse::SetHeaderValue ( const string name,
const struct tm &  value 
)

◆ SetHttpOnly()

void CCgiCookie::SetHttpOnly ( bool  http_only)
inline

Definition at line 1025 of file ncbicgi.hpp.

References CCgiCookie::m_HttpOnly.

Referenced by CCgiResponse::WriteHeader().

◆ SetInputStream()

void CCgiRequest::SetInputStream ( CNcbiIstream is,
bool  own = false,
int  fd = -1 
)

Set input stream to "is".

If "own" is set to TRUE then this stream will be destroyed as soon as SetInputStream() gets called with another stream pointer. NOTE: SetInputStream(0) will be called in ::~CCgiRequest().

Definition at line 1513 of file ncbicgi.cpp.

References CCgiRequest::m_EntryReaderContext, CCgiRequest::m_Input, CCgiRequest::m_InputFD, CCgiRequest::m_OwnInput, and NULL.

Referenced by CCgiRequest::~CCgiRequest().

◆ SetInvalid()

void CCgiCookie::SetInvalid ( TInvalidFlag  flag)
inline

Definition at line 1054 of file ncbicgi.hpp.

References CCgiCookie::m_InvalidFlag.

Referenced by CCgiCookies::Add(), and CCgiCookie::CopyAttributes().

◆ SetLocation()

void CCgiResponse::SetLocation ( const CUrl url,
const IUrlEncoder encoder = 0 
)
inline

Set the "Location:" HTTP header.

Definition at line 347 of file ncbicgir.hpp.

References CUrl::ComposeUrl(), CUrlArgs::eAmp_Char, CCgiResponse::SetHeaderValue(), and CCgiResponse::sm_LocationName.

◆ SetMultipartMode()

void CCgiResponse::SetMultipartMode ( EMultipartMode  mode = eMultipart_mixed)
inline

◆ SetOutput()

void CCgiResponse::SetOutput ( CNcbiOstream os,
int  fd = -1 
)

Set output stream (NULL here means "no output stream").

This does not flush the previous stream (if any), so some data may be lost.

Definition at line 223 of file ncbicgir.cpp.

References CCgiResponse::m_HeaderWritten, CCgiResponse::m_Output, CCgiResponse::m_OutputExpt, CCgiResponse::m_OutputFD, CCgiResponse::m_ThrowOnBadOutput, output, and CCgiResponse::x_RestoreOutputExceptions().

Referenced by CCgiResponse::CCgiResponse(), and CAsBodyDiagFactory::New().

◆ SetPath()

void CCgiCookie::SetPath ( const string str)
inline

◆ SetPosition() [1/2]

unsigned int& CCgiEntry::SetPosition ( void  )
inline

Definition at line 519 of file ncbicgi.hpp.

References CCgiEntry::m_Data, and CCgiEntry::x_ForceUnique().

Referenced by CCgiEntry::operator=().

◆ SetPosition() [2/2]

void CCgiEntry::SetPosition ( int  p)
inline

Definition at line 521 of file ncbicgi.hpp.

References CCgiEntry::m_Data, and CCgiEntry::x_ForceUnique().

◆ SetRawCgi()

void CCgiResponse::SetRawCgi ( bool  is_raw)
inline

Definition at line 327 of file ncbicgir.hpp.

References CCgiResponse::m_IsRawCgi.

◆ SetRequestMethod()

void CCgiResponse::SetRequestMethod ( CCgiRequest::ERequestMethod  method)
inline

Set HTTP request method.

Definition at line 422 of file ncbicgir.hpp.

References CCgiResponse::m_RequestMethod.

Referenced by CCgiContext::CCgiContext().

◆ SetRetryContext()

void CCgiResponse::SetRetryContext ( const CRetryContext ctx)

Set retry headers from the context.

Definition at line 600 of file ncbicgir.cpp.

References ctx, ITERATE, and CCgiResponse::SetHeaderValue().

◆ SetSecure() [1/2]

void CCgiCookie::SetSecure ( bool  secure)
inline

Definition at line 1022 of file ncbicgi.hpp.

References CCgiCookie::m_Secure.

Referenced by CCgiApplication::AddLBCookie(), and CCgiResponse::WriteHeader().

◆ SetSecure() [2/2]

void CCgiCookies::SetSecure ( bool  secure)
inline

Set secure connection flag.

Affects printing of cookies: secure cookies can be sent only trough secure connections.

Definition at line 320 of file ncbicgi.hpp.

References CCgiCookies::m_Secure.

Referenced by CCgiContext::x_InitSession().

◆ SetStatus()

void CCgiResponse::SetStatus ( unsigned int  code,
const string reason = kEmptyStr 
)

◆ SetThrowOnBadOutput()

void CCgiResponse::SetThrowOnBadOutput ( bool  throw_on_bad_output)

If set to TRUE then the writes to a "bad" output stream will throw exceptions of type std::ios_base::failure.

See also
GetOutput()

Definition at line 563 of file ncbicgir.cpp.

References CCgiResponse::m_Output, CCgiResponse::m_OutputExpt, and CCgiResponse::m_ThrowOnBadOutput.

Referenced by CCgiResponse::GetOutput().

◆ SetTrackingCookie() [1/2]

void CCgiRequest::SetTrackingCookie ( const string cookie_value)
inline

Store/retrieve tracking cookie value.

Unlike CCgiResponse or CRequestContext, this value is not empty only if the tracking ID was actually received in the request.

Definition at line 925 of file ncbicgi.hpp.

References CCgiRequest::m_TrackingCookie.

◆ SetTrackingCookie() [2/2]

void CCgiResponse::SetTrackingCookie ( const string name,
const string value,
const string domain,
const string path,
const CTime exp_time = CTime() 
)

◆ SetTrailerValue()

void CCgiResponse::SetTrailerValue ( const string name,
const string value 
)

Set trailer value.

The trailer should have been added using AddTrailer().

Definition at line 743 of file ncbicgir.cpp.

References ERR_POST_X, CCgiResponse::HaveTrailer(), CCgiResponse::m_TrailerValues, NCBI_THROW, rapidjson::value, and CCgiResponse::x_ValidateHeader().

◆ SetUrlEncodeFlag()

void CCgiCookies::SetUrlEncodeFlag ( EUrlEncode  encode_flag)
inline

Definition at line 1107 of file ncbicgi.hpp.

References CCgiCookies::m_EncodeFlag.

Referenced by CCgiRequest::x_Init().

◆ SetValue() [1/5]

string& CCgiEntry::SetValue ( void  )
inline

◆ SetValue() [2/5]

void CCgiEntry::SetValue ( CNcbiIstream is,
EOwnership  own = eNoOwnership 
)
inline

Definition at line 481 of file ncbicgi.hpp.

References CCgiEntry::m_Data, and CCgiEntry::x_ForceUnique().

◆ SetValue() [3/5]

void CCgiCookie::SetValue ( const string str)
inline

All SetXXX(const string&) methods beneath:

  • set the property to "str" if "str" has valid format
  • throw the "invalid_argument" if "str" has invalid format

Definition at line 1007 of file ncbicgi.hpp.

References CCgiCookie::fInvalid_Value, CCgiCookie::m_InvalidFlag, CCgiCookie::m_Value, and str().

Referenced by CCgiCookies::Add(), and CCgiCookie::CCgiCookie().

◆ SetValue() [4/5]

void CCgiEntry::SetValue ( const string v)
inline

Definition at line 477 of file ncbicgi.hpp.

References CCgiEntry::m_Data, and CCgiEntry::x_ForceUnique().

◆ SetValue() [5/5]

void CCgiEntry::SetValue ( IReader r)
inline

Definition at line 479 of file ncbicgi.hpp.

References CCgiEntry::m_Data, r(), and CCgiEntry::x_ForceUnique().

◆ size()

SIZE_TYPE CCgiEntry::size ( void  ) const
inline

commonly-requested string:: operations...

Definition at line 537 of file ncbicgi.hpp.

References CCgiEntry::GetValue().

◆ substr()

string CCgiEntry::substr ( SIZE_TYPE  i = 0,
SIZE_TYPE  n = NPOS 
) const
inline

Definition at line 542 of file ncbicgi.hpp.

References CCgiEntry::GetValue(), i, and n.

Referenced by CCgiStatistics::Compose_Entries().

◆ Write() [1/2]

CNcbiOstream & CCgiCookies::Write ( CNcbiOstream os,
CCgiCookie::EWriteMethod  wmethod = CCgiCookie::eHTTPResponse 
) const

◆ Write() [2/2]

CNcbiOstream & CCgiCookie::Write ( CNcbiOstream os,
EWriteMethod  wmethod = eHTTPResponse,
EUrlEncode  flag = eUrlEncode_SkipMarkChars 
) const

Compose and write to output stream "os":

Parameters
wmethod
  • eHTTPResponse: "Set-Cookie: name=value; expires=date; path=val_path; domain=dom_name; secure\r\n" Here, only "name=value" is mandatory, and other parts are optional
  • eHTTPRequest: "name=value" Here, only "name=value" is printed, all other parts are ignored

Definition at line 232 of file ncbicgi.cpp.

References CCgiCookie::eField_Name, CCgiCookie::eField_Value, CCgiCookie::eHTTPResponse, CCgiCookie::fInvalid_Name, CCgiCookie::fInvalid_Value, CCgiCookie::GetExpDate(), HTTP_EOL, CCgiCookie::m_Domain, CCgiCookie::m_HttpOnly, CCgiCookie::m_InvalidFlag, CCgiCookie::m_Name, CCgiCookie::m_Path, CCgiCookie::m_Secure, CCgiCookie::m_Value, NCBI_THROW2, NStr::PrintableString(), and CCgiCookie::x_EncodeCookie().

Referenced by operator<<().

◆ WriteHeader() [1/2]

CNcbiOstream & CCgiResponse::WriteHeader ( CNcbiOstream os) const

Definition at line 266 of file ncbicgir.cpp.

References CCgiCookies::Add(), CCgiException::e200_Ok, CRequestStatus::e204_NoContent, CCgiStreamWrapper::eBlockWrites, CCgiStreamWrapper::eChunkedWrites, CCgiUserAgent::eEngine_IE, CCgiRequest::eMethod_HEAD, map_checker< Container >::empty(), CCgiCookies::Empty(), CCgiResponse::eMultipart_mixed, CCgiResponse::eMultipart_none, CCgiResponse::eMultipart_related, CCgiResponse::eMultipart_replace, map_checker< Container >::end(), NStr::eNocase, NStr::EqualNocase(), ERR_POST_X_ONCE, failure, NStr::FindNoCase(), CCgiCookies::GetAllCookiesHttpOnly(), CCgiCookies::GetAllCookiesSecure(), CCgiResponse::GetChunkedTransferEnabled(), GetDiagContext(), CCgiResponse::GetHeaderValue(), CRequestContext::GetNextSubHitID(), CDiagContext::GetRequestContext(), CRequestContext::GetRequestStatus(), CCgiSession::GetSessionCookie(), CCgiResponse::HaveHeaderValue(), HTTP_EOL, i, CCgiResponse::IsRawCgi(), ITERATE, map_checker< Container >::lower_bound(), CCgiResponse::m_Boundary, CCgiResponse::m_Cookies, CCgiResponse::m_DisableTrackingCookie, CCgiResponse::m_ExceptionAfterHEAD, CCgiResponse::m_HeaderValues, CCgiResponse::m_HeaderWritten, CCgiResponse::m_IsMultipart, CCgiResponse::m_JQuery_Callback, CCgiResponse::m_Output, CCgiResponse::m_RequestMethod, CCgiResponse::m_Session, CCgiResponse::m_TrackingCookie, CCgiResponse::m_TrailerValues, NCBI_CGI_THROW_WITH_STATUS, NCBI_THROW, NPOS, NStr::ReplaceInPlace(), CCgiResponse::SetHeaderValue(), CCgiCookie::SetHttpOnly(), CCgiCookie::SetSecure(), CCgiStreamWrapper::SetWriterMode(), CCgiResponse::sm_CacheControl, CCgiResponse::sm_ContentTypeDefault, CCgiResponse::sm_ContentTypeMixed, CCgiResponse::sm_ContentTypeName, CCgiResponse::sm_ContentTypeRelated, CCgiResponse::sm_ContentTypeXMR, CCgiResponse::sm_HTTPStatusDefault, CCgiResponse::sm_HTTPStatusName, NStr::StartsWith(), and Warning().

◆ WriteHeader() [2/2]

CNcbiOstream & CCgiResponse::WriteHeader ( void  ) const
inline

◆ x_CheckField() [1/2]

CCgiCookies::ECheckResult CCgiCookies::x_CheckField ( const string str,
CCgiCookie::EFieldType  ftype,
const char *  banned_symbols,
EOnBadCookie  on_bad_cookie,
const string cookie_name = NULL 
)
staticprivate

◆ x_CheckField() [2/2]

void CCgiCookie::x_CheckField ( const string str,
EFieldType  ftype,
const char *  banned_symbols,
const string cookie_name = NULL 
)
staticprivate

◆ x_ClientSupportsChunkedTransfer()

bool CCgiResponse::x_ClientSupportsChunkedTransfer ( const CNcbiEnvironment env)
staticprivate

◆ x_DelimitedRead()

CCgiEntryReaderContext::EReadTerminator CCgiEntryReaderContext::x_DelimitedRead ( string s,
SIZE_TYPE  n = NPOS 
)
private

◆ x_EncodeCookie()

string CCgiCookie::x_EncodeCookie ( const string str,
EFieldType  ftype,
NStr::EUrlEncode  flag 
)
staticprivate

◆ x_FillBuffer()

void CCgiEntryReader::x_FillBuffer ( SIZE_TYPE  count)
private

◆ x_Flush()

void CCgiEntryReader::x_Flush ( void  )
inlineprivate

◆ x_FlushCurrentEntry()

void CCgiEntryReaderContext::x_FlushCurrentEntry ( void  )
private

◆ x_ForceComplete()

void CCgiEntry::x_ForceComplete ( ) const
inlineprivate

◆ x_ForceUnique()

void CCgiEntry::x_ForceUnique ( )
inlineprivate

◆ x_GetCharset()

string CCgiEntry::x_GetCharset ( void  ) const
private

Definition at line 1842 of file ncbicgi.cpp.

References NStr::FindNoCase(), CCgiEntry::GetContentType(), kEmptyStr, and NPOS.

Referenced by CCgiEntry::GetValueAsUTF8().

◆ x_GetPropertyByName()

const string & CCgiRequest::x_GetPropertyByName ( const string name) const
private

◆ x_GetString()

static bool CCgiCookie::x_GetString ( string str,
const string val 
)
staticprivate

◆ x_HitBoundary()

void CCgiEntryReader::x_HitBoundary ( bool  final)
private

◆ x_Init()

void CCgiRequest::x_Init ( const CNcbiArguments args,
const CNcbiEnvironment env,
CNcbiIstream istr,
TFlags  flags,
int  ifd 
)
private

◆ x_InitRequestContext()

void CCgiRequest::x_InitRequestContext ( TFlags  flags)
private

◆ x_ProcessInputStream()

void CCgiRequest::x_ProcessInputStream ( TFlags  flags,
CNcbiIstream istr,
int  ifd 
)
private

◆ x_ProcessQueryString()

void CCgiRequest::x_ProcessQueryString ( TFlags  flags,
const CNcbiArguments args 
)
private

◆ x_ReadMultipartHeaders()

void CCgiEntryReaderContext::x_ReadMultipartHeaders ( string name,
string filename,
string content_type 
)
private

◆ x_ReadURLEncodedEntry()

void CCgiEntryReaderContext::x_ReadURLEncodedEntry ( string name,
string value 
)
private

◆ x_RestoreOutputExceptions()

void CCgiResponse::x_RestoreOutputExceptions ( void  )
private

◆ x_RetrieveSessionId()

string CCgiRequest::x_RetrieveSessionId ( ) const
private

◆ x_SetClientIpProperty()

void CCgiRequest::x_SetClientIpProperty ( TFlags  flags) const
private

◆ x_SetSession() [1/2]

void CCgiRequest::x_SetSession ( CCgiSession session)
inline

Definition at line 1204 of file ncbicgi.hpp.

References CCgiRequest::m_Session.

◆ x_SetSession() [2/2]

void CCgiResponse::x_SetSession ( const CCgiSession session)
inline

Definition at line 416 of file ncbicgir.hpp.

References CCgiResponse::m_Session.

Referenced by CCgiContext::x_InitSession().

◆ x_ValidateHeader()

bool CCgiResponse::x_ValidateHeader ( const string name,
const string value 
) const
private

Definition at line 131 of file ncbicgir.cpp.

References NPOS, and rapidjson::value.

Referenced by CCgiResponse::SetHeaderValue(), and CCgiResponse::SetTrailerValue().

◆ ~CCgiCookies()

CCgiCookies::~CCgiCookies ( void  )
inline

Destructor.

Definition at line 1123 of file ncbicgi.hpp.

References CCgiCookies::Clear().

◆ ~CCgiEntryReader()

CCgiEntryReader::~CCgiEntryReader ( )
private

◆ ~CCgiEntryReaderContext()

CCgiEntryReaderContext::~CCgiEntryReaderContext ( )

◆ ~CCgiRequest()

CCgiRequest::~CCgiRequest ( void  )

Destructor.

Definition at line 999 of file ncbicgi.cpp.

References CCgiRequest::SetInputStream().

◆ ~CCgiResponse()

CCgiResponse::~CCgiResponse ( void  )

Definition at line 105 of file ncbicgir.cpp.

References CCgiResponse::x_RestoreOutputExceptions().

◆ ~CEntryCollector_Base()

virtual CEntryCollector_Base::~CEntryCollector_Base ( void  )
inlinevirtual

Definition at line 652 of file ncbicgi.hpp.

◆ ~CExtraEntryCollector()

CExtraEntryCollector::~CExtraEntryCollector ( void  )
inlineoverride

Definition at line 663 of file ncbicgi.hpp.

◆ ~CRefArgs()

CRefArgs::~CRefArgs ( void  )

Definition at line 66 of file ref_args.cpp.

Variable Documentation

◆ CGI

CGI

Definition at line 359 of file ncbicgi.hpp.

◆ kContentLengthUnknown

const size_t CCgiRequest::kContentLengthUnknown = (size_t)(-1)
static

Get content length using value of the property 'eCgi_ContentLength'.

Return "kContentLengthUnknown" if Content-Length header is missing.

Definition at line 781 of file ncbicgi.hpp.

Referenced by CCgiRequest::GetContentLength(), and CCgiEntryReaderContext::x_DelimitedRead().

◆ m_AllHttpOnly

bool CCgiCookies::m_AllHttpOnly
private

◆ m_AllSecure

bool CCgiCookies::m_AllSecure
private

◆ m_Args

CDiagContext_Extra::TExtraArgs CExtraEntryCollector::m_Args
private

Definition at line 673 of file ncbicgi.hpp.

Referenced by CExtraEntryCollector::AddEntry(), and CExtraEntryCollector::GetArgs().

◆ m_BetweenParts

bool CCgiResponse::m_BetweenParts
protected

Definition at line 271 of file ncbicgir.hpp.

Referenced by CCgiResponse::BeginPart(), and CCgiResponse::EndPart().

◆ m_Boundary [1/2]

string CCgiEntryReaderContext::m_Boundary
private

◆ m_Boundary [2/2]

string CCgiResponse::m_Boundary
protected

◆ m_Buffer

string CCgiEntryReader::m_Buffer
private

◆ m_BytePos

SIZE_TYPE CCgiEntryReaderContext::m_BytePos
private

◆ m_ChunkedTransfer

bool CCgiResponse::m_ChunkedTransfer
private

◆ m_Content

unique_ptr<string> CCgiRequest::m_Content
private

Original request content or NULL if fSaveRequestContent is not set.

Definition at line 933 of file ncbicgi.hpp.

Referenced by CCgiRequest::GetContent(), and CCgiRequest::x_ProcessInputStream().

◆ m_ContentLength

size_t CCgiEntryReaderContext::m_ContentLength
private

Definition at line 124 of file cgi_entry_reader.hpp.

Referenced by CCgiEntryReaderContext::x_DelimitedRead().

◆ m_ContentLog

string* CCgiEntryReaderContext::m_ContentLog
private

Definition at line 126 of file cgi_entry_reader.hpp.

Referenced by CCgiEntryReaderContext::x_DelimitedRead().

◆ m_ContentType [1/2]

EContentType CCgiEntryReaderContext::m_ContentType
private

◆ m_ContentType [2/2]

string CCgiEntry::SData::m_ContentType

Definition at line 436 of file ncbicgi.hpp.

◆ m_ContentTypeDeclared

bool CCgiEntryReaderContext::m_ContentTypeDeclared
private

Definition at line 123 of file cgi_entry_reader.hpp.

Referenced by CCgiEntryReaderContext::x_ReadURLEncodedEntry().

◆ m_Context

TContext& CCgiEntryReader::m_Context
private

◆ m_Cookies [1/3]

TSet CCgiCookies::m_Cookies
private

◆ m_Cookies [2/3]

CCgiCookies CCgiRequest::m_Cookies
private

set of the request cookies(already retrieved; cached)

Definition at line 939 of file ncbicgi.hpp.

Referenced by CCgiRequest::GetCookies(), CCgiRequest::x_Init(), and CCgiRequest::x_InitRequestContext().

◆ m_Cookies [3/3]

CCgiCookies CCgiResponse::m_Cookies
protected

Definition at line 275 of file ncbicgir.hpp.

Referenced by CCgiResponse::Cookies(), and CCgiResponse::WriteHeader().

◆ m_CurrentEntry

CCgiEntry* CCgiEntryReaderContext::m_CurrentEntry
private

◆ m_CurrentReader

TReader* CCgiEntryReaderContext::m_CurrentReader
private

◆ m_Data

CRef<SData> CCgiEntry::m_Data
private

◆ m_DisableTrackingCookie

bool CCgiResponse::m_DisableTrackingCookie
private

Definition at line 295 of file ncbicgir.hpp.

Referenced by CCgiResponse::DisableTrackingCookie(), and CCgiResponse::WriteHeader().

◆ m_Domain

string CCgiCookie::m_Domain
private

◆ m_EncodeFlag

NStr::EUrlEncode CCgiCookies::m_EncodeFlag
private

◆ m_Entries

TCgiEntries CCgiRequest::m_Entries
private

◆ m_EntryReaderContext

CCgiEntryReaderContext* CCgiRequest::m_EntryReaderContext
private

◆ m_Env

const CNcbiEnvironment* CCgiRequest::m_Env
private

◆ m_ErrBufSize

size_t CCgiRequest::m_ErrBufSize
private

Request initialization error buffer size; when initialization code hits unexpected EOF it will try to add diagnostics and print out accumulated request buffer 0 in this variable means no buffer diagnostics.

Definition at line 949 of file ncbicgi.hpp.

◆ m_ExceptionAfterHEAD

TCGI_ExceptionAfterHEAD CCgiResponse::m_ExceptionAfterHEAD
private

Definition at line 303 of file ncbicgir.hpp.

Referenced by CCgiResponse::SetExceptionAfterHEAD(), and CCgiResponse::WriteHeader().

◆ m_Expires

tm CCgiCookie::m_Expires
private

◆ m_Filename

string CCgiEntry::SData::m_Filename

Definition at line 436 of file ncbicgi.hpp.

◆ m_HeaderValues

TMap CCgiResponse::m_HeaderValues
protected

◆ m_HeaderWritten

bool CCgiResponse::m_HeaderWritten
mutableprotected

◆ m_HostMap

THostMap CRefArgs::m_HostMap
private

◆ m_HttpOnly

bool CCgiCookie::m_HttpOnly
private

◆ m_In

CNcbiIstream& CCgiEntryReaderContext::m_In
private

◆ m_Indexes

TCgiIndexes CCgiRequest::m_Indexes
private

set of the request ISINDEX-like indexes(already retrieved; cached)

Definition at line 937 of file ncbicgi.hpp.

Referenced by CCgiRequest::GetCGIEntries(), CCgiRequest::GetIndexes(), and CCgiRequest::x_ProcessQueryString().

◆ m_Input

CNcbiIstream* CCgiRequest::m_Input
private

◆ m_InputFD

int CCgiRequest::m_InputFD
private

input file descriptor, if available.

Definition at line 943 of file ncbicgi.hpp.

Referenced by CCgiRequest::GetInputFD(), CCgiRequest::SetInputStream(), and CCgiRequest::x_ProcessInputStream().

◆ m_InvalidFlag

TInvalidFlag CCgiCookie::m_InvalidFlag
private

◆ m_IsMultipart

EMultipartMode CCgiResponse::m_IsMultipart
protected

◆ m_IsRawCgi

bool CCgiResponse::m_IsRawCgi
protected

Definition at line 269 of file ncbicgir.hpp.

Referenced by CCgiResponse::IsRawCgi(), and CCgiResponse::SetRawCgi().

◆ m_JQuery_Callback

string CCgiResponse::m_JQuery_Callback
private

◆ m_Name

string CCgiCookie::m_Name
private

◆ m_Out

TCgiEntries& CCgiEntryReaderContext::m_Out
private

◆ m_OutIter

TCgiEntriesI CCgiEntryReaderContext::m_OutIter
private

◆ m_OutIterated

bool CCgiEntryReaderContext::m_OutIterated
private

◆ m_Output

CNcbiOstream* CCgiResponse::m_Output
protected

◆ m_OutputExpt

CNcbiOstream::iostate CCgiResponse::m_OutputExpt
protected

◆ m_OutputFD

int CCgiResponse::m_OutputFD
protected

Definition at line 277 of file ncbicgir.hpp.

Referenced by CCgiResponse::GetOutputFD(), and CCgiResponse::SetOutput().

◆ m_OwnEnv

unique_ptr<CNcbiEnvironment> CCgiRequest::m_OwnEnv
private

Definition at line 931 of file ncbicgi.hpp.

Referenced by CCgiRequest::Deserialize(), and CCgiRequest::x_Init().

◆ m_OwnInput

bool CCgiRequest::m_OwnInput
private

Definition at line 944 of file ncbicgi.hpp.

Referenced by CCgiRequest::SetInputStream(), and CCgiRequest::x_ProcessInputStream().

◆ m_Path

string CCgiCookie::m_Path
private

◆ m_Position [1/2]

unsigned int CCgiEntryReaderContext::m_Position
private

Definition at line 127 of file cgi_entry_reader.hpp.

Referenced by CCgiEntryReaderContext::GetNextEntry().

◆ m_Position [2/2]

unsigned int CCgiEntry::SData::m_Position

Definition at line 437 of file ncbicgi.hpp.

◆ m_QueryStringParsed

bool CCgiRequest::m_QueryStringParsed
private

◆ m_Reader

unique_ptr<IReader> CCgiEntry::SData::m_Reader

Definition at line 438 of file ncbicgi.hpp.

◆ m_Request

const CCgiRequest* CCgiResponse::m_Request
private

◆ m_RequestMethod

CCgiRequest::ERequestMethod CCgiResponse::m_RequestMethod
protected

◆ m_RequireWriteHeader

bool CCgiResponse::m_RequireWriteHeader
protected

Definition at line 279 of file ncbicgir.hpp.

Referenced by CCgiResponse::Finalize(), and CCgiResponse::RequireWriteHeader().

◆ m_Secure [1/2]

bool CCgiCookie::m_Secure
private

◆ m_Secure [2/2]

bool CCgiCookies::m_Secure
private

Definition at line 344 of file ncbicgi.hpp.

Referenced by CCgiCookies::SetSecure(), and CCgiCookies::Write().

◆ m_Session [1/2]

CCgiSession* CCgiRequest::m_Session
private

Definition at line 980 of file ncbicgi.hpp.

Referenced by CCgiRequest::GetSession(), and CCgiRequest::x_SetSession().

◆ m_Session [2/2]

const CCgiSession* CCgiResponse::m_Session
private

Definition at line 293 of file ncbicgir.hpp.

Referenced by CCgiResponse::WriteHeader(), and CCgiResponse::x_SetSession().

◆ m_State

TState CCgiEntryReader::m_State
private

◆ m_ThrowOnBadOutput

TCGI_ThrowOnBadOutput CCgiResponse::m_ThrowOnBadOutput
private

◆ m_TrackingCookie [1/2]

string CCgiRequest::m_TrackingCookie
private

Definition at line 950 of file ncbicgi.hpp.

Referenced by CCgiRequest::GetTrackingCookie(), and CCgiRequest::SetTrackingCookie().

◆ m_TrackingCookie [2/2]

unique_ptr<CCgiCookie> CCgiResponse::m_TrackingCookie
private

Definition at line 294 of file ncbicgir.hpp.

Referenced by CCgiResponse::SetTrackingCookie(), and CCgiResponse::WriteHeader().

◆ m_TrackingEnvHolder

unique_ptr<CTrackingEnvHolder> CCgiRequest::m_TrackingEnvHolder
mutableprivate

Definition at line 979 of file ncbicgi.hpp.

Referenced by CCgiRequest::GetClientTrackingEnv().

◆ m_TrailerEnabled

unique_ptr<bool> CCgiResponse::m_TrailerEnabled
mutableprivate

Definition at line 307 of file ncbicgir.hpp.

Referenced by CCgiResponse::CanSendTrailer().

◆ m_TrailerValues

TMap CCgiResponse::m_TrailerValues
protected

◆ m_Value [1/2]

string CCgiCookie::m_Value
private

◆ m_Value [2/2]

string CCgiEntry::SData::m_Value

Definition at line 436 of file ncbicgi.hpp.

◆ NCBI_XCGI_EXPORT

NCBI_XCGI_EXPORT

Parameter to control error handling of incoming cookies.

Does not affect error handling of outgoing cookies set by the application.

Definition at line 357 of file ncbicgi.hpp.

◆ On_Bad_Cookie

On_Bad_Cookie

Definition at line 359 of file ncbicgi.hpp.

◆ sm_AcceptRanges

const char * CCgiResponse::sm_AcceptRanges = "Accept-Ranges"
staticprotected

Definition at line 263 of file ncbicgir.hpp.

Referenced by CCgiResponse::AcceptRangesBytes().

◆ sm_AcceptRangesBytes

const char * CCgiResponse::sm_AcceptRangesBytes = "bytes"
staticprotected

Definition at line 264 of file ncbicgir.hpp.

Referenced by CCgiResponse::AcceptRangesBytes().

◆ sm_BoundaryPrefix

const char * CCgiResponse::sm_BoundaryPrefix = "NCBI_CGI_Boundary_"
staticprotected

Definition at line 261 of file ncbicgir.hpp.

Referenced by CCgiResponse::SetMultipartMode().

◆ sm_CacheControl

const char * CCgiResponse::sm_CacheControl = "Cache-Control"
staticprotected

Definition at line 262 of file ncbicgir.hpp.

Referenced by CCgiResponse::WriteHeader().

◆ sm_ContentDispoName

const char * CCgiResponse::sm_ContentDispoName = "Content-Disposition"
staticprotected

Definition at line 257 of file ncbicgir.hpp.

Referenced by CCgiResponse::BeginPart(), and CCgiResponse::SetFilename().

◆ sm_ContentRange

const char * CCgiResponse::sm_ContentRange = "Content-Range"
staticprotected

Definition at line 265 of file ncbicgir.hpp.

Referenced by CCgiResponse::HaveContentRange().

◆ sm_ContentTypeDefault

const char * CCgiResponse::sm_ContentTypeDefault = "text/html"
staticprotected

Definition at line 253 of file ncbicgir.hpp.

Referenced by CCgiResponse::BeginPart(), and CCgiResponse::WriteHeader().

◆ sm_ContentTypeMixed

const char * CCgiResponse::sm_ContentTypeMixed = "multipart/mixed"
staticprotected

Definition at line 254 of file ncbicgir.hpp.

Referenced by CCgiResponse::WriteHeader().

◆ sm_ContentTypeName

const char * CCgiResponse::sm_ContentTypeName = "Content-Type"
staticprotected

◆ sm_ContentTypeRelated

const char * CCgiResponse::sm_ContentTypeRelated = "multipart/related"
staticprotected

Definition at line 255 of file ncbicgir.hpp.

Referenced by CCgiResponse::WriteHeader().

◆ sm_ContentTypeXMR

const char * CCgiResponse::sm_ContentTypeXMR = "multipart/x-mixed-replace"
staticprotected

Definition at line 256 of file ncbicgir.hpp.

Referenced by CCgiResponse::WriteHeader().

◆ sm_FilenamePrefix

const char * CCgiResponse::sm_FilenamePrefix = "attachment; filename=\""
staticprotected

Definition at line 258 of file ncbicgir.hpp.

Referenced by CCgiResponse::BeginPart(), and CCgiResponse::SetFilename().

◆ sm_HTTPStatusDefault

const char * CCgiResponse::sm_HTTPStatusDefault = "200 OK"
staticprotected

Definition at line 260 of file ncbicgir.hpp.

Referenced by CCgiResponse::WriteHeader().

◆ sm_HTTPStatusName

const char * CCgiResponse::sm_HTTPStatusName = "Status"
staticprotected

Definition at line 259 of file ncbicgir.hpp.

Referenced by CCgiResponse::SetStatus(), and CCgiResponse::WriteHeader().

◆ sm_LocationName

const char * CCgiResponse::sm_LocationName = "Location"
staticprotected

Definition at line 252 of file ncbicgir.hpp.

Referenced by CCgiResponse::SetLocation().

Friends

◆ CCgiApplication

friend class CCgiApplication
friend

Definition at line 310 of file ncbicgir.hpp.

◆ CCgiContext

friend class CCgiContext
friend

Definition at line 309 of file ncbicgir.hpp.

◆ CCgiCookies

friend class CCgiCookies
friend

Definition at line 181 of file ncbicgi.hpp.

◆ CCgiEntryReader

friend class CCgiEntryReader
friend

Definition at line 132 of file cgi_entry_reader.hpp.

Referenced by CCgiEntryReaderContext::GetNextEntry().

◆ CCgiEntryReaderContext

friend class CCgiEntryReaderContext
friend

Definition at line 80 of file cgi_entry_reader.hpp.

Modified on Fri Sep 20 14:57:33 2024 by modify_doxy.py rev. 669887