KIOSlave
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 | HTTP_REV { HTTP_None, HTTP_Unknown, HTTP_10, HTTP_11, SHOUTCAST } |
Public Member Functions | |
void | cacheUpdate (const KUrl &url, bool nocache, time_t expireDate) |
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 | httpError () |
HTTPProtocol (const QByteArray &protocol, const QByteArray &pool, const QByteArray &app) | |
bool | isOffline (const KUrl &url) |
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 () |
virtual void | setHost (const QString &host, quint16 port, const QString &user, const QString &pass) |
void | setLoadingErrorPage () |
virtual void | slave_status () |
virtual void | special (const QByteArray &data) |
virtual void | stat (const KUrl &url) |
virtual | ~HTTPProtocol () |
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 () |
gzFile | checkCacheEntry (bool readWrite=false) |
void | cleanCache () |
void | clearUnreadBuffer () |
void | closeCacheEntry () |
int | codeFromResponse (const QString &response) |
void | createCacheEntry (const QString &mimetype, time_t expireDate) |
QString | createNegotiateAuth () |
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 |
void | fillPromptInfo (KIO::AuthInfo *info) |
QString | findCookies (const QString &url) |
void | fixupResponseMimetype () |
QString | formatRequestUri () const |
void | forwardHttpResponseHeader () |
QByteArray | gssError (int major_status, int minor_status) |
void | httpClose (bool keepAlive) |
void | httpCloseConnection () |
bool | httpOpenConnection () |
bool | httpShouldCloseConnection () |
void | parseContentDisposition (const QString &disposition) |
long | parseDateTime (const QString &input, const QString &type) |
void | proceedUntilResponseContent (bool dataInternal=false) |
bool | proceedUntilResponseHeader () |
bool | readBody (bool dataInternal=false) |
size_t | readBuffered (char *buf, size_t size) |
int | readChunked () |
bool | readDelimitedText (char *buf, int *idx, int end, int numNewlines) |
bool | readHeaderFromCache () |
int | readLimited () |
bool | readResponseHeader () |
int | readUnlimited () |
void | resetConnectionSettings () |
void | resetResponseParsing () |
void | resetSessionSettings () |
bool | satisfyRequestFromCache (bool *success) |
bool | sendBody () |
bool | sendQuery () |
void | unread (char *buf, size_t size) |
void | updateExpireDate (time_t expireDate, bool updateCreationDate=false) |
ssize_t | write (const void *buf, size_t nbytes) |
void | writeCacheEntry (const char *buffer, int nbytes) |
Protected Attributes | |
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 |
bool | m_isFirstRequest |
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
Definition at line 56 of file http.h.
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] |
gzFile HTTPProtocol::checkCacheEntry | ( | bool | readWrite = false |
) | [protected] |
Do a cache lookup for the current url.
(m_server.url)
- Parameters:
-
readWrite If true, file is opened read/write. If false, file is opened read-only.
- Returns:
- a file stream open for reading and at the start of the header section when the Cache entry exists and is valid. 0 if no cache entry could be found, or if the entry is not valid (any more).
void HTTPProtocol::cleanCache | ( | ) | [protected] |
void HTTPProtocol::closeCacheEntry | ( | ) | [protected] |
void HTTPProtocol::closeConnection | ( | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
int HTTPProtocol::codeFromResponse | ( | const QString & | response | ) | [protected] |
void HTTPProtocol::createCacheEntry | ( | const QString & | mimetype, | |
time_t | expireDate | |||
) | [protected] |
QString HTTPProtocol::createNegotiateAuth | ( | ) | [protected] |
Creates the entity-header for Negotiate authentication.
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::fillPromptInfo | ( | KIO::AuthInfo * | info | ) | [protected] |
QString HTTPProtocol::formatRequestUri | ( | ) | const [protected] |
void HTTPProtocol::forwardHttpResponseHeader | ( | ) | [protected] |
void HTTPProtocol::get | ( | const KUrl & | url | ) | [virtual] |
Reimplemented from KIO::SlaveBase.
QByteArray HTTPProtocol::gssError | ( | int | major_status, | |
int | minor_status | |||
) | [protected] |
create GSS error string
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 | |||
) | [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] |
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::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] |
void HTTPProtocol::updateExpireDate | ( | time_t | expireDate, | |
bool | updateCreationDate = false | |||
) | [protected] |
ssize_t HTTPProtocol::write | ( | const void * | buf, | |
size_t | nbytes | |||
) | [protected] |
void HTTPProtocol::writeCacheEntry | ( | const char * | buffer, | |
int | nbytes | |||
) | [protected] |
Member Data Documentation
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] |
bool HTTPProtocol::m_isFirstRequest [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: