HTTPProtocol Class Reference
#include <http.h>

Classes | |
| struct | CacheTag |
| struct | DAVRequest |
| DAV-specific request elements for the current connection. More... | |
| struct | HTTPRequest |
| The request for the current connection. More... | |
| struct | HTTPServerState |
| State of the current connection to the server. More... | |
Public Types | |
| enum | AUTH_SCHEME { AUTH_None, AUTH_Basic, AUTH_NTLM, AUTH_Digest, AUTH_Negotiate } |
| enum | CacheIOMode { NoCache = 0, ReadFromCache = 1, WriteToCache = 2 } |
| enum | HTTP_REV { HTTP_None, HTTP_Unknown, HTTP_10, HTTP_11, SHOUTCAST } |
Public Member Functions | |
| HTTPProtocol (const QByteArray &protocol, const QByteArray &pool, const QByteArray &app) | |
| virtual | ~HTTPProtocol () |
| virtual void | closeConnection () |
| virtual void | copy (const KUrl &src, const KUrl &dest, int _permissions, KIO::JobFlags flags) |
| QString | davError (int code=-1, const QString &url=QString()) |
| void | davFinished () |
| void | davGeneric (const KUrl &url, KIO::HTTP_METHOD method) |
| bool | davHostOk () |
| void | davLock (const KUrl &url, const QString &scope, const QString &type, const QString &owner) |
| void | davUnlock (const KUrl &url) |
| virtual void | del (const KUrl &url, bool _isfile) |
| virtual void | get (const KUrl &url) |
| void | httpPutError () |
| bool | isOffline () |
| virtual void | listDir (const KUrl &url) |
| bool | maybeSetRequestUrl (const KUrl &) |
| virtual void | mimetype (const KUrl &url) |
| virtual void | mkdir (const KUrl &url, int _permissions) |
| void | multiGet (const QByteArray &data) |
| void | post (const KUrl &url) |
| virtual void | put (const KUrl &url, int _mode, KIO::JobFlags flags) |
| virtual void | rename (const KUrl &src, const KUrl &dest, KIO::JobFlags flags) |
| virtual void | reparseConfiguration () |
| bool | sendErrorPageNotification () |
| virtual void | setHost (const QString &host, quint16 port, const QString &user, const QString &pass) |
| virtual void | slave_status () |
| virtual void | special (const QByteArray &data) |
| virtual void | stat (const KUrl &url) |
Protected Slots | |
| void | error (int errid, const QString &text) |
| void | proxyAuthenticationForSocket (const QNetworkProxy &, QAuthenticator *) |
| void | saveProxyAuthenticationForSocket () |
| void | slotData (const QByteArray &) |
| void | slotFilterError (const QString &text) |
Protected Member Functions | |
| void | addCookies (const QString &url, const QByteArray &cookieHeader) |
| void | addEncoding (const QString &, QStringList &) |
| QString | authenticationHeader () |
| void | cacheFileClose () |
| bool | cacheFileOpenRead () |
| bool | cacheFileOpenWrite () |
| QString | cacheFilePathFromUrl (const KUrl &url) const |
| QByteArray | cacheFileReadPayload (int maxLength) |
| bool | cacheFileReadTextHeader1 (const KUrl &desiredUrl) |
| bool | cacheFileReadTextHeader2 () |
| void | cacheFileWritePayload (const QByteArray &d) |
| void | cacheFileWriteTextHeader () |
| void | cacheParseResponseHeader (const HeaderTokenizer &tokenizer) |
| void | clearUnreadBuffer () |
| int | codeFromResponse (const QString &response) |
| void | davParseActiveLocks (const QDomNodeList &activeLocks, uint &lockCount) |
| void | davParsePropstats (const QDomNodeList &propstats, KIO::UDSEntry &entry) |
| QString | davProcessLocks () |
| void | davSetRequest (const QByteArray &requestXML) |
| void | davStatList (const KUrl &url, bool stat=true) |
| quint16 | defaultPort () const |
| QString | findCookies (const QString &url) |
| void | fixupResponseContentEncoding () |
| void | fixupResponseMimetype () |
| QString | formatRequestUri () const |
| void | forwardHttpResponseHeader (bool forwardImmediately=true) |
| void | httpClose (bool keepAlive) |
| void | httpCloseConnection () |
| bool | httpOpenConnection () |
| bool | httpShouldCloseConnection () |
| void | parseContentDisposition (const QString &disposition) |
| long | parseDateTime (const QString &input, const QString &type) |
| bool | parseHeaderFromCache () |
| void | proceedUntilResponseContent (bool dataInternal=false) |
| bool | proceedUntilResponseHeader () |
| bool | readBody (bool dataInternal=false) |
| size_t | readBuffered (char *buf, size_t size, bool unlimited=true) |
| int | readChunked () |
| bool | readDelimitedText (char *buf, int *idx, int end, int numNewlines) |
| int | readLimited () |
| bool | readResponseHeader () |
| int | readUnlimited () |
| void | resetConnectionSettings () |
| void | resetResponseParsing () |
| void | resetSessionSettings () |
| bool | satisfyRequestFromCache (bool *cacheHasPage) |
| bool | sendBody () |
| void | sendCacheCleanerCommand (const QByteArray &command) |
| bool | sendQuery () |
| void | setCacheabilityMetadata (bool cachingAllowed) |
| void | unread (char *buf, size_t size) |
| ssize_t | write (const void *buf, size_t nbytes) |
Protected Attributes | |
| QLocalSocket | m_cacheCleanerConnection |
| QStringList | m_contentEncodings |
| QString | m_contentMD5 |
| bool | m_cpMimeBuffer |
| bool | m_dataInternal |
| QStringList | m_davCapabilities |
| bool | m_davHostOk |
| bool | m_davHostUnsupported |
| KIO::filesize_t | m_iBytesLeft |
| KIO::filesize_t | m_iContentLeft |
| bool | m_isBusy |
| bool | m_isChunked |
| bool | m_isEOD |
| bool | m_isEOF |
| bool | m_isError |
| KIO::filesize_t | m_iSize |
| bool | m_isLoadingErrorPage |
| bool | m_isRedirection |
| int | m_maxCacheAge |
| long | m_maxCacheSize |
| QString | m_mimeType |
| QByteArray | m_mimeTypeBuffer |
| QByteArray | m_POSTbuf |
| QByteArray | m_protocol |
| KAbstractHttpAuthentication * | m_proxyAuth |
| QByteArray | m_receiveBuf |
| int | m_remoteRespTimeout |
| HTTPRequest | m_request |
| QList< HTTPRequest > | m_requestQueue |
| QStringList | m_responseHeaders |
| HTTPServerState | m_server |
| QAuthenticator * | m_socketProxyAuth |
| QString | m_strCacheDir |
| QStringList | m_transferEncodings |
| QByteArray | m_unreadBuf |
| QByteArray | m_webDavDataBuf |
| KAbstractHttpAuthentication * | m_wwwAuth |
Detailed Description
Member Enumeration Documentation
Constructor & Destructor Documentation
| HTTPProtocol::HTTPProtocol | ( | const QByteArray & | protocol, |
| const QByteArray & | pool, | ||
| const QByteArray & | app | ||
| ) |
Member Function Documentation
| void HTTPProtocol::addCookies | ( | const QString & | url, |
| const QByteArray & | cookieHeader | ||
| ) | [protected] |
| void HTTPProtocol::addEncoding | ( | const QString & | _encoding, |
| QStringList & | encs | ||
| ) | [protected] |
| QString HTTPProtocol::authenticationHeader | ( | ) | [protected] |
| QByteArray HTTPProtocol::cacheFileReadPayload | ( | int | maxLength | ) | [protected] |
| bool HTTPProtocol::cacheFileReadTextHeader2 | ( | ) | [protected] |
| void HTTPProtocol::cacheFileWritePayload | ( | const QByteArray & | d | ) | [protected] |
| void HTTPProtocol::cacheFileWriteTextHeader | ( | ) | [protected] |
| void HTTPProtocol::cacheParseResponseHeader | ( | const HeaderTokenizer & | tokenizer | ) | [protected] |
| void HTTPProtocol::closeConnection | ( | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| int HTTPProtocol::codeFromResponse | ( | const QString & | response | ) | [protected] |
| void HTTPProtocol::copy | ( | const KUrl & | src, |
| const KUrl & | dest, | ||
| int | _permissions, | ||
| KIO::JobFlags | flags | ||
| ) | [virtual] |
Definition at line 88 of file file_unix.cpp.
| void HTTPProtocol::davGeneric | ( | const KUrl & | url, |
| KIO::HTTP_METHOD | method | ||
| ) |
| void HTTPProtocol::davParseActiveLocks | ( | const QDomNodeList & | activeLocks, |
| uint & | lockCount | ||
| ) | [protected] |
| void HTTPProtocol::davParsePropstats | ( | const QDomNodeList & | propstats, |
| KIO::UDSEntry & | entry | ||
| ) | [protected] |
| QString HTTPProtocol::davProcessLocks | ( | ) | [protected] |
| void HTTPProtocol::davSetRequest | ( | const QByteArray & | requestXML | ) | [protected] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::error | ( | int | errid, |
| const QString & | text | ||
| ) | [protected, slot] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::fixupResponseContentEncoding | ( | ) | [protected] |
| QString HTTPProtocol::formatRequestUri | ( | ) | const [protected] |
| void HTTPProtocol::forwardHttpResponseHeader | ( | bool | forwardImmediately = true | ) | [protected] |
| void HTTPProtocol::get | ( | const KUrl & | url | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::httpClose | ( | bool | keepAlive | ) | [protected] |
| bool HTTPProtocol::httpShouldCloseConnection | ( | ) | [protected] |
| void HTTPProtocol::listDir | ( | const KUrl & | url | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::mimetype | ( | const KUrl & | url | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::mkdir | ( | const KUrl & | url, |
| int | _permissions | ||
| ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::multiGet | ( | const QByteArray & | data | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::parseContentDisposition | ( | const QString & | disposition | ) | [protected] |
| void HTTPProtocol::proceedUntilResponseContent | ( | bool | dataInternal = false | ) | [protected] |
Do everything proceedUntilResponseHeader does, and also get the response body.
This is being used as a replacement for proceedUntilResponseHeader() in situations where we actually expect the response to have a body / payload data.
| bool HTTPProtocol::proceedUntilResponseHeader | ( | ) | [protected] |
| void HTTPProtocol::proxyAuthenticationForSocket | ( | const QNetworkProxy & | proxy, |
| QAuthenticator * | authenticator | ||
| ) | [protected, slot] |
| void HTTPProtocol::put | ( | const KUrl & | url, |
| int | _mode, | ||
| KIO::JobFlags | flags | ||
| ) | [virtual] |
This function is our "receive" function.
It is responsible for downloading the message (not the header) from the HTTP server. It is called either as a response to a client's KIOJob::dataEnd() (meaning that the client is done sending data) or by 'sendQuery()' (if we are in the process of a PUT/POST request). It can also be called by a webDAV function, to receive stat/list/property/etc. data; in this case the data is stored in m_webDavDataBuf.
| size_t HTTPProtocol::readBuffered | ( | char * | buf, |
| size_t | size, | ||
| bool | unlimited = true |
||
| ) | [protected] |
| int HTTPProtocol::readChunked | ( | ) | [protected] |
| bool HTTPProtocol::readDelimitedText | ( | char * | buf, |
| int * | idx, | ||
| int | end, | ||
| int | numNewlines | ||
| ) | [protected] |
| bool HTTPProtocol::readResponseHeader | ( | ) | [protected] |
| void HTTPProtocol::reparseConfiguration | ( | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::resetConnectionSettings | ( | ) | [protected] |
| void HTTPProtocol::resetResponseParsing | ( | ) | [protected] |
| void HTTPProtocol::resetSessionSettings | ( | ) | [protected] |
| void HTTPProtocol::saveProxyAuthenticationForSocket | ( | ) | [protected, slot] |
| void HTTPProtocol::sendCacheCleanerCommand | ( | const QByteArray & | command | ) | [protected] |
| bool HTTPProtocol::sendQuery | ( | ) | [protected] |
This function is responsible for opening up the connection to the remote HTTP server and sending the header.
If this requires special authentication or other such fun stuff, then it will handle it. This function will NOT receive anything from the server, however. This is in contrast to previous incarnations of 'httpOpen' as this method used to be called.
The basic process now is this:
1) Open up the socket and port 2) Format our request/header 3) Send the header to the remote server 4) Call sendBody() if the HTTP method requires sending body data
| void HTTPProtocol::setCacheabilityMetadata | ( | bool | cachingAllowed | ) | [protected] |
| void HTTPProtocol::setHost | ( | const QString & | host, |
| quint16 | port, | ||
| const QString & | user, | ||
| const QString & | pass | ||
| ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::slave_status | ( | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::slotData | ( | const QByteArray & | _d | ) | [protected, slot] |
| void HTTPProtocol::slotFilterError | ( | const QString & | text | ) | [protected, slot] |
| void HTTPProtocol::special | ( | const QByteArray & | data | ) | [virtual] |
Special commands supported by this slave : 1 - HTTP POST 2 - Cache has been updated 3 - SSL Certificate Cache has been updated 4 - HTTP multi get 5 - DAV LOCK (see 6 - DAV UNLOCK README.webdav)
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::stat | ( | const KUrl & | url | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
| void HTTPProtocol::unread | ( | char * | buf, |
| size_t | size | ||
| ) | [protected] |
| ssize_t HTTPProtocol::write | ( | const void * | buf, |
| size_t | nbytes | ||
| ) | [protected] |
Member Data Documentation
QLocalSocket HTTPProtocol::m_cacheCleanerConnection [protected] |
QStringList HTTPProtocol::m_contentEncodings [protected] |
QString HTTPProtocol::m_contentMD5 [protected] |
bool HTTPProtocol::m_cpMimeBuffer [protected] |
bool HTTPProtocol::m_dataInternal [protected] |
QStringList HTTPProtocol::m_davCapabilities [protected] |
bool HTTPProtocol::m_davHostOk [protected] |
bool HTTPProtocol::m_davHostUnsupported [protected] |
KIO::filesize_t HTTPProtocol::m_iBytesLeft [protected] |
KIO::filesize_t HTTPProtocol::m_iContentLeft [protected] |
bool HTTPProtocol::m_isBusy [protected] |
bool HTTPProtocol::m_isChunked [protected] |
bool HTTPProtocol::m_isEOD [protected] |
bool HTTPProtocol::m_isEOF [protected] |
bool HTTPProtocol::m_isError [protected] |
KIO::filesize_t HTTPProtocol::m_iSize [protected] |
bool HTTPProtocol::m_isLoadingErrorPage [protected] |
bool HTTPProtocol::m_isRedirection [protected] |
int HTTPProtocol::m_maxCacheAge [protected] |
long HTTPProtocol::m_maxCacheSize [protected] |
QString HTTPProtocol::m_mimeType [protected] |
QByteArray HTTPProtocol::m_mimeTypeBuffer [protected] |
QByteArray HTTPProtocol::m_POSTbuf [protected] |
QByteArray HTTPProtocol::m_protocol [protected] |
KAbstractHttpAuthentication* HTTPProtocol::m_proxyAuth [protected] |
QByteArray HTTPProtocol::m_receiveBuf [protected] |
int HTTPProtocol::m_remoteRespTimeout [protected] |
HTTPRequest HTTPProtocol::m_request [protected] |
QList<HTTPRequest> HTTPProtocol::m_requestQueue [protected] |
QStringList HTTPProtocol::m_responseHeaders [protected] |
HTTPServerState HTTPProtocol::m_server [protected] |
QAuthenticator* HTTPProtocol::m_socketProxyAuth [protected] |
QString HTTPProtocol::m_strCacheDir [protected] |
QStringList HTTPProtocol::m_transferEncodings [protected] |
QByteArray HTTPProtocol::m_unreadBuf [protected] |
QByteArray HTTPProtocol::m_webDavDataBuf [protected] |
KAbstractHttpAuthentication* HTTPProtocol::m_wwwAuth [protected] |
The documentation for this class was generated from the following files:
KDE 4.6 API Reference