KIOSlave
#include <http.h>

Classes | |
struct | CacheTag |
struct | DAVRequest |
struct | HTTPRequest |
struct | HTTPServerState |
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 } |
![]() | |
enum | MessageBoxType |
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, qint64 size=-1) |
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) |
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, qint64 size=-1) |
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 () |
bool | sendHttpError () |
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) |
![]() | |
TCPSlaveBase (const QByteArray &protocol, const QByteArray &poolSocket, const QByteArray &appSocket, bool autoSsl=false) | |
virtual | ~TCPSlaveBase () |
![]() | |
SlaveBase (const QByteArray &protocol, const QByteArray &pool_socket, const QByteArray &app_socket) | |
virtual | ~SlaveBase () |
MetaData | allMetaData () const |
bool | cacheAuthentication (const AuthInfo &info) |
void | canResume () |
bool | canResume (KIO::filesize_t offset) |
bool | checkCachedAuthentication (AuthInfo &info) |
virtual void | chmod (const KUrl &url, int permissions) |
virtual void | chown (const KUrl &url, const QString &owner, const QString &group) |
virtual void | close () |
virtual void | closeConnection () |
KConfigGroup * | config () |
void | connected () |
void | connectSlave (const QString &path) |
int | connectTimeout () |
virtual void | copy (const KUrl &src, const KUrl &dest, int permissions, JobFlags flags) |
void | data (const QByteArray &data) |
void | dataReq () |
virtual void | del (const KUrl &url, bool isfile) |
void | disconnectSlave () |
virtual void | dispatch (int command, const QByteArray &data) |
void | dispatchLoop () |
virtual void | dispatchOpenCommand (int command, const QByteArray &data) |
void | dropNetwork (const QString &host=QString()) |
void | error (int _errid, const QString &_text) |
void | errorPage () |
void | exit () |
void | finished () |
virtual void | get (const KUrl &url) |
bool | hasMetaData (const QString &key) const |
void | infoMessage (const QString &msg) |
virtual void | listDir (const KUrl &url) |
void | listEntries (const UDSEntryList &_entry) |
void | listEntry (const UDSEntry &_entry, bool ready) |
void | lookupHost (const QString &host) |
int | messageBox (const QString &text, MessageBoxType type, const QString &caption=QString(), const QString &buttonYes=i18n("&Yes"), const QString &buttonNo=i18n("&No"), const QString &dontAskAgainName=QString()) |
int | messageBox (MessageBoxType type, const QString &text, const QString &caption=QString(), const QString &buttonYes=i18n("&Yes"), const QString &buttonNo=i18n("&No")) |
QString | metaData (const QString &key) const |
virtual void | mimetype (const KUrl &url) |
void | mimeType (const QString &_type) |
virtual void | mkdir (const KUrl &url, int permissions) |
virtual void | multiGet (const QByteArray &data) |
void | needSubUrlData () |
virtual void | open (const KUrl &url, QIODevice::OpenMode mode) |
virtual void | openConnection () |
void | opened () |
bool | openPasswordDialog (KIO::AuthInfo &info, const QString &errorMsg=QString()) |
void | position (KIO::filesize_t _pos) |
void | processedPercent (float percent) |
void | processedSize (KIO::filesize_t _bytes) |
int | proxyConnectTimeout () |
virtual void | put (const KUrl &url, int permissions, JobFlags flags) |
virtual void | read (KIO::filesize_t size) |
int | readData (QByteArray &buffer) |
int | readTimeout () |
void | redirection (const KUrl &_url) |
KRemoteEncoding * | remoteEncoding () |
virtual void | rename (const KUrl &src, const KUrl &dest, JobFlags flags) |
virtual void | reparseConfiguration () |
bool | requestNetwork (const QString &host=QString()) |
int | responseTimeout () |
virtual void | seek (KIO::filesize_t offset) |
void | sendAndKeepMetaData () |
void | sendMetaData () |
virtual void | setHost (const QString &host, quint16 port, const QString &user, const QString &pass) |
void | setKillFlag () |
virtual void | setLinkDest (const KUrl &url, const QString &target) |
void | setMetaData (const QString &key, const QString &value) |
virtual void | setModificationTime (const KUrl &url, const QDateTime &mtime) |
virtual void | setSubUrl (const KUrl &url) |
void | setTimeoutSpecialCommand (int timeout, const QByteArray &data=QByteArray()) |
virtual void | slave_status () |
void | slaveStatus (const QString &host, bool connected) |
virtual void | special (const QByteArray &data) |
void | speed (unsigned long _bytes_per_second) |
virtual void | stat (const KUrl &url) |
void | statEntry (const UDSEntry &_entry) |
virtual void | symlink (const QString &target, const KUrl &dest, JobFlags flags) |
void | totalSize (KIO::filesize_t _bytes) |
int | waitForAnswer (int expected1, int expected2, QByteArray &data, int *pCmd=0) |
int | waitForHostInfo (QHostInfo &info) |
void | warning (const QString &msg) |
bool | wasKilled () const |
virtual void | write (const QByteArray &data) |
void | written (KIO::filesize_t _bytes) |
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 | cachePostData (const QByteArray &) |
void | clearPostDataBuffer () |
void | clearUnreadBuffer () |
int | codeFromResponse (const QString &response) |
void | copyPut (const KUrl &src, const KUrl &dest, KIO::JobFlags flags) |
void | davParseActiveLocks (const QDomNodeList &activeLocks, uint &lockCount) |
void | davParsePropstats (const QDomNodeList &propstats, KIO::UDSEntry &entry) |
QString | davProcessLocks () |
void | davSetRequest (const QByteArray &requestXML) |
bool | davStatDestination () |
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) |
bool | handleAuthenticationHeader (const HeaderTokenizer *tokenizer) |
void | httpClose (bool keepAlive) |
void | httpCloseConnection () |
bool | httpOpenConnection () |
bool | httpShouldCloseConnection () |
void | parseContentDisposition (const QString &disposition) |
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 | retrieveAllData () |
bool | satisfyRequestFromCache (bool *cacheHasPage) |
void | saveAuthenticationData () |
bool | sendBody () |
void | sendCacheCleanerCommand (const QByteArray &command) |
bool | sendCachedBody () |
bool | sendQuery () |
void | setCacheabilityMetadata (bool cachingAllowed) |
void | unread (char *buf, size_t size) |
ssize_t | write (const void *buf, size_t nbytes) |
![]() | |
bool | atEnd () const |
int | connectToHost (const QString &host, quint16 port, QString *errorString=0) |
bool | connectToHost (const QString &protocol, const QString &host, quint16 port) |
void | disconnectFromHost () |
bool | isAutoSsl () const |
bool | isConnected () const |
bool | isUsingSsl () const |
quint16 | port () const |
ssize_t | read (char *data, ssize_t len) |
virtual void | read (KIO::filesize_t size) |
ssize_t | readLine (char *data, ssize_t len) |
void | setBlocking (bool b) |
QIODevice * | socket () const |
bool | startSsl () |
virtual void | virtual_hook (int id, void *data) |
bool | waitForResponse (int t) |
ssize_t | write (const char *data, ssize_t len) |
virtual void | write (const QByteArray &data) |
virtual void | virtual_hook (int id, void *data) |
Additional Inherited Members | |
![]() | |
Information | |
QuestionYesNo | |
SSLMessageBox | |
WarningContinueCancel | |
WarningYesNo | |
WarningYesNoCancel | |
![]() | |
enum | SslResultDetail |
![]() | |
enum | VirtualFunctionId |
Detailed Description
Member Enumeration Documentation
◆ AUTH_SCHEME
◆ CacheIOMode
◆ HTTP_REV
Constructor & Destructor Documentation
◆ HTTPProtocol()
HTTPProtocol::HTTPProtocol | ( | const QByteArray & | protocol, |
const QByteArray & | pool, | ||
const QByteArray & | app | ||
) |
◆ ~HTTPProtocol()
Member Function Documentation
◆ addCookies()
|
protected |
◆ addEncoding()
|
protected |
◆ authenticationHeader()
|
protected |
◆ cacheFileClose()
◆ cacheFileOpenRead()
◆ cacheFileOpenWrite()
◆ cacheFilePathFromUrl()
|
protected |
◆ cacheFileReadPayload()
|
protected |
◆ cacheFileReadTextHeader1()
|
protected |
◆ cacheFileReadTextHeader2()
|
protected |
◆ cacheFileWritePayload()
|
protected |
◆ cacheFileWriteTextHeader()
◆ cacheParseResponseHeader()
|
protected |
◆ cachePostData()
|
protected |
◆ clearPostDataBuffer()
|
protected |
◆ clearUnreadBuffer()
◆ closeConnection()
|
virtual |
Forced close of connection.
Reimplemented from KIO::SlaveBase.
◆ codeFromResponse()
|
protected |
◆ copy()
◆ copyPut()
◆ davError()
QString HTTPProtocol::davError | ( | int | code = -1 , |
const QString & | url = QString() |
||
) |
◆ davFinished()
◆ davGeneric()
void HTTPProtocol::davGeneric | ( | const KUrl & | url, |
KIO::HTTP_METHOD | method, | ||
qint64 | size = -1 |
||
) |
◆ davHostOk()
◆ davLock()
void HTTPProtocol::davLock | ( | const KUrl & | url, |
const QString & | scope, | ||
const QString & | type, | ||
const QString & | owner | ||
) |
◆ davParseActiveLocks()
|
protected |
◆ davParsePropstats()
|
protected |
◆ davProcessLocks()
|
protected |
◆ davSetRequest()
|
protected |
◆ davStatDestination()
|
protected |
◆ davStatList()
|
protected |
◆ davUnlock()
◆ defaultPort()
◆ del()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ error
|
protectedslot |
◆ findCookies()
|
protected |
◆ fixupResponseContentEncoding()
|
protected |
fix common content-encoding errors by webservers.
Helper for readResponseHeader().
◆ fixupResponseMimetype()
|
protected |
fix common mimetype errors by webservers.
Helper for readResponseHeader().
◆ formatRequestUri()
|
protected |
◆ forwardHttpResponseHeader()
|
protected |
◆ get()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ handleAuthenticationHeader()
|
protected |
◆ httpClose()
|
protected |
◆ httpCloseConnection()
|
protected |
◆ httpOpenConnection()
|
protected |
◆ httpShouldCloseConnection()
|
protected |
◆ isOffline()
◆ listDir()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ maybeSetRequestUrl()
◆ mimetype()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ mkdir()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ multiGet()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ parseContentDisposition()
|
protected |
◆ parseHeaderFromCache()
◆ post()
void HTTPProtocol::post | ( | const KUrl & | url, |
qint64 | size = -1 |
||
) |
◆ proceedUntilResponseContent()
|
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.
where dataInternal == true, the content is to be made available to an internal function.
◆ proceedUntilResponseHeader()
|
protected |
◆ proxyAuthenticationForSocket
|
protectedslot |
◆ put()
|
virtual |
◆ readBody()
|
protected |
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.
◆ readBuffered()
|
protected |
◆ readChunked()
|
protected |
◆ readDelimitedText()
|
protected |
◆ readLimited()
|
protected |
◆ readResponseHeader()
|
protected |
◆ readUnlimited()
|
protected |
◆ rename()
◆ reparseConfiguration()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ resetConnectionSettings()
|
protected |
◆ resetResponseParsing()
|
protected |
◆ resetSessionSettings()
|
protected |
◆ retrieveAllData()
|
protected |
◆ satisfyRequestFromCache()
|
protected |
◆ saveAuthenticationData()
|
protected |
◆ saveProxyAuthenticationForSocket
|
protectedslot |
◆ sendBody()
◆ sendCacheCleanerCommand()
|
protected |
◆ sendCachedBody()
◆ sendErrorPageNotification()
bool HTTPProtocol::sendErrorPageNotification | ( | ) |
◆ sendHttpError()
bool HTTPProtocol::sendHttpError | ( | ) |
◆ 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
◆ setCacheabilityMetadata()
|
protected |
◆ setHost()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ slave_status()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ slotData
|
protectedslot |
◆ slotFilterError
|
protectedslot |
◆ special()
|
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.
◆ stat()
|
virtual |
Reimplemented from KIO::SlaveBase.
◆ unread()
|
protected |
◆ write()
|
protected |
Member Data Documentation
◆ m_cacheCleanerConnection
|
protected |
◆ m_contentEncodings
◆ m_contentMD5
◆ m_cpMimeBuffer
◆ m_dataInternal
|
protected |
◆ m_davCapabilities
◆ m_davHostOk
◆ m_davHostUnsupported
◆ m_iBytesLeft
|
protected |
◆ m_iContentLeft
|
protected |
◆ m_iEOFRetryCount
◆ m_iError
◆ m_iPostDataSize
|
protected |
◆ m_isBusy
|
protected |
◆ m_isChunked
|
protected |
◆ m_isEOD
◆ m_isEOF
◆ m_iSize
|
protected |
◆ m_isLoadingErrorPage
◆ m_isRedirection
|
protected |
◆ m_maxCacheAge
|
protected |
◆ m_maxCacheSize
|
protected |
◆ m_mimeType
◆ m_mimeTypeBuffer
◆ m_POSTbuf
◆ m_protocol
◆ m_proxyAuth
|
protected |
◆ m_receiveBuf
|
protected |
◆ m_remoteRespTimeout
◆ m_request
|
protected |
◆ m_requestQueue
|
protected |
◆ m_responseHeaders
|
protected |
◆ m_server
|
protected |
◆ m_socketProxyAuth
◆ m_strCacheDir
|
protected |
◆ m_transferEncodings
◆ m_unreadBuf
◆ m_webDavDataBuf
◆ m_wwwAuth
|
protected |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.