HTTPProtocol Class ReferenceInheritance diagram for HTTPProtocol:
List of all members.
Detailed Description
Definition at line 49 of file http.h.
|
Public Types |
| HTTP_None |
| HTTP_Unknown |
| HTTP_10 |
| HTTP_11 |
| SHOUTCAST |
| AUTH_None |
| AUTH_Basic |
| AUTH_NTLM |
| AUTH_Digest |
| AUTH_Negotiate |
enum | HTTP_REV {
HTTP_None,
HTTP_Unknown,
HTTP_10,
HTTP_11,
SHOUTCAST
} |
enum | HTTP_AUTH {
AUTH_None,
AUTH_Basic,
AUTH_NTLM,
AUTH_Digest,
AUTH_Negotiate
} |
Public Member Functions |
| HTTPProtocol (const QCString &protocol, const QCString &pool, const QCString &app) |
virtual | ~HTTPProtocol () |
virtual void | setHost (const QString &host, int port, const QString &user, const QString &pass) |
virtual void | slave_status () |
virtual void | get (const KURL &url) |
virtual void | put (const KURL &url, int _mode, bool overwrite, bool _resume) |
virtual void | listDir (const KURL &url) |
virtual void | mkdir (const KURL &url, int _permissions) |
virtual void | rename (const KURL &src, const KURL &dest, bool overwrite) |
virtual void | copy (const KURL &src, const KURL &dest, int _permissions, bool overwrite) |
virtual void | del (const KURL &url, bool _isfile) |
bool | davHostOk () |
void | davGeneric (const KURL &url, KIO::HTTP_METHOD method) |
void | davLock (const KURL &url, const QString &scope, const QString &type, const QString &owner) |
void | davUnlock (const KURL &url) |
void | davFinished () |
QString | davError (int code=-1, QString url=QString::null) |
virtual void | special (const QByteArray &data) |
virtual void | mimetype (const KURL &url) |
virtual void | stat (const KURL &url) |
virtual void | reparseConfiguration () |
virtual void | closeConnection () |
void | post (const KURL &url) |
void | multiGet (const QByteArray &data) |
bool | checkRequestURL (const KURL &) |
void | cacheUpdate (const KURL &url, bool nocache, time_t expireDate) |
void | httpError () |
bool | isOffline (const KURL &url) |
Protected Slots |
void | slotData (const QByteArray &) |
void | error (int _errid, const QString &_text) |
Protected Member Functions |
int | readChunked () |
int | readLimited () |
int | readUnlimited () |
ssize_t | write (const void *buf, size_t nbytes) |
ssize_t | read (void *b, size_t nbytes) |
char * | gets (char *str, int size) |
void | setRewindMarker () |
void | rewind () |
void | addEncoding (QString, QStringList &) |
void | configAuth (char *, bool) |
bool | httpOpen () |
void | httpClose (bool keepAlive) |
bool | httpOpenConnection () |
void | httpCloseConnection () |
void | httpCheckConnection () |
void | forwardHttpResponseHeader () |
bool | readHeader () |
bool | sendBody () |
bool | readBody (bool dataInternal=false) |
void | davSetRequest (const QCString &requestXML) |
void | davStatList (const KURL &url, bool stat=true) |
void | davParsePropstats (const QDomNodeList &propstats, KIO::UDSEntry &entry) |
void | davParseActiveLocks (const QDomNodeList &activeLocks, uint &lockCount) |
long | parseDateTime (const QString &input, const QString &type) |
int | codeFromResponse (const QString &response) |
QString | davProcessLocks () |
void | addCookies (const QString &url, const QCString &cookieHeader) |
QString | findCookies (const QString &url) |
FILE * | checkCacheEntry (bool readWrite=false) |
void | createCacheEntry (const QString &mimetype, time_t expireDate) |
void | writeCacheEntry (const char *buffer, int nbytes) |
void | closeCacheEntry () |
void | updateExpireDate (time_t expireDate, bool updateCreationDate=false) |
void | cleanCache () |
void | retrieveContent (bool dataInternal=false) |
bool | retrieveHeader (bool close_connection=true) |
void | resetSessionSettings () |
void | resetResponseSettings () |
void | resetConnectionSettings () |
QString | proxyAuthenticationHeader () |
bool | getAuthorization () |
void | saveAuthorization () |
QString | createBasicAuth (bool isForProxy=false) |
QString | createDigestAuth (bool isForProxy=false) |
QString | createNTLMAuth (bool isForProxy=false) |
QString | createNegotiateAuth () |
QCString | gssError (int major_status, int minor_status) |
void | calculateResponse (DigestAuthInfo &info, QCString &Response) |
bool | retryPrompt () |
void | promptInfo (KIO::AuthInfo &info) |
Protected Attributes |
HTTPState | m_state |
HTTPRequest | m_request |
QPtrList< HTTPRequest > | m_requestQueue |
bool | m_bBusy |
bool | m_bEOF |
bool | m_bEOD |
QStringList | m_responseHeader |
KURL | m_redirectLocation |
bool | m_bRedirect |
bool | m_bChunked |
KIO::filesize_t | m_iSize |
KIO::filesize_t | m_iBytesLeft |
KIO::filesize_t | m_iContentLeft |
QByteArray | m_bufReceive |
bool | m_dataInternal |
char | m_lineBuf [1024] |
char | m_rewindBuf [4096] |
size_t | m_rewindCount |
char * | m_linePtr |
size_t | m_lineCount |
char * | m_lineBufUnget |
char * | m_linePtrUnget |
size_t | m_lineCountUnget |
bool | m_cpMimeBuffer |
QByteArray | m_mimeTypeBuffer |
QStringList | m_qTransferEncodings |
QStringList | m_qContentEncodings |
QString | m_sContentMD5 |
QString | m_strMimeType |
QByteArray | m_bufWebDavData |
QStringList | m_davCapabilities |
bool | m_davHostOk |
bool | m_davHostUnsupported |
QByteArray | m_bufPOST |
int | m_maxCacheAge |
long | m_maxCacheSize |
QString | m_strCacheDir |
bool | m_bUseProxy |
bool | m_bNeedTunnel |
bool | m_bIsTunneled |
bool | m_bProxyAuthValid |
int | m_iProxyPort |
KURL | m_proxyURL |
QString | m_strProxyRealm |
QCString | m_protocol |
QString | m_strRealm |
QString | m_strAuthorization |
QString | m_strProxyAuthorization |
HTTP_AUTH | Authentication |
HTTP_AUTH | ProxyAuthentication |
bool | m_bUnauthorized |
short unsigned int | m_iProxyAuthCount |
short unsigned int | m_iWWWAuthCount |
bool | m_bFirstRequest |
bool | m_bKeepAlive |
int | m_keepAliveTimeout |
bool | m_bPersistentProxyConnection |
bool | m_bError |
unsigned int | m_responseCode |
unsigned int | m_prevResponseCode |
int | m_proxyConnTimeout |
int | m_remoteConnTimeout |
int | m_remoteRespTimeout |
int | m_pid |
Classes |
struct | DAVRequest |
| DAV-specific request elements for the current connection. More...
|
struct | DigestAuthInfo |
struct | HTTPRequest |
| The request for the current connection. More...
|
struct | HTTPState |
| State of the current Connection. More...
|
Member Enumeration Documentation
Authorization method used.
Definition at line 61 of file http.h.
HTTP version.
Definition at line 58 of file http.h.
Member Function Documentation
void HTTPProtocol::addCookies |
( |
const QString & |
url, |
|
|
const QCString & |
cookieHeader | |
|
) |
| | [protected] |
Send a cookie to the cookiejar.
Definition at line 4571 of file http.cc.
Add an encoding on to the appropriate stack this is nececesary because transfer encodings and content encodings must be handled separately.
Definition at line 3862 of file http.cc.
Calcualtes the message digest response based on RFC 2617.
Definition at line 5647 of file http.cc.
FILE * HTTPProtocol::checkCacheEntry |
( |
bool |
readWrite = false |
) |
[protected] |
Do a cache lookup for the current url.
(m_state.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).
Definition at line 4653 of file http.cc.
void HTTPProtocol::cleanCache |
( |
|
) |
[protected] |
Quick check whether the cache needs cleaning.
Definition at line 4953 of file http.cc.
void HTTPProtocol::closeCacheEntry |
( |
|
) |
[protected] |
Close cache entry.
Definition at line 4934 of file http.cc.
int HTTPProtocol::codeFromResponse |
( |
const QString & |
response |
) |
[protected] |
Returns the error code from a "HTTP/1.1 code Code Name" string.
Definition at line 849 of file http.cc.
QString HTTPProtocol::createBasicAuth |
( |
bool |
isForProxy = false |
) |
[protected] |
Creates the entity-header for Basic authentication.
Definition at line 5617 of file http.cc.
void HTTPProtocol::createCacheEntry |
( |
const QString & |
mimetype, |
|
|
time_t |
expireDate | |
|
) |
| | [protected] |
Create a cache entry for the current url.
(m_state.url)
Set the contents type of the cache entry to 'mimetype'.
Definition at line 4851 of file http.cc.
QString HTTPProtocol::createDigestAuth |
( |
bool |
isForProxy = false |
) |
[protected] |
Creates the entity-header for Digest authentication.
Definition at line 5714 of file http.cc.
QString HTTPProtocol::createNegotiateAuth |
( |
|
) |
[protected] |
Creates the entity-header for Negotiate authentication.
Definition at line 5553 of file http.cc.
QString HTTPProtocol::createNTLMAuth |
( |
bool |
isForProxy = false |
) |
[protected] |
Creates the entity-header for NTLM authentication.
Definition at line 5559 of file http.cc.
QString HTTPProtocol::davProcessLocks |
( |
|
) |
[protected] |
Extracts locks from metadata Returns the appropriate If: header.
Definition at line 1116 of file http.cc.
void HTTPProtocol::davSetRequest |
( |
const QCString & |
requestXML |
) |
[protected] |
Performs a WebDAV stat or list.
Definition at line 677 of file http.cc.
Look for cookies in the cookiejar.
Definition at line 4588 of file http.cc.
bool HTTPProtocol::getAuthorization |
( |
|
) |
[protected] |
Retrieves authorization info from cache or user.
Definition at line 5173 of file http.cc.
QCString HTTPProtocol::gssError |
( |
int |
major_status, |
|
|
int |
minor_status | |
|
) |
| | [protected] |
create GSS error string
Definition at line 5547 of file http.cc.
bool HTTPProtocol::httpOpen |
( |
|
) |
[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'.
The reason for the change is due to one small fact: some requests require data to be sent in addition to the header (POST requests) and there is no way for this function to get that data. This function is called in the slotPut() or slotGet() functions which, in turn, are called (indirectly) as a result of a KIOJob::put() or KIOJob::get(). It is those latter functions which are responsible for starting up this ioslave in the first place. This means that 'httpOpen' is called (essentially) as soon as the ioslave is created -- BEFORE any data gets to this slave.
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
Definition at line 2178 of file http.cc.
long HTTPProtocol::parseDateTime |
( |
const QString & |
input, |
|
|
const QString & |
type | |
|
) |
| | [protected] |
Parses a date & time string.
Definition at line 1097 of file http.cc.
void HTTPProtocol::promptInfo |
( |
KIO::AuthInfo & |
info |
) |
[protected] |
Creates authorization prompt info.
QString HTTPProtocol::proxyAuthenticationHeader |
( |
|
) |
[protected] |
Returns any pre-cached proxy authentication info info in HTTP header format.
Definition at line 5988 of file http.cc.
ssize_t HTTPProtocol::read |
( |
void * |
b, |
|
|
size_t |
nbytes | |
|
) |
| | [protected] |
Another "smart" wrapper, this time around read that will use SSL_read or read(2) depending on whether you've got an SSL connection or not.
Definition at line 1969 of file http.cc.
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 'httpOpen()' (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_bufWebDavData.
Definition at line 4313 of file http.cc.
int HTTPProtocol::readChunked |
( |
|
) |
[protected] |
Read a chunk from the data stream.
Definition at line 4110 of file http.cc.
bool HTTPProtocol::readHeader |
( |
|
) |
[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 2682 of file http.cc.
void HTTPProtocol::resetConnectionSettings |
( |
|
) |
[protected] |
Resets any per connection settings.
These are different from per-session settings in that they must be invalidates 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 268 of file http.cc.
void HTTPProtocol::resetResponseSettings |
( |
|
) |
[protected] |
Resets settings related to parsing a response.
Definition at line 279 of file http.cc.
void HTTPProtocol::resetSessionSettings |
( |
|
) |
[protected] |
Resets any per session settings.
Definition at line 295 of file http.cc.
void HTTPProtocol::retrieveContent |
( |
bool |
dataInternal = false |
) |
[protected] |
Performs a GET HTTP request.
Definition at line 514 of file http.cc.
bool HTTPProtocol::retrieveHeader |
( |
bool |
close_connection = true |
) |
[protected] |
Performs a HEAD HTTP request.
Definition at line 542 of file http.cc.
bool HTTPProtocol::retryPrompt |
( |
|
) |
[protected] |
Prompts the user for authorization retry.
Definition at line 5116 of file http.cc.
void HTTPProtocol::saveAuthorization |
( |
|
) |
[protected] |
Saves valid authorization info in the cache daemon.
Definition at line 5399 of file http.cc.
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).
Definition at line 4047 of file http.cc.
void HTTPProtocol::updateExpireDate |
( |
time_t |
expireDate, |
|
|
bool |
updateCreationDate = false | |
|
) |
| | [protected] |
Update expire time of current cache entry.
Definition at line 4793 of file http.cc.
ssize_t HTTPProtocol::write |
( |
const void * |
buf, |
|
|
size_t |
nbytes | |
|
) |
| | [protected] |
A "smart" wrapper around write that will use SSL_write or write(2) depending on whether you've got an SSL connection or not.
The only shortcomming is that it uses the "global" file handles and soforth. So you can't really use this on individual files/sockets.
Definition at line 1899 of file http.cc.
void HTTPProtocol::writeCacheEntry |
( |
const char * |
buffer, |
|
|
int |
nbytes | |
|
) |
| | [protected] |
Write data to cache.
Write 'nbytes' from 'buffer' to the Cache Entry File
Definition at line 4910 of file http.cc.
The documentation for this class was generated from the following files:
|