46 #include "QtCore/qbuffer.h" 47 #include "QtCore/qurl.h" 48 #include "QtCore/qvector.h" 49 #include "QtCore/QMutexLocker" 50 #include "QtNetwork/qauthenticator.h" 81 if (closestMatch && closestMatch->
domain == domain) {
83 closestMatch->
user = user;
87 newCredential.
domain = domain;
88 newCredential.
user = user;
101 #ifndef QT_NO_NETWORKPROXY 106 switch (proxy.
type()) {
149 #ifndef QT_NO_NETWORKPROXY 177 authenticationCache.addEntry(cacheKey, auth);
206 realm = authenticator->
realm();
212 if (!authenticationCache.hasEntry(cacheKey))
218 authenticationCache.releaseEntry(cacheKey);
222 "Internal inconsistency: found a cache key for a proxy, but it's empty");
242 if (authenticationCache.hasEntry(cacheKey)) {
246 authenticationCache.releaseEntry(cacheKey);
250 authenticationCache.addEntry(cacheKey, auth);
281 realm = authentication->
realm();
286 if (!authenticationCache.hasEntry(cacheKey))
295 authenticationCache.releaseEntry(cacheKey);
301 authenticationCache.clear();
QNetworkProxy::ProxyType type() const
Returns the proxy type for this instance.
#define QT_END_NAMESPACE
This macro expands to.
static QByteArray authenticationKey(const QUrl &url, const QString &realm)
#define it(className, varName)
The QByteArray class provides an array of bytes.
static QByteArray proxyAuthenticationKey(const QNetworkProxy &proxy, const QString &realm)
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QNetworkAuthenticationCredential * findClosestMatch(const QString &domain)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void setUser(const QString &userName)
Sets the user name for proxy authentication to be user.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
The QVector class is a template class that provides a dynamic array.
void setHost(const QString &host)
Sets the host of the URL to host.
void insert(const QString &domain, const QString &user, const QString &password)
QString path() const
Returns the path of the URL.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
QNetworkAuthenticationCache()
static QNetworkProxy applicationProxy()
Returns the application level network proxying.
The QNetworkProxy class provides a network layer proxy.
QNetworkAuthenticationCredential fetchCachedCredentials(const QUrl &url, const QAuthenticator *auth=0)
Fetch the credential data from the credential cache.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void setFragment(const QString &fragment)
Sets the fragment of the URL to fragment.
The QAuthenticator class provides an authentication object.
QByteArray toEncoded(FormattingOptions options=None) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returne...
bool isNull() const
Returns true if this string is null; otherwise returns false.
void insert(int i, const T &t)
Inserts value at index position i in the vector.
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
QString userName() const
Returns the user name of the URL if it is defined; otherwise an empty string is returned.
QByteArray cacheKey() const
QString scheme() const
Returns the scheme of the URL.
#define Q_ASSERT_X(cond, where, what)
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
void setPort(int port)
Sets the port of the URL to port.
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
void clear()
Clears the contents of the string and makes it empty.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
void setExpires(bool enable)
QString user() const
returns the user used for authentication.
quint16 port() const
Returns the port of the proxy host.
static int closestMatch(QRgb pixel, const QVector< QRgb > &clut)
void setShareable(bool enable)
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
QString password() const
Returns the password used for authentication.
void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth)
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
void cacheCredentials(const QUrl &url, const QAuthenticator *auth)
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
void reserve(int size)
Attempts to allocate memory for at least size elements.
QNetworkAuthenticationCredential fetchCachedProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth=0)
QString password() const
returns the password used for authentication.
QString user() const
Returns the user name used for authentication.
void setUserName(const QString &userName)
Sets the URL's user name to userName.
QString password() const
Returns the password of the URL if it is defined; otherwise an empty string is returned.
QString realm() const
returns the realm requiring authentication.
QString hostName() const
Returns the host name of the proxy host.