MythTV  0.28pre
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
HTTPRequest Class Referenceabstract

#include <httprequest.h>

Inheritance diagram for HTTPRequest:
Inheritance graph
[legend]
Collaboration diagram for HTTPRequest:
Collaboration graph
[legend]

Public Member Functions

 HTTPRequest ()
 
virtual ~HTTPRequest ()
 
bool ParseRequest ()
 
void FormatErrorResponse (bool bServerError, const QString &sFaultString, const QString &sDetails)
 
void FormatActionResponse (Serializer *ser)
 
void FormatActionResponse (const NameValues &pArgs)
 
void FormatFileResponse (const QString &sFileName)
 
void FormatRawResponse (const QString &sXML)
 
qint64 SendResponse (void)
 
qint64 SendResponseFile (QString sFileName)
 
void SetResponseHeader (const QString &sKey, const QString &sValue, bool replace=false)
 
void SetCookie (const QString &sKey, const QString &sValue, const QDateTime &dtExpires, bool secure)
 
QString GetRequestHeader (const QString &sKey, QString sDefault)
 
bool GetKeepAlive ()
 
SerializerGetSerializer ()
 
QByteArray GetResponsePage (void)
 
QString GetRequestProtocol () const
 
QString GetResponseProtocol () const
 
QString GetRequestType () const
 
void SetKeepAliveTimeout (int nTimeout)
 
bool IsUrlProtected (const QString &sBaseUrl)
 
virtual QString ReadLine (int msecs)=0
 
virtual qint64 ReadBlock (char *pData, qint64 nMaxLen, int msecs=0)=0
 
virtual qint64 WriteBlock (const char *pData, qint64 nLen)=0
 
virtual QString GetHostName ()
 
virtual QString GetHostAddress ()=0
 
virtual quint16 GetHostPort ()=0
 
virtual QString GetPeerAddress ()=0
 
virtual int getSocketHandle ()=0
 

Static Public Member Functions

static QString GetMimeType (const QString &sFileExtension)
 
static QStringList GetSupportedMimeTypes ()
 
static QString TestMimeType (const QString &sFileName)
 
static long GetParameters (QString sParams, QStringMap &mapParams)
 
static QString Encode (const QString &sIn)
 
static QString Decode (const QString &sIn)
 
static QString GetETagHash (const QByteArray &data)
 

Public Attributes

RequestType m_eType
 
ContentType m_eContentType
 
QString m_sRawRequest
 
QString m_sRequestUrl
 
QString m_sBaseUrl
 
QString m_sResourceUrl
 
QString m_sMethod
 
QStringMap m_mapParams
 
QStringMap m_mapHeaders
 
QStringMap m_mapCookies
 
QString m_sPayload
 
QString m_sProtocol
 
int m_nMajor
 
int m_nMinor
 
bool m_bProtected
 
bool m_bEncrypted
 
bool m_bSOAPRequest
 
QString m_sNameSpace
 
ResponseType m_eResponseType
 
QString m_sResponseTypeText
 
long m_nResponseStatus
 
QStringMap m_mapRespHeaders
 
QString m_sFileName
 
QBuffer m_response
 
IPostProcessm_pPostProcess
 
QString m_sPrivateToken
 
MythUserSession m_userSession
 

Protected Member Functions

RequestType SetRequestType (const QString &sType)
 
void SetRequestProtocol (const QString &sLine)
 
ContentType SetContentType (const QString &sType)
 
void ProcessRequestLine (const QString &sLine)
 
bool ProcessSOAPPayload (const QString &sSOAPAction)
 
void ExtractMethodFromURL ()
 
QString GetResponseStatus (void)
 
QString GetResponseType (void)
 
QString GetResponseHeaders (void)
 
bool ParseRange (QString sRange, long long llSize, long long *pllStart, long long *pllEnd)
 
bool ParseKeepAlive (void)
 
void ParseCookies (void)
 
QString BuildResponseHeader (long long nSize)
 
qint64 SendData (QIODevice *pDevice, qint64 llStart, qint64 llBytes)
 
qint64 SendFile (QFile &file, qint64 llStart, qint64 llBytes)
 
bool IsProtected () const
 
bool IsEncrypted () const
 
bool Authenticated ()
 
QString GetAuthenticationHeader (bool isStale=false)
 
QString CalculateDigestNonce (const QString &timeStamp)
 
bool BasicAuthentication ()
 
bool DigestAuthentication ()
 
void AddCORSHeaders (const QString &sOrigin)
 

Protected Attributes

QRegExp m_procReqLineExp
 
QRegExp m_parseRangeExp
 

Static Protected Attributes

static const char * m_szServerHeaders = "Accept-Ranges: bytes\r\n"
 

Private Attributes

bool m_bKeepAlive
 
uint m_nKeepAliveTimeout
 

Detailed Description

Definition at line 105 of file httprequest.h.

Constructor & Destructor Documentation

§ HTTPRequest()

HTTPRequest::HTTPRequest ( )

Definition at line 162 of file httprequest.cpp.

§ ~HTTPRequest()

virtual HTTPRequest::~HTTPRequest ( )
inlinevirtual

Definition at line 206 of file httprequest.h.

Member Function Documentation

§ SetRequestType()

RequestType HTTPRequest::SetRequestType ( const QString &  sType)
protected

Definition at line 184 of file httprequest.cpp.

Referenced by ProcessRequestLine().

§ SetRequestProtocol()

void HTTPRequest::SetRequestProtocol ( const QString &  sLine)
protected

Definition at line 903 of file httprequest.cpp.

Referenced by ProcessRequestLine().

§ SetContentType()

ContentType HTTPRequest::SetContentType ( const QString &  sType)
protected

Definition at line 948 of file httprequest.cpp.

Referenced by ParseRequest().

§ ProcessRequestLine()

void HTTPRequest::ProcessRequestLine ( const QString &  sLine)
protected

Definition at line 1456 of file httprequest.cpp.

Referenced by ParseRequest().

§ ProcessSOAPPayload()

bool HTTPRequest::ProcessSOAPPayload ( const QString &  sSOAPAction)
protected

Definition at line 1651 of file httprequest.cpp.

Referenced by ParseRequest().

§ ExtractMethodFromURL()

void HTTPRequest::ExtractMethodFromURL ( )
protected

Definition at line 1623 of file httprequest.cpp.

Referenced by ParseRequest().

§ GetResponseStatus()

QString HTTPRequest::GetResponseStatus ( void  )
protected

Definition at line 966 of file httprequest.cpp.

Referenced by BuildResponseHeader(), GetResponsePage(), and SendResponse().

§ GetResponseType()

QString HTTPRequest::GetResponseType ( void  )
protected

Definition at line 1029 of file httprequest.cpp.

Referenced by BuildResponseHeader().

§ GetResponseHeaders()

QString HTTPRequest::GetResponseHeaders ( void  )
protected

Definition at line 1193 of file httprequest.cpp.

Referenced by BuildResponseHeader().

§ ParseRange()

bool HTTPRequest::ParseRange ( QString  sRange,
long long  llSize,
long long pllStart,
long long pllEnd 
)
protected

Definition at line 1523 of file httprequest.cpp.

Referenced by SendResponseFile().

§ ParseKeepAlive()

bool HTTPRequest::ParseKeepAlive ( void  )
protected

Definition at line 1212 of file httprequest.cpp.

Referenced by ParseRequest().

§ ParseCookies()

void HTTPRequest::ParseCookies ( void  )
protected

Definition at line 1246 of file httprequest.cpp.

Referenced by ParseRequest().

§ BuildResponseHeader()

QString HTTPRequest::BuildResponseHeader ( long long  nSize)
protected

Definition at line 211 of file httprequest.cpp.

Referenced by SendResponse(), and SendResponseFile().

§ SendData()

qint64 HTTPRequest::SendData ( QIODevice *  pDevice,
qint64  llStart,
qint64  llBytes 
)
protected

Definition at line 670 of file httprequest.cpp.

Referenced by SendFile(), and SendResponse().

§ SendFile()

qint64 HTTPRequest::SendFile ( QFile &  file,
qint64  llStart,
qint64  llBytes 
)
protected

Definition at line 723 of file httprequest.cpp.

Referenced by SendResponseFile().

§ IsProtected()

bool HTTPRequest::IsProtected ( ) const
inlineprotected

Definition at line 192 of file httprequest.h.

§ IsEncrypted()

bool HTTPRequest::IsEncrypted ( ) const
inlineprotected

Definition at line 193 of file httprequest.h.

Referenced by BasicAuthentication(), DigestAuthentication(), and SetCookie().

§ Authenticated()

bool HTTPRequest::Authenticated ( )
protected

Definition at line 2124 of file httprequest.cpp.

Referenced by ParseRequest().

§ GetAuthenticationHeader()

QString HTTPRequest::GetAuthenticationHeader ( bool  isStale = false)
protected

Definition at line 1860 of file httprequest.cpp.

Referenced by DigestAuthentication(), and ParseRequest().

§ CalculateDigestNonce()

QString HTTPRequest::CalculateDigestNonce ( const QString &  timeStamp)
protected

Definition at line 1890 of file httprequest.cpp.

Referenced by DigestAuthentication(), and GetAuthenticationHeader().

§ BasicAuthentication()

bool HTTPRequest::BasicAuthentication ( )
protected

Definition at line 1902 of file httprequest.cpp.

Referenced by Authenticated().

§ DigestAuthentication()

bool HTTPRequest::DigestAuthentication ( )
protected

Definition at line 1961 of file httprequest.cpp.

Referenced by Authenticated().

§ AddCORSHeaders()

void HTTPRequest::AddCORSHeaders ( const QString &  sOrigin)
protected

Definition at line 2262 of file httprequest.cpp.

Referenced by BuildResponseHeader().

§ ParseRequest()

bool HTTPRequest::ParseRequest ( )

Definition at line 1264 of file httprequest.cpp.

Referenced by HttpWorker::HttpWorker().

§ FormatErrorResponse()

void HTTPRequest::FormatErrorResponse ( bool  bServerError,
const QString &  sFaultString,
const QString &  sDetails 
)

Definition at line 735 of file httprequest.cpp.

Referenced by UPnp::FormatErrorResponse().

§ FormatActionResponse() [1/2]

void HTTPRequest::FormatActionResponse ( Serializer ser)

§ FormatActionResponse() [2/2]

void HTTPRequest::FormatActionResponse ( const NameValues pArgs)

Definition at line 788 of file httprequest.cpp.

§ FormatFileResponse()

void HTTPRequest::FormatFileResponse ( const QString &  sFileName)

§ FormatRawResponse()

void HTTPRequest::FormatRawResponse ( const QString &  sXML)

§ SendResponse()

qint64 HTTPRequest::SendResponse ( void  )

Definition at line 318 of file httprequest.cpp.

Referenced by UPnp::FormatRedirectResponse(), and HttpWorker::HttpWorker().

§ SendResponseFile()

qint64 HTTPRequest::SendResponseFile ( QString  sFileName)

Definition at line 496 of file httprequest.cpp.

Referenced by SendResponse().

§ SetResponseHeader()

void HTTPRequest::SetResponseHeader ( const QString &  sKey,
const QString &  sValue,
bool  replace = false 
)

§ SetCookie()

void HTTPRequest::SetCookie ( const QString &  sKey,
const QString &  sValue,
const QDateTime &  dtExpires,
bool  secure 
)

Definition at line 2160 of file httprequest.cpp.

Referenced by BasicAuthentication(), DigestAuthentication(), and ParseRequest().

§ GetRequestHeader()

QString HTTPRequest::GetRequestHeader ( const QString &  sKey,
QString  sDefault 
)

§ GetKeepAlive()

bool HTTPRequest::GetKeepAlive ( )
inline

Definition at line 232 of file httprequest.h.

Referenced by HttpWorker::HttpWorker().

§ GetSerializer()

Serializer * HTTPRequest::GetSerializer ( )

Definition at line 1757 of file httprequest.cpp.

Referenced by ServiceHost::FormatResponse().

§ GetResponsePage()

QByteArray HTTPRequest::GetResponsePage ( void  )

§ GetRequestProtocol()

QString HTTPRequest::GetRequestProtocol ( ) const

Definition at line 916 of file httprequest.cpp.

Referenced by ServerSideScripting::EvaluatePage().

§ GetResponseProtocol()

QString HTTPRequest::GetResponseProtocol ( ) const

Definition at line 927 of file httprequest.cpp.

Referenced by BuildResponseHeader().

§ GetRequestType()

QString HTTPRequest::GetRequestType ( ) const

Definition at line 2228 of file httprequest.cpp.

Referenced by DigestAuthentication(), and ServerSideScripting::EvaluatePage().

§ GetMimeType()

QString HTTPRequest::GetMimeType ( const QString &  sFileExtension)
static

§ GetSupportedMimeTypes()

QStringList HTTPRequest::GetSupportedMimeTypes ( )
static

Definition at line 1068 of file httprequest.cpp.

Referenced by GetSinkProtocolInfos(), and GetSourceProtocolInfos().

§ TestMimeType()

QString HTTPRequest::TestMimeType ( const QString &  sFileName)
static

§ GetParameters()

long HTTPRequest::GetParameters ( QString  sParams,
QStringMap mapParams 
)
static

Definition at line 1136 of file httprequest.cpp.

Referenced by ParseRequest(), and ProcessRequestLine().

§ Encode()

QString HTTPRequest::Encode ( const QString &  sIn)
static

§ Decode()

QString HTTPRequest::Decode ( const QString &  sIn)
static

Definition at line 1814 of file httprequest.cpp.

§ GetETagHash()

QString HTTPRequest::GetETagHash ( const QByteArray &  data)
static

Definition at line 1830 of file httprequest.cpp.

§ SetKeepAliveTimeout()

void HTTPRequest::SetKeepAliveTimeout ( int  nTimeout)
inline

Definition at line 251 of file httprequest.h.

Referenced by HttpWorker::HttpWorker().

§ IsUrlProtected()

bool HTTPRequest::IsUrlProtected ( const QString &  sBaseUrl)

Definition at line 1841 of file httprequest.cpp.

Referenced by ParseRequest().

§ ReadLine()

virtual QString HTTPRequest::ReadLine ( int  msecs)
pure virtual

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRequest().

§ ReadBlock()

virtual qint64 HTTPRequest::ReadBlock ( char *  pData,
qint64  nMaxLen,
int  msecs = 0 
)
pure virtual

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRequest().

§ WriteBlock()

virtual qint64 HTTPRequest::WriteBlock ( const char *  pData,
qint64  nLen 
)
pure virtual

§ GetHostName()

QString HTTPRequest::GetHostName ( void  )
virtual

Definition at line 2201 of file httprequest.cpp.

Referenced by ServerSideScripting::EvaluatePage().

§ GetHostAddress()

virtual QString HTTPRequest::GetHostAddress ( )
pure virtual

§ GetHostPort()

virtual quint16 HTTPRequest::GetHostPort ( )
pure virtual

§ GetPeerAddress()

virtual QString HTTPRequest::GetPeerAddress ( )
pure virtual

§ getSocketHandle()

virtual int HTTPRequest::getSocketHandle ( )
pure virtual

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRange(), and ParseRequest().

Member Data Documentation

§ m_szServerHeaders

const char * HTTPRequest::m_szServerHeaders = "Accept-Ranges: bytes\r\n"
staticprotected

Definition at line 109 of file httprequest.h.

Referenced by GetResponseHeaders().

§ m_procReqLineExp

QRegExp HTTPRequest::m_procReqLineExp
protected

Definition at line 111 of file httprequest.h.

Referenced by ProcessRequestLine().

§ m_parseRangeExp

QRegExp HTTPRequest::m_parseRangeExp
protected

Definition at line 112 of file httprequest.h.

Referenced by ParseRange().

§ m_eType

RequestType HTTPRequest::m_eType

§ m_eContentType

ContentType HTTPRequest::m_eContentType

Definition at line 117 of file httprequest.h.

Referenced by ParseRequest(), and SetContentType().

§ m_sRawRequest

QString HTTPRequest::m_sRawRequest

§ m_sRequestUrl

QString HTTPRequest::m_sRequestUrl

Definition at line 121 of file httprequest.h.

Referenced by DigestAuthentication(), and ProcessRequestLine().

§ m_sBaseUrl

QString HTTPRequest::m_sBaseUrl

§ m_sResourceUrl

QString HTTPRequest::m_sResourceUrl

§ m_sMethod

QString HTTPRequest::m_sMethod

§ m_mapParams

QStringMap HTTPRequest::m_mapParams

§ m_mapHeaders

QStringMap HTTPRequest::m_mapHeaders

§ m_mapCookies

QStringMap HTTPRequest::m_mapCookies

Definition at line 128 of file httprequest.h.

Referenced by ServerSideScripting::EvaluatePage(), ParseCookies(), and ParseRequest().

§ m_sPayload

QString HTTPRequest::m_sPayload

§ m_sProtocol

QString HTTPRequest::m_sProtocol

Definition at line 132 of file httprequest.h.

Referenced by GetRequestProtocol(), and SetRequestProtocol().

§ m_nMajor

int HTTPRequest::m_nMajor

§ m_nMinor

int HTTPRequest::m_nMinor

§ m_bProtected

bool HTTPRequest::m_bProtected

Definition at line 136 of file httprequest.h.

Referenced by ParseRequest().

§ m_bEncrypted

bool HTTPRequest::m_bEncrypted

Definition at line 137 of file httprequest.h.

Referenced by HttpWorker::HttpWorker().

§ m_bSOAPRequest

bool HTTPRequest::m_bSOAPRequest

§ m_sNameSpace

QString HTTPRequest::m_sNameSpace

Definition at line 140 of file httprequest.h.

Referenced by FormatActionResponse(), GetSerializer(), and ProcessSOAPPayload().

§ m_eResponseType

ResponseType HTTPRequest::m_eResponseType

§ m_sResponseTypeText

QString HTTPRequest::m_sResponseTypeText

§ m_nResponseStatus

long HTTPRequest::m_nResponseStatus

§ m_mapRespHeaders

QStringMap HTTPRequest::m_mapRespHeaders

§ m_sFileName

QString HTTPRequest::m_sFileName

§ m_response

QBuffer HTTPRequest::m_response

§ m_pPostProcess

IPostProcess* HTTPRequest::m_pPostProcess

Definition at line 154 of file httprequest.h.

Referenced by Eventing::HandleSubscribe(), and HttpWorker::HttpWorker().

§ m_sPrivateToken

QString HTTPRequest::m_sPrivateToken

Definition at line 156 of file httprequest.h.

Referenced by CalculateDigestNonce().

§ m_userSession

MythUserSession HTTPRequest::m_userSession

§ m_bKeepAlive

bool HTTPRequest::m_bKeepAlive
private

Definition at line 161 of file httprequest.h.

Referenced by BuildResponseHeader(), and ParseRequest().

§ m_nKeepAliveTimeout

uint HTTPRequest::m_nKeepAliveTimeout
private

Definition at line 162 of file httprequest.h.

Referenced by BuildResponseHeader().


The documentation for this class was generated from the following files: