summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Leonov <aleonov@rim.com>2012-10-26 14:56:37 -0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-31 17:55:55 +0100
commit4b71432987ca9ff059d04f0e5f567b8eb09717f9 (patch)
tree2ec2a1ac7927ff3518879ed16604d5eb02e00e21
parent8c4d02f97affdca88e25de894788124033133d87 (diff)
Adding PAC and exclusion list support to BlackBerry Qt proxy implementation.
The additional proxy functionality is only available starting BPS API version 3.1.1. Change-Id: Iadd2950119fa1dca706e8cd34804b038e3f704bc Reviewed-by: Peter Hartmann <phartmann@rim.com>
-rw-r--r--src/network/kernel/qnetworkproxy.cpp7
-rw-r--r--src/network/kernel/qnetworkproxy_blackberry.cpp23
2 files changed, 26 insertions, 4 deletions
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 85641895b7..aa16be2b4a 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -1560,10 +1560,9 @@ void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *fact
\li On Windows platforms, this function may take several seconds to
execute depending on the configuration of the user's system.
- \li On BlackBerry, this function ignores network configuration specified
- in \a query. Only UrlRequest quieries are supported. SOCKS is not supported.
- The proxy information is retrieved only for the default configuration.
- Also, PAC and exclusion lists are currently not supported.
+ \li On BlackBerry, only UrlRequest queries are supported. SOCKS is
+ not supported. The proxy credentials are only retrieved for the
+ default configuration.
\endlist
*/
diff --git a/src/network/kernel/qnetworkproxy_blackberry.cpp b/src/network/kernel/qnetworkproxy_blackberry.cpp
index c257f085ff..2743b90404 100644
--- a/src/network/kernel/qnetworkproxy_blackberry.cpp
+++ b/src/network/kernel/qnetworkproxy_blackberry.cpp
@@ -79,11 +79,34 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
netstatus_proxy_details_t details;
memset(&details, 0, sizeof(netstatus_proxy_details_t));
+
+#if BPS_VERSION >= 3001001
+
+ QByteArray bUrl(url.toEncoded());
+ QString sInterface(query.networkConfiguration().name());
+ QByteArray bInterface;
+ if (!sInterface.isEmpty()) {
+ if (query.networkConfiguration().type() != QNetworkConfiguration::InternetAccessPoint) {
+ qWarning("Unsupported configuration type: %d", query.networkConfiguration().type());
+ return QList<QNetworkProxy>() << QNetworkProxy(QNetworkProxy::NoProxy);
+ }
+ bInterface = sInterface.toUtf8();
+ }
+
+ if (netstatus_get_proxy_details_for_url(bUrl.constData(), (bInterface.isEmpty() ? NULL : bInterface.constData()), &details) != BPS_SUCCESS) {
+ qWarning("netstatus_get_proxy_details_for_url failed! errno: %d", errno);
+ return QList<QNetworkProxy>() << QNetworkProxy(QNetworkProxy::NoProxy);
+ }
+
+#else
+
if (netstatus_get_proxy_details(&details) != BPS_SUCCESS) {
qWarning("netstatus_get_proxy_details failed! errno: %d", errno);
return QList<QNetworkProxy>() << QNetworkProxy(QNetworkProxy::NoProxy);
}
+#endif
+
if (details.http_proxy_host == NULL) { // No proxy
netstatus_free_proxy_details(&details);
return QList<QNetworkProxy>() << QNetworkProxy(QNetworkProxy::NoProxy);