• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIOSlave

Classes | Public Types | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
HTTPProtocol Class Reference

#include <http.h>

Inheritance diagram for HTTPProtocol:
QObject KIO::TCPSlaveBase KIO::SlaveBase

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
}
 
- Public Types inherited from KIO::SlaveBase
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)
 
- Public Member Functions inherited from KIO::TCPSlaveBase
 TCPSlaveBase (const QByteArray &protocol, const QByteArray &poolSocket, const QByteArray &appSocket, bool autoSsl=false)
 
virtual ~TCPSlaveBase ()
 
- Public Member Functions inherited from KIO::SlaveBase
 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)
 
- Protected Member Functions inherited from KIO::TCPSlaveBase
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)
 

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
 
quint8 m_iEOFRetryCount
 
int m_iError
 
KIO::filesize_t m_iPostDataSize
 
bool m_isBusy
 
bool m_isChunked
 
bool m_isEOD
 
bool m_isEOF
 
KIO::filesize_t m_iSize
 
bool m_isLoadingErrorPage
 
bool m_isRedirection
 
int m_maxCacheAge
 
long m_maxCacheSize
 
QString m_mimeType
 
QByteArray m_mimeTypeBuffer
 
QIODevice * 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
 
- Protected Attributes inherited from KIO::TCPSlaveBase
 ResultFailed
 
 ResultFailedEarly
 
 ResultOk
 
 ResultOverridden
 
- Protected Attributes inherited from KIO::SlaveBase
 AppConnectionMade
 
MetaData mIncomingMetaData
 
MetaData mOutgoingMetaData
 
QByteArray mProtocol
 

Additional Inherited Members

- Public Attributes inherited from KIO::SlaveBase
 Information
 
 QuestionYesNo
 
 SSLMessageBox
 
 WarningContinueCancel
 
 WarningYesNo
 
 WarningYesNoCancel
 
- Protected Types inherited from KIO::TCPSlaveBase
enum  SslResultDetail
 
- Protected Types inherited from KIO::SlaveBase
enum  VirtualFunctionId
 

Detailed Description

Definition at line 56 of file http.h.

Member Enumeration Documentation

◆ AUTH_SCHEME

enum HTTPProtocol::AUTH_SCHEME

Authorization method used.

Enumerator
AUTH_None 
AUTH_Basic 
AUTH_NTLM 
AUTH_Digest 
AUTH_Negotiate 

Definition at line 68 of file http.h.

◆ CacheIOMode

enum HTTPProtocol::CacheIOMode
Enumerator
NoCache 
ReadFromCache 
WriteToCache 

Definition at line 84 of file http.h.

◆ HTTP_REV

enum HTTPProtocol::HTTP_REV

HTTP version.

Enumerator
HTTP_None 
HTTP_Unknown 
HTTP_10 
HTTP_11 
SHOUTCAST 

Definition at line 65 of file http.h.

Constructor & Destructor Documentation

◆ HTTPProtocol()

HTTPProtocol::HTTPProtocol ( const QByteArray &  protocol,
const QByteArray &  pool,
const QByteArray &  app 
)

Definition at line 437 of file http.cpp.

◆ ~HTTPProtocol()

HTTPProtocol::~HTTPProtocol ( )
virtual

Definition at line 461 of file http.cpp.

Member Function Documentation

◆ addCookies()

void HTTPProtocol::addCookies ( const QString &  url,
const QByteArray &  cookieHeader 
)
protected

Send a cookie to the cookiejar.

Definition at line 4605 of file http.cpp.

◆ addEncoding()

void HTTPProtocol::addEncoding ( const QString &  _encoding,
QStringList &  encs 
)
protected

Add an encoding on to the appropriate stack this is nececesary because transfer encodings and content encodings must be handled separately.

Definition at line 3621 of file http.cpp.

◆ authenticationHeader()

QString HTTPProtocol::authenticationHeader ( )
protected

create HTTP authentications response(s), if any

Definition at line 5146 of file http.cpp.

◆ cacheFileClose()

void HTTPProtocol::cacheFileClose ( )
protected

Definition at line 4961 of file http.cpp.

◆ cacheFileOpenRead()

bool HTTPProtocol::cacheFileOpenRead ( )
protected

Definition at line 4870 of file http.cpp.

◆ cacheFileOpenWrite()

bool HTTPProtocol::cacheFileOpenWrite ( )
protected

Definition at line 4904 of file http.cpp.

◆ cacheFilePathFromUrl()

QString HTTPProtocol::cacheFilePathFromUrl ( const KUrl &  url) const
protected

Definition at line 4860 of file http.cpp.

◆ cacheFileReadPayload()

QByteArray HTTPProtocol::cacheFileReadPayload ( int  maxLength)
protected

Definition at line 5044 of file http.cpp.

◆ cacheFileReadTextHeader1()

bool HTTPProtocol::cacheFileReadTextHeader1 ( const KUrl &  desiredUrl)
protected

check URL to guard against hash collisions, and load the etag for validation

Definition at line 4802 of file http.cpp.

◆ cacheFileReadTextHeader2()

bool HTTPProtocol::cacheFileReadTextHeader2 ( )
protected

load the rest of the text fields

Definition at line 4821 of file http.cpp.

◆ cacheFileWritePayload()

void HTTPProtocol::cacheFileWritePayload ( const QByteArray &  d)
protected

Definition at line 5057 of file http.cpp.

◆ cacheFileWriteTextHeader()

void HTTPProtocol::cacheFileWriteTextHeader ( )
protected

Definition at line 4774 of file http.cpp.

◆ cacheParseResponseHeader()

void HTTPProtocol::cacheParseResponseHeader ( const HeaderTokenizer &  tokenizer)
protected

Definition at line 3647 of file http.cpp.

◆ cachePostData()

void HTTPProtocol::cachePostData ( const QByteArray &  data)
protected

Caches the POST data in a temporary buffer.

Depending on size of content, the temporary buffer might be created either in memory or on disk as (a temporary file).

Definition at line 5089 of file http.cpp.

◆ clearPostDataBuffer()

void HTTPProtocol::clearPostDataBuffer ( )
protected

Clears the POST data buffer.

Note that calling this function results in the POST data buffer getting completely deleted.

Definition at line 5100 of file http.cpp.

◆ clearUnreadBuffer()

void HTTPProtocol::clearUnreadBuffer ( )
protected

Definition at line 2054 of file http.cpp.

◆ closeConnection()

void HTTPProtocol::closeConnection ( )
virtual

Forced close of connection.

Reimplemented from KIO::SlaveBase.

Definition at line 4016 of file http.cpp.

◆ codeFromResponse()

int HTTPProtocol::codeFromResponse ( const QString &  response)
protected

Returns the error code from a "HTTP/1.1 code Code Name" string.

Definition at line 960 of file http.cpp.

◆ copy()

void HTTPProtocol::copy ( const KUrl &  src,
const KUrl &  dest,
int  _permissions,
KIO::JobFlags  flags 
)
virtual

Definition at line 1366 of file http.cpp.

◆ copyPut()

void HTTPProtocol::copyPut ( const KUrl &  src,
const KUrl &  dest,
KIO::JobFlags  flags 
)
protected

Handles file -> webdav put requests.

Definition at line 5522 of file http.cpp.

◆ davError()

QString HTTPProtocol::davError ( int  code = -1,
const QString &  url = QString() 
)

Definition at line 1576 of file http.cpp.

◆ davFinished()

void HTTPProtocol::davFinished ( )

Definition at line 1295 of file http.cpp.

◆ davGeneric()

void HTTPProtocol::davGeneric ( const KUrl &  url,
KIO::HTTP_METHOD  method,
qint64  size = -1 
)

Definition at line 939 of file http.cpp.

◆ davHostOk()

bool HTTPProtocol::davHostOk ( )

Definition at line 1241 of file http.cpp.

◆ davLock()

void HTTPProtocol::davLock ( const KUrl &  url,
const QString &  scope,
const QString &  type,
const QString &  owner 
)

Definition at line 1492 of file http.cpp.

◆ davParseActiveLocks()

void HTTPProtocol::davParseActiveLocks ( const QDomNodeList &  activeLocks,
uint &  lockCount 
)
protected

Definition at line 1146 of file http.cpp.

◆ davParsePropstats()

void HTTPProtocol::davParsePropstats ( const QDomNodeList &  propstats,
KIO::UDSEntry &  entry 
)
protected

Definition at line 967 of file http.cpp.

◆ davProcessLocks()

QString HTTPProtocol::davProcessLocks ( )
protected

Extracts locks from metadata Returns the appropriate If: header.

Definition at line 1192 of file http.cpp.

◆ davSetRequest()

void HTTPProtocol::davSetRequest ( const QByteArray &  requestXML)
protected

Performs a WebDAV stat or list.

Definition at line 798 of file http.cpp.

◆ davStatDestination()

bool HTTPProtocol::davStatDestination ( )
protected

Stats a remote DAV file and returns true if it exists.

Definition at line 5556 of file http.cpp.

◆ davStatList()

void HTTPProtocol::davStatList ( const KUrl &  url,
bool  stat = true 
)
protected

Definition at line 804 of file http.cpp.

◆ davUnlock()

void HTTPProtocol::davUnlock ( const KUrl &  url)

Definition at line 1556 of file http.cpp.

◆ defaultPort()

quint16 HTTPProtocol::defaultPort ( ) const
protected

Definition at line 487 of file http.cpp.

◆ del()

void HTTPProtocol::del ( const KUrl &  url,
bool  _isfile 
)
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 1446 of file http.cpp.

◆ error

void HTTPProtocol::error ( int  errid,
const QString &  text 
)
protectedslot

Definition at line 4582 of file http.cpp.

◆ findCookies()

QString HTTPProtocol::findCookies ( const QString &  url)
protected

Look for cookies in the cookiejar.

Definition at line 4613 of file http.cpp.

◆ fixupResponseContentEncoding()

void HTTPProtocol::fixupResponseContentEncoding ( )
protected

fix common content-encoding errors by webservers.

Helper for readResponseHeader().

Definition at line 2834 of file http.cpp.

◆ fixupResponseMimetype()

void HTTPProtocol::fixupResponseMimetype ( )
protected

fix common mimetype errors by webservers.

Helper for readResponseHeader().

Definition at line 2770 of file http.cpp.

◆ formatRequestUri()

QString HTTPProtocol::formatRequestUri ( ) const
protected

Definition at line 2336 of file http.cpp.

◆ forwardHttpResponseHeader()

void HTTPProtocol::forwardHttpResponseHeader ( bool  forwardImmediately = true)
protected

Definition at line 2719 of file http.cpp.

◆ get()

void HTTPProtocol::get ( const KUrl &  url)
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 1322 of file http.cpp.

◆ handleAuthenticationHeader()

bool HTTPProtocol::handleAuthenticationHeader ( const HeaderTokenizer *  tokenizer)
protected

Handles HTTP authentication.

Definition at line 5357 of file http.cpp.

◆ httpClose()

void HTTPProtocol::httpClose ( bool  keepAlive)
protected

Close transfer.

Definition at line 3988 of file http.cpp.

◆ httpCloseConnection()

void HTTPProtocol::httpCloseConnection ( )
protected

Close connection.

Definition at line 4022 of file http.cpp.

◆ httpOpenConnection()

bool HTTPProtocol::httpOpenConnection ( )
protected

Open connection.

Definition at line 2185 of file http.cpp.

◆ httpShouldCloseConnection()

bool HTTPProtocol::httpShouldCloseConnection ( )
protected

Check whether to keep or close the connection.

Definition at line 2163 of file http.cpp.

◆ isOffline()

bool HTTPProtocol::isOffline ( )

Check network status.

Definition at line 1931 of file http.cpp.

◆ listDir()

void HTTPProtocol::listDir ( const KUrl &  url)
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 787 of file http.cpp.

◆ maybeSetRequestUrl()

bool HTTPProtocol::maybeSetRequestUrl ( const KUrl &  u)

Definition at line 650 of file http.cpp.

◆ mimetype()

void HTTPProtocol::mimetype ( const KUrl &  url)
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 4041 of file http.cpp.

◆ mkdir()

void HTTPProtocol::mkdir ( const KUrl &  url,
int  _permissions 
)
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 1302 of file http.cpp.

◆ multiGet()

void HTTPProtocol::multiGet ( const QByteArray &  data)
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 1945 of file http.cpp.

◆ parseContentDisposition()

void HTTPProtocol::parseContentDisposition ( const QString &  disposition)
protected

Definition at line 3609 of file http.cpp.

◆ parseHeaderFromCache()

bool HTTPProtocol::parseHeaderFromCache ( )
protected

Definition at line 2731 of file http.cpp.

◆ post()

void HTTPProtocol::post ( const KUrl &  url,
qint64  size = -1 
)

Definition at line 1477 of file http.cpp.

◆ proceedUntilResponseContent()

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.

where dataInternal == true, the content is to be made available to an internal function.

Definition at line 673 of file http.cpp.

◆ proceedUntilResponseHeader()

bool HTTPProtocol::proceedUntilResponseHeader ( )
protected

Ensure we are connected, send our query, and get the response header.

Definition at line 696 of file http.cpp.

◆ proxyAuthenticationForSocket

void HTTPProtocol::proxyAuthenticationForSocket ( const QNetworkProxy &  proxy,
QAuthenticator *  authenticator 
)
protectedslot

Definition at line 5231 of file http.cpp.

◆ put()

void HTTPProtocol::put ( const KUrl &  url,
int  _mode,
KIO::JobFlags  flags 
)
virtual

Definition at line 1337 of file http.cpp.

◆ readBody()

bool HTTPProtocol::readBody ( bool  dataInternal = false)
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.

Definition at line 4342 of file http.cpp.

◆ readBuffered()

size_t HTTPProtocol::readBuffered ( char *  buf,
size_t  size,
bool  unlimited = true 
)
protected

Definition at line 2075 of file http.cpp.

◆ readChunked()

int HTTPProtocol::readChunked ( )
protected

Read a chunk.

Read a chunk from the data stream.

Definition at line 4144 of file http.cpp.

◆ readDelimitedText()

bool HTTPProtocol::readDelimitedText ( char *  buf,
int *  idx,
int  end,
int  numNewlines 
)
protected

Definition at line 2109 of file http.cpp.

◆ readLimited()

int HTTPProtocol::readLimited ( )
protected

Read maximum m_iSize bytes.

Definition at line 4215 of file http.cpp.

◆ readResponseHeader()

bool HTTPProtocol::readResponseHeader ( )
protected

This function will read in the return header from the server.

It will not read in the body of the return message. It will also not transmit the header to our client as the client doesn't need to know the gory details of HTTP headers.

Definition at line 2901 of file http.cpp.

◆ readUnlimited()

int HTTPProtocol::readUnlimited ( )
protected

Read as much as possible.

Definition at line 4237 of file http.cpp.

◆ rename()

void HTTPProtocol::rename ( const KUrl &  src,
const KUrl &  dest,
KIO::JobFlags  flags 
)
virtual

Definition at line 1403 of file http.cpp.

◆ reparseConfiguration()

void HTTPProtocol::reparseConfiguration ( )
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 466 of file http.cpp.

◆ resetConnectionSettings()

void HTTPProtocol::resetConnectionSettings ( )
protected

Resets any per connection settings.

These are different from per-session settings in that they must be invalidated every time a request is made, e.g. a retry to re-send the header to the server, as compared to only when a new request arrives.

Definition at line 480 of file http.cpp.

◆ resetResponseParsing()

void HTTPProtocol::resetResponseParsing ( )
protected

Resets variables related to parsing a response.

Definition at line 492 of file http.cpp.

◆ resetSessionSettings()

void HTTPProtocol::resetSessionSettings ( )
protected

Resets any per session settings.

Definition at line 508 of file http.cpp.

◆ retrieveAllData()

bool HTTPProtocol::retrieveAllData ( )
protected

Returns true on successful retrieval of all content data.

Definition at line 5109 of file http.cpp.

◆ satisfyRequestFromCache()

bool HTTPProtocol::satisfyRequestFromCache ( bool *  cacheHasPage)
protected

Return true if the request is already "done", false otherwise.

cacheHasPage will be set to true if the page was found, false otherwise.

Definition at line 2295 of file http.cpp.

◆ saveAuthenticationData()

void HTTPProtocol::saveAuthenticationData ( )
protected

Saves HTTP authentication data.

Definition at line 5311 of file http.cpp.

◆ saveProxyAuthenticationForSocket

void HTTPProtocol::saveProxyAuthenticationForSocket ( )
protectedslot

Definition at line 5290 of file http.cpp.

◆ sendBody()

bool HTTPProtocol::sendBody ( )
protected

Definition at line 3894 of file http.cpp.

◆ sendCacheCleanerCommand()

void HTTPProtocol::sendCacheCleanerCommand ( const QByteArray &  command)
protected

Definition at line 5020 of file http.cpp.

◆ sendCachedBody()

bool HTTPProtocol::sendCachedBody ( )
protected

Definition at line 3851 of file http.cpp.

◆ sendErrorPageNotification()

bool HTTPProtocol::sendErrorPageNotification ( )

Call SlaveBase::errorPage() and remember that we've called it.

Definition at line 1918 of file http.cpp.

◆ sendHttpError()

bool HTTPProtocol::sendHttpError ( )

Generate and send error message based on response code.

Definition at line 1887 of file http.cpp.

◆ sendQuery()

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

Definition at line 2377 of file http.cpp.

◆ setCacheabilityMetadata()

void HTTPProtocol::setCacheabilityMetadata ( bool  cachingAllowed)
protected

Definition at line 3836 of file http.cpp.

◆ setHost()

void HTTPProtocol::setHost ( const QString &  host,
quint16  port,
const QString &  user,
const QString &  pass 
)
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 618 of file http.cpp.

◆ slave_status()

void HTTPProtocol::slave_status ( )
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 4031 of file http.cpp.

◆ slotData

void HTTPProtocol::slotData ( const QByteArray &  _d)
protectedslot

Definition at line 4256 of file http.cpp.

◆ slotFilterError

void HTTPProtocol::slotFilterError ( const QString &  text)
protectedslot

Definition at line 4577 of file http.cpp.

◆ special()

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.

Definition at line 4060 of file http.cpp.

◆ stat()

void HTTPProtocol::stat ( const KUrl &  url)
virtual

Reimplemented from KIO::SlaveBase.

Definition at line 755 of file http.cpp.

◆ unread()

void HTTPProtocol::unread ( char *  buf,
size_t  size 
)
protected

Definition at line 2061 of file http.cpp.

◆ write()

ssize_t HTTPProtocol::write ( const void *  buf,
size_t  nbytes 
)
protected

A thin wrapper around TCPSlaveBase::write() that will retry writing as long as no error occurs.

Definition at line 2035 of file http.cpp.

Member Data Documentation

◆ m_cacheCleanerConnection

QLocalSocket HTTPProtocol::m_cacheCleanerConnection
protected

Connection to the cache cleaner process.

Definition at line 575 of file http.h.

◆ m_contentEncodings

QStringList HTTPProtocol::m_contentEncodings
protected

Definition at line 547 of file http.h.

◆ m_contentMD5

QString HTTPProtocol::m_contentMD5
protected

Definition at line 548 of file http.h.

◆ m_cpMimeBuffer

bool HTTPProtocol::m_cpMimeBuffer
protected

Definition at line 562 of file http.h.

◆ m_dataInternal

bool HTTPProtocol::m_dataInternal
protected

Data is for internal consumption.

Definition at line 533 of file http.h.

◆ m_davCapabilities

QStringList HTTPProtocol::m_davCapabilities
protected

Definition at line 555 of file http.h.

◆ m_davHostOk

bool HTTPProtocol::m_davHostOk
protected

Definition at line 557 of file http.h.

◆ m_davHostUnsupported

bool HTTPProtocol::m_davHostUnsupported
protected

Definition at line 558 of file http.h.

◆ m_iBytesLeft

KIO::filesize_t HTTPProtocol::m_iBytesLeft
protected

of bytes left to receive in this message.

Definition at line 530 of file http.h.

◆ m_iContentLeft

KIO::filesize_t HTTPProtocol::m_iContentLeft
protected

of content bytes left

Definition at line 531 of file http.h.

◆ m_iEOFRetryCount

quint8 HTTPProtocol::m_iEOFRetryCount
protected

Definition at line 594 of file http.h.

◆ m_iError

int HTTPProtocol::m_iError
protected

Definition at line 586 of file http.h.

◆ m_iPostDataSize

KIO::filesize_t HTTPProtocol::m_iPostDataSize
protected

Definition at line 529 of file http.h.

◆ m_isBusy

bool HTTPProtocol::m_isBusy
protected

Busy handling request queue.

Definition at line 536 of file http.h.

◆ m_isChunked

bool HTTPProtocol::m_isChunked
protected

Chunked transfer encoding.

Definition at line 534 of file http.h.

◆ m_isEOD

bool HTTPProtocol::m_isEOD
protected

Definition at line 538 of file http.h.

◆ m_isEOF

bool HTTPProtocol::m_isEOF
protected

Definition at line 537 of file http.h.

◆ m_iSize

KIO::filesize_t HTTPProtocol::m_iSize
protected

Expected size of message.

Definition at line 528 of file http.h.

◆ m_isLoadingErrorPage

bool HTTPProtocol::m_isLoadingErrorPage
protected

Definition at line 588 of file http.h.

◆ m_isRedirection

bool HTTPProtocol::m_isRedirection
protected

Indicates current request is a redirection.

Definition at line 541 of file http.h.

◆ m_maxCacheAge

int HTTPProtocol::m_maxCacheAge
protected

Maximum age of a cache entry in seconds.

Definition at line 572 of file http.h.

◆ m_maxCacheSize

long HTTPProtocol::m_maxCacheSize
protected

Maximum cache size in Kb.

Definition at line 573 of file http.h.

◆ m_mimeType

QString HTTPProtocol::m_mimeType
protected

Definition at line 549 of file http.h.

◆ m_mimeTypeBuffer

QByteArray HTTPProtocol::m_mimeTypeBuffer
protected

Definition at line 563 of file http.h.

◆ m_POSTbuf

QIODevice* HTTPProtocol::m_POSTbuf
protected

Definition at line 569 of file http.h.

◆ m_protocol

QByteArray HTTPProtocol::m_protocol
protected

Definition at line 578 of file http.h.

◆ m_proxyAuth

KAbstractHttpAuthentication* HTTPProtocol::m_proxyAuth
protected

Definition at line 581 of file http.h.

◆ m_receiveBuf

QByteArray HTTPProtocol::m_receiveBuf
protected

Receive buffer.

Definition at line 532 of file http.h.

◆ m_remoteRespTimeout

int HTTPProtocol::m_remoteRespTimeout
protected

Definition at line 591 of file http.h.

◆ m_request

HTTPRequest HTTPProtocol::m_request
protected

Definition at line 524 of file http.h.

◆ m_requestQueue

QList<HTTPRequest> HTTPProtocol::m_requestQueue
protected

Definition at line 525 of file http.h.

◆ m_responseHeaders

QStringList HTTPProtocol::m_responseHeaders
protected

All headers.

Definition at line 542 of file http.h.

◆ m_server

HTTPServerState HTTPProtocol::m_server
protected

Definition at line 523 of file http.h.

◆ m_socketProxyAuth

QAuthenticator* HTTPProtocol::m_socketProxyAuth
protected

Definition at line 583 of file http.h.

◆ m_strCacheDir

QString HTTPProtocol::m_strCacheDir
protected

Location of the cache.

Definition at line 574 of file http.h.

◆ m_transferEncodings

QStringList HTTPProtocol::m_transferEncodings
protected

Definition at line 546 of file http.h.

◆ m_unreadBuf

QByteArray HTTPProtocol::m_unreadBuf
protected

Definition at line 596 of file http.h.

◆ m_webDavDataBuf

QByteArray HTTPProtocol::m_webDavDataBuf
protected

Definition at line 554 of file http.h.

◆ m_wwwAuth

KAbstractHttpAuthentication* HTTPProtocol::m_wwwAuth
protected

Definition at line 580 of file http.h.


The documentation for this class was generated from the following files:
  • http.h
  • http.cpp
This file is part of the KDE documentation.
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.

KIOSlave

Skip menu "KIOSlave"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal