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 ()
 

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 ( )

Definition at line 159 of file httprequest.cpp.

virtual HTTPRequest::~HTTPRequest ( )
inlinevirtual

Definition at line 205 of file httprequest.h.

Member Function Documentation

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

Definition at line 181 of file httprequest.cpp.

Referenced by ProcessRequestLine().

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

Definition at line 946 of file httprequest.cpp.

Referenced by ProcessRequestLine().

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

Definition at line 991 of file httprequest.cpp.

Referenced by ParseRequest().

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

Definition at line 1499 of file httprequest.cpp.

Referenced by ParseRequest().

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

Definition at line 1693 of file httprequest.cpp.

Referenced by ParseRequest().

void HTTPRequest::ExtractMethodFromURL ( )
protected

Definition at line 1666 of file httprequest.cpp.

Referenced by ParseRequest().

QString HTTPRequest::GetResponseStatus ( void  )
protected

Definition at line 1009 of file httprequest.cpp.

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

QString HTTPRequest::GetResponseType ( void  )
protected

Definition at line 1072 of file httprequest.cpp.

Referenced by BuildResponseHeader().

QString HTTPRequest::GetResponseHeaders ( void  )
protected

Definition at line 1236 of file httprequest.cpp.

Referenced by BuildResponseHeader().

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

Definition at line 1566 of file httprequest.cpp.

Referenced by SendResponseFile().

bool HTTPRequest::ParseKeepAlive ( void  )
protected

Definition at line 1255 of file httprequest.cpp.

Referenced by ParseRequest().

void HTTPRequest::ParseCookies ( void  )
protected

Definition at line 1289 of file httprequest.cpp.

Referenced by ParseRequest().

QString HTTPRequest::BuildResponseHeader ( long long  nSize)
protected

Definition at line 208 of file httprequest.cpp.

Referenced by SendResponse(), and SendResponseFile().

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

Definition at line 713 of file httprequest.cpp.

Referenced by SendFile(), and SendResponse().

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

Definition at line 766 of file httprequest.cpp.

Referenced by SendResponseFile().

bool HTTPRequest::IsProtected ( ) const
inlineprotected

Definition at line 192 of file httprequest.h.

bool HTTPRequest::IsEncrypted ( ) const
inlineprotected

Definition at line 193 of file httprequest.h.

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

bool HTTPRequest::Authenticated ( )
protected

Definition at line 2166 of file httprequest.cpp.

Referenced by ParseRequest().

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

Definition at line 1902 of file httprequest.cpp.

Referenced by DigestAuthentication(), and ParseRequest().

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

Definition at line 1932 of file httprequest.cpp.

Referenced by DigestAuthentication(), and GetAuthenticationHeader().

bool HTTPRequest::BasicAuthentication ( )
protected

Definition at line 1944 of file httprequest.cpp.

Referenced by Authenticated().

bool HTTPRequest::DigestAuthentication ( )
protected

Definition at line 2003 of file httprequest.cpp.

Referenced by Authenticated().

bool HTTPRequest::ParseRequest ( )

Definition at line 1307 of file httprequest.cpp.

Referenced by HttpWorker::run().

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

Definition at line 778 of file httprequest.cpp.

Referenced by UPnp::FormatErrorResponse().

void HTTPRequest::FormatActionResponse ( Serializer ser)
void HTTPRequest::FormatActionResponse ( const NameValues pArgs)

Definition at line 831 of file httprequest.cpp.

void HTTPRequest::FormatFileResponse ( const QString &  sFileName)
void HTTPRequest::FormatRawResponse ( const QString &  sXML)
qint64 HTTPRequest::SendResponse ( void  )

Definition at line 314 of file httprequest.cpp.

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

qint64 HTTPRequest::SendResponseFile ( QString  sFileName)

Definition at line 539 of file httprequest.cpp.

Referenced by SendResponse().

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

Definition at line 2202 of file httprequest.cpp.

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

QString HTTPRequest::GetRequestHeader ( const QString &  sKey,
QString  sDefault 
)
bool HTTPRequest::GetKeepAlive ( )
inline

Definition at line 231 of file httprequest.h.

Referenced by HttpWorker::run().

Serializer * HTTPRequest::GetSerializer ( )

Definition at line 1799 of file httprequest.cpp.

Referenced by ServiceHost::FormatResponse().

QByteArray HTTPRequest::GetResponsePage ( void  )
QString HTTPRequest::GetRequestProtocol ( ) const

Definition at line 959 of file httprequest.cpp.

Referenced by ServerSideScripting::EvaluatePage().

QString HTTPRequest::GetResponseProtocol ( ) const

Definition at line 970 of file httprequest.cpp.

Referenced by BuildResponseHeader().

QString HTTPRequest::GetRequestType ( ) const

Definition at line 2270 of file httprequest.cpp.

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

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

Definition at line 1111 of file httprequest.cpp.

Referenced by GetSinkProtocolInfos(), and GetSourceProtocolInfos().

QString HTTPRequest::TestMimeType ( const QString &  sFileName)
static
long HTTPRequest::GetParameters ( QString  sParams,
QStringMap mapParams 
)
static

Definition at line 1179 of file httprequest.cpp.

Referenced by ParseRequest(), and ProcessRequestLine().

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

Definition at line 1856 of file httprequest.cpp.

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

Definition at line 1872 of file httprequest.cpp.

void HTTPRequest::SetKeepAliveTimeout ( int  nTimeout)
inline

Definition at line 250 of file httprequest.h.

Referenced by HttpWorker::run().

bool HTTPRequest::IsUrlProtected ( const QString &  sBaseUrl)

Definition at line 1883 of file httprequest.cpp.

Referenced by ParseRequest().

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

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRequest().

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

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRequest().

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

Definition at line 2243 of file httprequest.cpp.

Referenced by ServerSideScripting::EvaluatePage().

virtual QString HTTPRequest::GetHostAddress ( )
pure virtual
virtual quint16 HTTPRequest::GetHostPort ( )
pure virtual
virtual QString HTTPRequest::GetPeerAddress ( )
pure virtual
virtual int HTTPRequest::getSocketHandle ( )
pure virtual

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRange(), and ParseRequest().

Member Data Documentation

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

Definition at line 109 of file httprequest.h.

Referenced by GetResponseHeaders().

QRegExp HTTPRequest::m_procReqLineExp
protected

Definition at line 111 of file httprequest.h.

Referenced by ProcessRequestLine().

QRegExp HTTPRequest::m_parseRangeExp
protected

Definition at line 112 of file httprequest.h.

Referenced by ParseRange().

RequestType HTTPRequest::m_eType
ContentType HTTPRequest::m_eContentType

Definition at line 117 of file httprequest.h.

Referenced by ParseRequest(), and SetContentType().

QString HTTPRequest::m_sRawRequest
QString HTTPRequest::m_sRequestUrl

Definition at line 121 of file httprequest.h.

Referenced by DigestAuthentication(), and ProcessRequestLine().

QString HTTPRequest::m_sBaseUrl
QString HTTPRequest::m_sResourceUrl
QString HTTPRequest::m_sMethod
QStringMap HTTPRequest::m_mapParams
QStringMap HTTPRequest::m_mapHeaders
QStringMap HTTPRequest::m_mapCookies

Definition at line 128 of file httprequest.h.

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

QString HTTPRequest::m_sPayload
QString HTTPRequest::m_sProtocol

Definition at line 132 of file httprequest.h.

Referenced by GetRequestProtocol(), and SetRequestProtocol().

int HTTPRequest::m_nMajor
int HTTPRequest::m_nMinor
bool HTTPRequest::m_bProtected

Definition at line 136 of file httprequest.h.

Referenced by ParseRequest().

bool HTTPRequest::m_bEncrypted

Definition at line 137 of file httprequest.h.

Referenced by HttpWorker::run().

bool HTTPRequest::m_bSOAPRequest
QString HTTPRequest::m_sNameSpace

Definition at line 140 of file httprequest.h.

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

ResponseType HTTPRequest::m_eResponseType
QString HTTPRequest::m_sResponseTypeText
long HTTPRequest::m_nResponseStatus
QStringMap HTTPRequest::m_mapRespHeaders
QString HTTPRequest::m_sFileName
QBuffer HTTPRequest::m_response
IPostProcess* HTTPRequest::m_pPostProcess

Definition at line 154 of file httprequest.h.

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

QString HTTPRequest::m_sPrivateToken

Definition at line 156 of file httprequest.h.

Referenced by CalculateDigestNonce().

MythUserSession HTTPRequest::m_userSession
bool HTTPRequest::m_bKeepAlive
private

Definition at line 161 of file httprequest.h.

Referenced by BuildResponseHeader(), and ParseRequest().

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: