summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/kernel.pri1
-rw-r--r--src/network/kernel/qauthenticator.cpp14
-rw-r--r--src/network/kernel/qdnslookup_win.cpp38
-rw-r--r--src/network/kernel/qhostaddress.cpp14
-rw-r--r--src/network/kernel/qnetworkproxy.cpp66
-rw-r--r--src/network/kernel/qnetworkproxy_mac.cpp16
6 files changed, 61 insertions, 88 deletions
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index adc72bbcbb..a5508af31f 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -29,6 +29,7 @@ unix:SOURCES += kernel/qdnslookup_unix.cpp kernel/qhostinfo_unix.cpp kernel/qnet
win32: {
HEADERS += kernel/qnetworkinterface_win_p.h
SOURCES += kernel/qdnslookup_win.cpp kernel/qhostinfo_win.cpp kernel/qnetworkinterface_win.cpp
+ LIBS += -ldnsapi
}
integrity:SOURCES += kernel/qdnslookup_unix.cpp kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index b14fbf8c30..eef2a7fa76 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -80,9 +80,9 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
QAuthenticator supports the following authentication methods:
\list
- \o Basic
- \o NTLM version 2
- \o Digest-MD5
+ \li Basic
+ \li NTLM version 2
+ \li Digest-MD5
\endlist
\section1 Options
@@ -104,8 +104,8 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
\section2 Basic
\table
- \header \o Option \o Direction \o Description
- \row \o \tt{realm} \o Incoming \o Contains the realm of the authentication, the same as realm()
+ \header \li Option \li Direction \li Description
+ \row \li \tt{realm} \li Incoming \li Contains the realm of the authentication, the same as realm()
\endtable
The Basic authentication mechanism supports no outgoing options.
@@ -117,8 +117,8 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
\section2 Digest-MD5
\table
- \header \o Option \o Direction \o Description
- \row \o \tt{realm} \o Incoming \o Contains the realm of the authentication, the same as realm()
+ \header \li Option \li Direction \li Description
+ \row \li \tt{realm} \li Incoming \li Contains the realm of the authentication, the same as realm()
\endtable
The Digest-MD5 authentication mechanism supports no outgoing options.
diff --git a/src/network/kernel/qdnslookup_win.cpp b/src/network/kernel/qdnslookup_win.cpp
index 9b2c088ee2..63f4377dfc 100644
--- a/src/network/kernel/qdnslookup_win.cpp
+++ b/src/network/kernel/qdnslookup_win.cpp
@@ -44,46 +44,18 @@
#include <qurl.h>
#include <private/qmutexpool_p.h>
-#include <private/qsystemlibrary_p.h>
+#include <private/qsystemerror_p.h>
#include <qt_windows.h>
#include <windns.h>
QT_BEGIN_NAMESPACE
-typedef DNS_STATUS (*dns_query_utf8_proto)(PCSTR,WORD,DWORD,PIP4_ARRAY,PDNS_RECORD*,PVOID*);
-static dns_query_utf8_proto local_dns_query_utf8 = 0;
-typedef void (*dns_record_list_free_proto)(PDNS_RECORD,DNS_FREE_TYPE);
-static dns_record_list_free_proto local_dns_record_list_free = 0;
-
-static void resolveLibrary()
-{
- local_dns_query_utf8 = (dns_query_utf8_proto) QSystemLibrary::resolve(QLatin1String("dnsapi"), "DnsQuery_UTF8");
- local_dns_record_list_free = (dns_record_list_free_proto) QSystemLibrary::resolve(QLatin1String("dnsapi"), "DnsRecordListFree");
-}
-
void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestName, QDnsLookupReply *reply)
{
- // Load DnsQuery_UTF8 and DnsRecordListFree on demand.
- static volatile bool triedResolve = false;
- if (!triedResolve) {
- QMutexLocker locker(QMutexPool::globalInstanceGet(&local_dns_query_utf8));
- if (!triedResolve) {
- resolveLibrary();
- triedResolve = true;
- }
- }
-
- // If DnsQuery_UTF8 or DnsRecordListFree is missing, fail.
- if (!local_dns_query_utf8 || !local_dns_record_list_free) {
- reply->error = QDnsLookup::ResolverError,
- reply->errorString = tr("Resolver functions not found");
- return;
- }
-
// Perform DNS query.
- PDNS_RECORD dns_records;
- const DNS_STATUS status = local_dns_query_utf8(requestName, requestType, DNS_QUERY_STANDARD, NULL, &dns_records, NULL);
+ PDNS_RECORD dns_records = 0;
+ const DNS_STATUS status = DnsQuery_UTF8(requestName, requestType, DNS_QUERY_STANDARD, NULL, &dns_records, NULL);
switch (status) {
case ERROR_SUCCESS:
break;
@@ -105,7 +77,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
return;
default:
reply->error = QDnsLookup::InvalidReplyError;
- reply->errorString = tr("Invalid reply received");
+ reply->errorString = QSystemError(status, QSystemError::NativeError).toString();
return;
}
@@ -172,7 +144,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
}
}
- local_dns_record_list_free(dns_records, DnsFreeRecordList);
+ DnsRecordListFree(dns_records, DnsFreeRecordList);
}
QT_END_NAMESPACE
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index dd46b8126b..230abb86aa 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -822,20 +822,20 @@ QString QHostAddress::toString() const
\list
- \o Node-local: Addresses that are only used for communicating with
+ \li Node-local: Addresses that are only used for communicating with
services on the same interface (e.g., the loopback interface "::1").
- \o Link-local: Addresses that are local to the network interface
+ \li Link-local: Addresses that are local to the network interface
(\e{link}). There is always one link-local address for each IPv6 interface
on your host. Link-local addresses ("fe80...") are generated from the MAC
address of the local network adaptor, and are not guaranteed to be unique.
- \o Site-local: Addresses that are local to the site / private network
+ \li Site-local: Addresses that are local to the site / private network
(e.g., the company intranet). Site-local addresses ("fec0...") are
usually distributed by the site router, and are not guaranteed to be
unique outside of the local site.
- \o Global: For globally routable addresses, such as public servers on the
+ \li Global: For globally routable addresses, such as public servers on the
Internet.
\endlist
@@ -1001,9 +1001,9 @@ bool QHostAddress::isInSubnet(const QPair<QHostAddress, int> &subnet) const
This function supports arguments in the form:
\list
- \o 123.123.123.123/n where n is any value between 0 and 32
- \o 123.123.123.123/255.255.255.255
- \o <ipv6-address>/n where n is any value between 0 and 128
+ \li 123.123.123.123/n where n is any value between 0 and 32
+ \li 123.123.123.123/255.255.255.255
+ \li <ipv6-address>/n where n is any value between 0 and 128
\endlist
For IP version 4, this function accepts as well missing trailing
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 0238d22eb6..0281eaf48b 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -139,35 +139,35 @@
\table
\header
- \o Proxy type
- \o Description
- \o Default capabilities
+ \li Proxy type
+ \li Description
+ \li Default capabilities
\row
- \o SOCKS 5
- \o Generic proxy for any kind of connection. Supports TCP,
+ \li SOCKS 5
+ \li Generic proxy for any kind of connection. Supports TCP,
UDP, binding to a port (incoming connections) and
authentication.
- \o TunnelingCapability, ListeningCapability,
+ \li TunnelingCapability, ListeningCapability,
UdpTunnelingCapability, HostNameLookupCapability
\row
- \o HTTP
- \o Implemented using the "CONNECT" command, supports only
+ \li HTTP
+ \li Implemented using the "CONNECT" command, supports only
outgoing TCP connections; supports authentication.
- \o TunnelingCapability, CachingCapability, HostNameLookupCapability
+ \li TunnelingCapability, CachingCapability, HostNameLookupCapability
\row
- \o Caching-only HTTP
- \o Implemented using normal HTTP commands, it is useful only
+ \li Caching-only HTTP
+ \li Implemented using normal HTTP commands, it is useful only
in the context of HTTP requests (see QNetworkAccessManager)
- \o CachingCapability, HostNameLookupCapability
+ \li CachingCapability, HostNameLookupCapability
\row
- \o Caching FTP
- \o Implemented using an FTP proxy, it is useful only in the
+ \li Caching FTP
+ \li Implemented using an FTP proxy, it is useful only in the
context of FTP requests (see QNetworkAccessManager)
- \o CachingCapability, HostNameLookupCapability
+ \li CachingCapability, HostNameLookupCapability
\endtable
@@ -856,12 +856,12 @@ template<> void QSharedDataPointer<QNetworkProxyQueryPrivate>::detach()
the proxy:
\list
- \o the type of query
- \o the local port number to use
- \o the destination host name
- \o the destination port number
- \o the protocol name, such as "http" or "ftp"
- \o the URL being requested
+ \li the type of query
+ \li the local port number to use
+ \li the destination host name
+ \li the destination port number
+ \li the protocol name, such as "http" or "ftp"
+ \li the URL being requested
\endlist
The destination host name is the host in the connection in the
@@ -895,35 +895,35 @@ template<> void QSharedDataPointer<QNetworkProxyQueryPrivate>::detach()
\table
\header
- \o Query type
- \o Description
+ \li Query type
+ \li Description
\row
- \o TcpSocket
- \o Normal sockets requesting a connection to a remote server,
+ \li TcpSocket
+ \li Normal sockets requesting a connection to a remote server,
like QTcpSocket. The peer hostname and peer port match the
values passed to QTcpSocket::connectToHost(). The local port
is usually -1, indicating the socket has no preference in
which port should be used. The URL component is not used.
\row
- \o UdpSocket
- \o Datagram-based sockets, which can both send and
+ \li UdpSocket
+ \li Datagram-based sockets, which can both send and
receive. The local port, remote host or remote port fields
can all be used or be left unused, depending on the
characteristics of the socket. The URL component is not used.
\row
- \o TcpServer
- \o Passive server sockets that listen on a port and await
+ \li TcpServer
+ \li Passive server sockets that listen on a port and await
incoming connections from the network. Normally, only the
local port is used, but the remote address could be used in
specific circumstances, for example to indicate which remote
host a connection is expected from. The URL component is not used.
\row
- \o UrlRequest
- \o A more high-level request, such as those coming from
+ \li UrlRequest
+ \li A more high-level request, such as those coming from
QNetworkAccessManager. These requests will inevitably use an
outgoing TCP socket, but the this query type is provided to
indicate that more detailed information is present in the URL
@@ -1487,10 +1487,10 @@ void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *fact
listed here.
\list
- \o On MacOS X, this function will ignore the Proxy Auto Configuration
+ \li On MacOS X, this function will ignore the Proxy Auto Configuration
settings, since it cannot execute the associated ECMAScript code.
- \o On Windows platforms, this function may take several seconds to
+ \li On Windows platforms, this function may take several seconds to
execute depending on the configuration of the user's system.
\endlist
*/
diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp
index 75ed17048c..d25917ee47 100644
--- a/src/network/kernel/qnetworkproxy_mac.cpp
+++ b/src/network/kernel/qnetworkproxy_mac.cpp
@@ -58,14 +58,14 @@
* proxy settings for:
*
* \list
- * \o FTP proxy
- * \o Web Proxy (HTTP)
- * \o Secure Web Proxy (HTTPS)
- * \o Streaming Proxy (RTSP)
- * \o SOCKS Proxy
- * \o Gopher Proxy
- * \o URL for Automatic Proxy Configuration (PAC scripts)
- * \o Bypass list (by default: *.local, 169.254/16)
+ * \li FTP proxy
+ * \li Web Proxy (HTTP)
+ * \li Secure Web Proxy (HTTPS)
+ * \li Streaming Proxy (RTSP)
+ * \li SOCKS Proxy
+ * \li Gopher Proxy
+ * \li URL for Automatic Proxy Configuration (PAC scripts)
+ * \li Bypass list (by default: *.local, 169.254/16)
* \endlist
*
* The matching configuration can be obtained by calling SCDynamicStoreCopyProxies