#include <httprequest.h>
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) |
| long | SendResponse (void) |
| long | SendResponseFile (QString sFileName) |
| QString | GetHeaderValue (const QString &sKey, QString sDefault) |
| bool | GetKeepAlive () |
| Serializer * | GetSerializer () |
| virtual qlonglong | BytesAvailable ()=0 |
| virtual qulonglong | WaitForMore (int msecs, bool *timeout=NULL)=0 |
| virtual bool | CanReadLine ()=0 |
| virtual QString | ReadLine (int msecs=0)=0 |
| virtual qlonglong | ReadBlock (char *pData, qulonglong nMaxLen, int msecs=0)=0 |
| virtual qlonglong | WriteBlock (const char *pData, qulonglong nLen)=0 |
| virtual qlonglong | WriteBlockDirect (const char *pData, qulonglong nLen)=0 |
| virtual QString | GetHostAddress ()=0 |
| virtual QString | GetPeerAddress ()=0 |
| virtual void | Flush ()=0 |
| virtual bool | IsValid ()=0 |
| virtual int | getSocketHandle ()=0 |
| virtual void | SetBlocking (bool bBlock)=0 |
| virtual bool | IsBlocking ()=0 |
Static Public Member Functions | |
| static QString | GetMimeType (const QString &sFileExtension) |
| static QString | TestMimeType (const QString &sFileName) |
| static long | GetParameters (QString sParams, QStringMap &mapParams) |
| static QString | Encode (const QString &sIn) |
| static QString | GetETagHash (const QByteArray &data) |
Public Attributes | |
| RequestType | m_eType |
| ContentType | m_eContentType |
| QString | m_sRawRequest |
| QString | m_sBaseUrl |
| QString | m_sResourceUrl |
| QString | m_sMethod |
| QStringMap | m_mapParams |
| QStringMap | m_mapHeaders |
| QString | m_sPayload |
| QString | m_sProtocol |
| int | m_nMajor |
| int | m_nMinor |
| bool | m_bProtected |
| bool | m_bSOAPRequest |
| QString | m_sNameSpace |
| ResponseType | m_eResponseType |
| QString | m_sResponseTypeText |
| long | m_nResponseStatus |
| QStringMap | m_mapRespHeaders |
| QString | m_sFileName |
| QBuffer | m_response |
| IPostProcess * | m_pPostProcess |
Protected Member Functions | |
| RequestType | SetRequestType (const QString &sType) |
| void | SetRequestProtocol (const QString &sLine) |
| ContentType | SetContentType (const QString &sType) |
| void | SetServerHeaders (void) |
| void | ProcessRequestLine (const QString &sLine) |
| bool | ProcessSOAPPayload (const QString &sSOAPAction) |
| void | ExtractMethodFromURL () |
| QString | GetResponseStatus (void) |
| QString | GetResponseType (void) |
| QString | GetAdditionalHeaders (void) |
| bool | ParseRange (QString sRange, long long llSize, long long *pllStart, long long *pllEnd) |
| QString | BuildHeader (long long nSize) |
| qint64 | SendData (QIODevice *pDevice, qint64 llStart, qint64 llBytes) |
| qint64 | SendFile (QFile &file, qint64 llStart, qint64 llBytes) |
| bool | IsUrlProtected (const QString &sBaseUrl) |
| bool | Authenticated () |
Protected Attributes | |
| QRegExp | m_procReqLineExp |
| QRegExp | m_parseRangeExp |
Static Protected Attributes | |
| static const char * | m_szServerHeaders = "Accept-Ranges: bytes\r\n" |
Definition at line 92 of file httprequest.h.
| HTTPRequest::HTTPRequest | ( | ) |
Definition at line 125 of file httprequest.cpp.
| virtual HTTPRequest::~HTTPRequest | ( | ) | [inline, virtual] |
Definition at line 172 of file httprequest.h.
| RequestType HTTPRequest::SetRequestType | ( | const QString & | sType | ) | [protected] |
Definition at line 143 of file httprequest.cpp.
Referenced by ProcessRequestLine().
| void HTTPRequest::SetRequestProtocol | ( | const QString & | sLine | ) | [protected] |
Definition at line 740 of file httprequest.cpp.
Referenced by ProcessRequestLine().
| ContentType HTTPRequest::SetContentType | ( | const QString & | sType | ) | [protected] |
Definition at line 753 of file httprequest.cpp.
Referenced by ParseRequest().
| void HTTPRequest::SetServerHeaders | ( | void | ) | [protected] |
| void HTTPRequest::ProcessRequestLine | ( | const QString & | sLine | ) | [protected] |
Definition at line 1145 of file httprequest.cpp.
Referenced by ParseRequest().
| bool HTTPRequest::ProcessSOAPPayload | ( | const QString & | sSOAPAction | ) | [protected] |
Definition at line 1341 of file httprequest.cpp.
Referenced by ParseRequest().
| void HTTPRequest::ExtractMethodFromURL | ( | ) | [protected] |
Definition at line 1314 of file httprequest.cpp.
Referenced by ParseRequest().
| QString HTTPRequest::GetResponseStatus | ( | void | ) | [protected] |
Definition at line 771 of file httprequest.cpp.
Referenced by BuildHeader(), and SendResponse().
| QString HTTPRequest::GetResponseType | ( | void | ) | [protected] |
Definition at line 809 of file httprequest.cpp.
Referenced by BuildHeader().
| QString HTTPRequest::GetAdditionalHeaders | ( | void | ) | [protected] |
Definition at line 951 of file httprequest.cpp.
Referenced by BuildHeader().
| bool HTTPRequest::ParseRange | ( | QString | sRange, | |
| long long | llSize, | |||
| long long * | pllStart, | |||
| long long * | pllEnd | |||
| ) | [protected] |
Definition at line 1212 of file httprequest.cpp.
Referenced by SendResponseFile().
| QString HTTPRequest::BuildHeader | ( | long long | nSize | ) | [protected] |
Definition at line 167 of file httprequest.cpp.
Referenced by SendResponse(), and SendResponseFile().
| qint64 HTTPRequest::SendData | ( | QIODevice * | pDevice, | |
| qint64 | llStart, | |||
| qint64 | llBytes | |||
| ) | [protected] |
Definition at line 482 of file httprequest.cpp.
Referenced by SendFile(), and SendResponse().
| qint64 HTTPRequest::SendFile | ( | QFile & | file, | |
| qint64 | llStart, | |||
| qint64 | llBytes | |||
| ) | [protected] |
Definition at line 533 of file httprequest.cpp.
Referenced by SendResponseFile().
| bool HTTPRequest::IsUrlProtected | ( | const QString & | sBaseUrl | ) | [protected] |
Definition at line 1515 of file httprequest.cpp.
Referenced by ParseRequest().
| bool HTTPRequest::Authenticated | ( | ) | [protected] |
Definition at line 1534 of file httprequest.cpp.
Referenced by ParseRequest().
| bool HTTPRequest::ParseRequest | ( | ) |
Definition at line 1000 of file httprequest.cpp.
Referenced by HttpWorker::run().
| void HTTPRequest::FormatErrorResponse | ( | bool | bServerError, | |
| const QString & | sFaultString, | |||
| const QString & | sDetails | |||
| ) |
Definition at line 587 of file httprequest.cpp.
Referenced by UPnp::FormatErrorResponse().
| void HTTPRequest::FormatActionResponse | ( | Serializer * | ser | ) |
Definition at line 625 of file httprequest.cpp.
Referenced by ServiceHost::FormatResponse(), SSDPExtension::GetDeviceList(), InternetContent::GetInternetSources(), UPnpCDS::HandleBrowse(), UPnpCMGR::HandleGetCurrentConnectionIDs(), UPnpCMGR::HandleGetCurrentConnectionInfo(), UPnpCMGR::HandleGetProtocolInfo(), UPnpCDS::HandleGetSearchCapabilities(), UPnpCDS::HandleGetSortCapabilities(), UPnpCDS::HandleGetSystemUpdateID(), UPnpMSRR::HandleIsAuthorized(), UPnpMSRR::HandleIsValidated(), UPnpMSRR::HandleRegisterDevice(), and UPnpCDS::HandleSearch().
| void HTTPRequest::FormatActionResponse | ( | const NameValues & | pArgs | ) |
Definition at line 640 of file httprequest.cpp.
| void HTTPRequest::FormatFileResponse | ( | const QString & | sFileName | ) |
Definition at line 715 of file httprequest.cpp.
Referenced by ServiceHost::FormatResponse(), UPnpMSRR::ProcessRequest(), UPnpCMGR::ProcessRequest(), UPnpCDS::ProcessRequest(), MythFEXML::ProcessRequest(), HttpConfig::ProcessRequest(), and HtmlServerExtension::ProcessRequest().
| void HTTPRequest::FormatRawResponse | ( | const QString & | sXML | ) |
Definition at line 700 of file httprequest.cpp.
Referenced by InternetContent::GetInternetContent(), and InternetContent::GetInternetSearch().
| long HTTPRequest::SendResponse | ( | void | ) |
Definition at line 209 of file httprequest.cpp.
Referenced by UPnp::FormatRedirectResponse(), and HttpWorker::run().
| long HTTPRequest::SendResponseFile | ( | QString | sFileName | ) |
Definition at line 327 of file httprequest.cpp.
Referenced by SendResponse().
| QString HTTPRequest::GetHeaderValue | ( | const QString & | sKey, | |
| QString | sDefault | |||
| ) |
Definition at line 936 of file httprequest.cpp.
Referenced by BuildHeader(), UPnpCDS::DetermineClient(), SSDPExtension::GetDeviceDesc(), GetKeepAlive(), GetSerializer(), Eventing::HandleSubscribe(), Eventing::HandleUnsubscribe(), ParseRequest(), SendResponse(), and SendResponseFile().
| bool HTTPRequest::GetKeepAlive | ( | ) |
Definition at line 975 of file httprequest.cpp.
Referenced by BuildHeader(), and HttpWorker::run().
| Serializer * HTTPRequest::GetSerializer | ( | ) |
Definition at line 1447 of file httprequest.cpp.
Referenced by ServiceHost::FormatResponse().
| QString HTTPRequest::GetMimeType | ( | const QString & | sFileExtension | ) | [static] |
Definition at line 825 of file httprequest.cpp.
Referenced by UPnpCDSVideo::AddItem(), UPnpCDSMusic::AddItem(), and TestMimeType().
| QString HTTPRequest::TestMimeType | ( | const QString & | sFileName | ) | [static] |
Definition at line 844 of file httprequest.cpp.
Referenced by UPnpCDSTv::AddItem(), DemoConfigurationGroup::probeCard(), ImportConfigurationGroup::probeCard(), and SendResponseFile().
| long HTTPRequest::GetParameters | ( | QString | sParams, | |
| QStringMap & | mapParams | |||
| ) | [static] |
Definition at line 895 of file httprequest.cpp.
Referenced by ParseRequest(), UPnpCDSExtension::ProcessItem(), and ProcessRequestLine().
| QString HTTPRequest::Encode | ( | const QString & | sIn | ) | [static] |
Definition at line 1480 of file httprequest.cpp.
Referenced by FormatActionResponse(), and UPnp::FormatErrorResponse().
| QString HTTPRequest::GetETagHash | ( | const QByteArray & | data | ) | [static] |
Definition at line 1504 of file httprequest.cpp.
| virtual qlonglong HTTPRequest::BytesAvailable | ( | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
Referenced by ParseRequest().
| virtual qulonglong HTTPRequest::WaitForMore | ( | int | msecs, | |
| bool * | timeout = NULL | |||
| ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
| virtual bool HTTPRequest::CanReadLine | ( | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
| virtual QString HTTPRequest::ReadLine | ( | int | msecs = 0 |
) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
Referenced by ParseRequest().
| virtual qlonglong HTTPRequest::ReadBlock | ( | char * | pData, | |
| qulonglong | nMaxLen, | |||
| int | msecs = 0 | |||
| ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
Referenced by ParseRequest().
| virtual qlonglong HTTPRequest::WriteBlock | ( | const char * | pData, | |
| qulonglong | nLen | |||
| ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
| virtual qlonglong HTTPRequest::WriteBlockDirect | ( | const char * | pData, | |
| qulonglong | nLen | |||
| ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
Referenced by SendData(), SendResponse(), and SendResponseFile().
| virtual QString HTTPRequest::GetHostAddress | ( | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
Referenced by SSDPExtension::GetDeviceDesc().
| virtual QString HTTPRequest::GetPeerAddress | ( | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
Referenced by SendResponse().
| virtual void HTTPRequest::Flush | ( | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
| virtual bool HTTPRequest::IsValid | ( | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
| virtual int HTTPRequest::getSocketHandle | ( | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
Referenced by ParseRange(), ParseRequest(), SendFile(), SendResponse(), and SendResponseFile().
| virtual void HTTPRequest::SetBlocking | ( | bool | bBlock | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
| virtual bool HTTPRequest::IsBlocking | ( | ) | [pure virtual] |
Implemented in BufferedSocketDeviceRequest.
const char * HTTPRequest::m_szServerHeaders = "Accept-Ranges: bytes\r\n" [static, protected] |
Definition at line 96 of file httprequest.h.
Referenced by GetAdditionalHeaders().
QRegExp HTTPRequest::m_procReqLineExp [protected] |
Definition at line 98 of file httprequest.h.
Referenced by ProcessRequestLine().
QRegExp HTTPRequest::m_parseRangeExp [protected] |
Definition at line 99 of file httprequest.h.
Referenced by ParseRange().
Definition at line 103 of file httprequest.h.
Referenced by ServiceHost::ProcessRequest(), Eventing::ProcessRequest(), ProcessRequestLine(), SendResponse(), SendResponseFile(), and SetRequestType().
Definition at line 104 of file httprequest.h.
Referenced by ParseRequest(), and SetContentType().
| QString HTTPRequest::m_sRawRequest |
Definition at line 106 of file httprequest.h.
Referenced by UPnp::FormatRedirectResponse(), UPNPSubscription::ProcessRequest(), ServiceHost::ProcessRequest(), MythFEXML::ProcessRequest(), InternetContent::ProcessRequest(), and ProcessRequestLine().
| QString HTTPRequest::m_sBaseUrl |
Definition at line 108 of file httprequest.h.
Referenced by HttpServer::DelegateRequest(), ExtractMethodFromURL(), Wsdl::GetWSDL(), UPnpCDS::HandleBrowse(), UPnpCDS::HandleGetSearchCapabilities(), UPnpCDS::HandleGetSortCapabilities(), UPnpCDS::HandleGetSystemUpdateID(), UPnpCDS::HandleSearch(), ParseRequest(), UPNPSubscription::ProcessRequest(), UPnpMSRR::ProcessRequest(), UPnpCMGR::ProcessRequest(), UPnpCDS::ProcessRequest(), SSDPExtension::ProcessRequest(), ServiceHost::ProcessRequest(), MythFEXML::ProcessRequest(), MythFrontendStatus::ProcessRequest(), InternetContent::ProcessRequest(), HttpStatus::ProcessRequest(), HttpConfig::ProcessRequest(), HtmlServerExtension::ProcessRequest(), Eventing::ProcessRequest(), and ProcessRequestLine().
| QString HTTPRequest::m_sResourceUrl |
Definition at line 109 of file httprequest.h.
Referenced by HttpStatus::ProcessRequest(), HtmlServerExtension::ProcessRequest(), ProcessRequestLine(), Xsd::RenderArrayXSD(), Xsd::RenderMapXSD(), and Xsd::RenderXSD().
| QString HTTPRequest::m_sMethod |
Definition at line 110 of file httprequest.h.
Referenced by ExtractMethodFromURL(), FormatActionResponse(), GetSerializer(), UPnpCDS::HandleBrowse(), UPnpCDS::HandleGetSearchCapabilities(), UPnpCDS::HandleGetSortCapabilities(), UPnpCDS::HandleGetSystemUpdateID(), UPnpCDS::HandleSearch(), ParseRequest(), UPNPSubscription::ProcessRequest(), UPnpMSRR::ProcessRequest(), UPnpCMGR::ProcessRequest(), UPnpCDS::ProcessRequest(), SSDPExtension::ProcessRequest(), ServiceHost::ProcessRequest(), MythFEXML::ProcessRequest(), MythFrontendStatus::ProcessRequest(), InternetContent::ProcessRequest(), HttpStatus::ProcessRequest(), HttpConfig::ProcessRequest(), Eventing::ProcessRequest(), and ProcessSOAPPayload().
Definition at line 112 of file httprequest.h.
Referenced by InternetContent::GetInternetContent(), InternetContent::GetInternetSearch(), MythFEXML::GetScreenShot(), Wsdl::GetWSDL(), Xsd::GetXSD(), UPnpCDS::HandleBrowse(), UPnpCMGR::HandleGetCurrentConnectionInfo(), UPnpCDS::HandleSearch(), ParseRequest(), UPNPSubscription::ProcessRequest(), ServiceHost::ProcessRequest(), HttpConfig::ProcessRequest(), ProcessRequestLine(), ProcessSOAPPayload(), and Xsd::RenderMapXSD().
Definition at line 113 of file httprequest.h.
Referenced by Authenticated(), UPnp::FormatRedirectResponse(), GetHeaderValue(), Wsdl::GetWSDL(), ParseRequest(), UPNPSubscription::ProcessRequest(), Xsd::RenderArrayXSD(), Xsd::RenderMapXSD(), Xsd::RenderXSD(), HttpWorker::run(), SendResponse(), and SendResponseFile().
| QString HTTPRequest::m_sPayload |
Definition at line 115 of file httprequest.h.
Referenced by ParseRequest(), UPNPSubscription::ProcessRequest(), and ProcessSOAPPayload().
| QString HTTPRequest::m_sProtocol |
Definition at line 117 of file httprequest.h.
Referenced by SetRequestProtocol().
Definition at line 118 of file httprequest.h.
Referenced by BuildHeader(), GetKeepAlive(), and SetRequestProtocol().
Definition at line 119 of file httprequest.h.
Referenced by BuildHeader(), GetKeepAlive(), and SetRequestProtocol().
Definition at line 121 of file httprequest.h.
Referenced by GetAdditionalHeaders(), and ParseRequest().
Definition at line 123 of file httprequest.h.
Referenced by FormatActionResponse(), UPnp::FormatErrorResponse(), FormatErrorResponse(), GetSerializer(), and ProcessSOAPPayload().
| QString HTTPRequest::m_sNameSpace |
Definition at line 124 of file httprequest.h.
Referenced by FormatActionResponse(), GetSerializer(), and ProcessSOAPPayload().
Definition at line 128 of file httprequest.h.
Referenced by BuildHeader(), HttpServer::DelegateRequest(), FormatActionResponse(), FormatErrorResponse(), FormatFileResponse(), FormatRawResponse(), UPnp::FormatRedirectResponse(), MythFEXML::GetActionListTest(), SSDPExtension::GetDeviceDesc(), SSDPExtension::GetDeviceList(), SSDPExtension::GetFile(), InternetContent::GetInternetContent(), InternetContent::GetInternetSearch(), InternetContent::GetInternetSources(), MythFEXML::GetRemote(), GetResponseType(), MythFEXML::GetScreenShot(), HttpStatus::GetStatusHTML(), HttpStatus::GetStatusXML(), Wsdl::GetWSDL(), Eventing::HandleSubscribe(), Eventing::HandleUnsubscribe(), ParseRequest(), UPNPSubscription::ProcessRequest(), MythFrontendStatus::ProcessRequest(), HttpStatus::ProcessRequest(), HttpConfig::ProcessRequest(), HtmlServerExtension::ProcessRequest(), Xsd::RenderArrayXSD(), Xsd::RenderMapXSD(), Xsd::RenderXSD(), SendResponse(), and SendResponseFile().
| QString HTTPRequest::m_sResponseTypeText |
Definition at line 129 of file httprequest.h.
Referenced by BuildHeader(), FormatActionResponse(), HttpConfig::ProcessRequest(), and SendResponseFile().
Definition at line 131 of file httprequest.h.
Referenced by HttpServer::DelegateRequest(), FormatActionResponse(), FormatErrorResponse(), FormatFileResponse(), FormatRawResponse(), UPnp::FormatRedirectResponse(), SSDPExtension::GetDeviceList(), SSDPExtension::GetFile(), InternetContent::GetInternetContent(), GetResponseStatus(), Eventing::HandleSubscribe(), Eventing::HandleUnsubscribe(), ParseRequest(), UPNPSubscription::ProcessRequest(), HttpStatus::ProcessRequest(), ProcessRequestLine(), HttpWorker::run(), SendResponse(), and SendResponseFile().
Definition at line 132 of file httprequest.h.
Referenced by FormatActionResponse(), FormatErrorResponse(), FormatFileResponse(), UPnp::FormatRedirectResponse(), MythFEXML::GetActionListTest(), GetAdditionalHeaders(), SSDPExtension::GetFile(), MythFEXML::GetRemote(), HttpStatus::GetStatusHTML(), HttpStatus::GetStatusXML(), Eventing::HandleSubscribe(), ParseRequest(), MythFrontendStatus::ProcessRequest(), HttpConfig::ProcessRequest(), SendResponse(), and SendResponseFile().
| QString HTTPRequest::m_sFileName |
Definition at line 134 of file httprequest.h.
Referenced by FormatFileResponse(), SSDPExtension::GetFile(), InternetContent::GetInternetContent(), MythFEXML::GetScreenShot(), and SendResponse().
| QBuffer HTTPRequest::m_response |
Definition at line 136 of file httprequest.h.
Referenced by FormatActionResponse(), FormatErrorResponse(), FormatRawResponse(), MythFEXML::GetActionListTest(), SSDPExtension::GetDeviceDesc(), MythFEXML::GetRemote(), GetSerializer(), HttpStatus::GetStatusHTML(), HttpStatus::GetStatusXML(), Wsdl::GetWSDL(), HTTPRequest(), ParseRequest(), MythFrontendStatus::ProcessRequest(), HttpConfig::ProcessRequest(), HtmlServerExtension::ProcessRequest(), Xsd::RenderArrayXSD(), Xsd::RenderMapXSD(), Xsd::RenderXSD(), and SendResponse().
Definition at line 138 of file httprequest.h.
Referenced by Eventing::HandleSubscribe(), and HttpWorker::run().
1.6.3