sipxtacklib  Version 3.3
Public Types | Public Member Functions | Static Public Member Functions | List of all members
HttpRequestContext Class Reference

#include <HttpRequestContext.h>

Public Types

enum  RequestEnvironmentVariables {
  HTTP_ENV_RAW_URL = 0,
  HTTP_ENV_UNMAPPED_FILE,
  HTTP_ENV_MAPPED_FILE,
  HTTP_ENV_QUERY_STRING,
  HTTP_ENV_SERVER_NAME,
  HTTP_ENV_REQUEST_METHOD,
  HTTP_ENV_USER,
  HTTP_ENV_LAST
}
 
typedef void(* UnEscapeFunction) (UtlString &)
 

Public Member Functions

 HttpRequestContext (const char *requestMethod=NULL, const char *rawUrl=NULL, const char *mappedFile=NULL, const char *serverName=NULL, const char *userId=NULL, const OsConnectionSocket *connection=NULL)
 Construct the context for an HTTP request. More...
 
virtual ~HttpRequestContext ()
 
void extractPostCgiVariables (const HttpBody &body)
 
 HttpRequestContext (const HttpRequestContext &rHttpRequestContext)
 
HttpRequestContextoperator= (const HttpRequestContext &rhs)
 
void getEnvironmentVariable (enum RequestEnvironmentVariables envVariable, UtlString &value) const
 
UtlBoolean getCgiVariable (const char *name, UtlString &value, int occurance=0) const
 
UtlBoolean getCgiVariable (int index, UtlString &name, UtlString &value) const
 returns: TRUE/FALSE if the occurance of the named variable exists More...
 
bool isEncrypted () const
 Test whether or not the client connection is encrypted. More...
 
bool isTrustedPeer (const UtlString &peername) const
 Test whether or not the given name is the SSL client that sent this request. More...
 

Static Public Member Functions

static void parseCgiVariables (const char *queryString, UtlList &cgiVariableList, const char *pairSeparator="&", const char *namValueSeparator="=", UtlBoolean nameIsCaseInsensitive=TRUE, UnEscapeFunction unescape=&HttpMessage::unescape)
 

Member Typedef Documentation

typedef void(* UnEscapeFunction) (UtlString &)

Member Enumeration Documentation

Enumerator
HTTP_ENV_RAW_URL 
HTTP_ENV_UNMAPPED_FILE 
HTTP_ENV_MAPPED_FILE 
HTTP_ENV_QUERY_STRING 
HTTP_ENV_SERVER_NAME 
HTTP_ENV_REQUEST_METHOD 
HTTP_ENV_USER 
HTTP_ENV_LAST 

Constructor & Destructor Documentation

HttpRequestContext ( const char *  requestMethod = NULL,
const char *  rawUrl = NULL,
const char *  mappedFile = NULL,
const char *  serverName = NULL,
const char *  userId = NULL,
const OsConnectionSocket *  connection = NULL 
)

Construct the context for an HTTP request.

~HttpRequestContext ( )
virtual
HttpRequestContext ( const HttpRequestContext rHttpRequestContext)

Member Function Documentation

void extractPostCgiVariables ( const HttpBody body)
void parseCgiVariables ( const char *  queryString,
UtlList &  cgiVariableList,
const char *  pairSeparator = "&",
const char *  namValueSeparator = "=",
UtlBoolean  nameIsCaseInsensitive = TRUE,
UnEscapeFunction  unescape = &HttpMessage::unescape 
)
static
HttpRequestContext & operator= ( const HttpRequestContext rhs)
void getEnvironmentVariable ( enum RequestEnvironmentVariables  envVariable,
UtlString &  value 
) const
UtlBoolean getCgiVariable ( const char *  name,
UtlString &  value,
int  occurance = 0 
) const
UtlBoolean getCgiVariable ( int  index,
UtlString &  name,
UtlString &  value 
) const

returns: TRUE/FALSE if the occurance of the named variable exists

bool isEncrypted ( ) const

Test whether or not the client connection is encrypted.

bool isTrustedPeer ( const UtlString &  peername) const

Test whether or not the given name is the SSL client that sent this request.

This tests the host identity provided by the SSL handshake; it does not test the HTTP user identity.

Returns
  • true if the connection is SSL and the peername matches a name in the peer certificate.
  • false if not.

sipXtackLib home page