summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkcookie.cpp4
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h2
-rw-r--r--src/network/doc/images/network-examples.pngbin0 -> 8946 bytes
-rw-r--r--src/network/doc/qtnetwork.qdocconf10
-rw-r--r--src/network/doc/snippets/code/src_network_access_qftp.cpp4
-rw-r--r--src/network/doc/src/examples.qdoc68
-rw-r--r--src/network/doc/src/ssl.qdoc4
-rw-r--r--src/network/kernel/qnetworkproxy.cpp2
-rw-r--r--src/network/socket/qabstractsocket.cpp4
-rw-r--r--src/network/socket/qlocalserver_tcp.cpp6
-rw-r--r--src/network/socket/qlocalsocket_tcp.cpp2
-rw-r--r--src/network/socket/qlocalsocket_win.cpp2
-rw-r--r--src/network/ssl/qsslcertificate.cpp2
-rw-r--r--src/network/ssl/qsslerror.h4
-rw-r--r--src/network/ssl/qsslsocket.h4
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp6
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp8
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h4
18 files changed, 109 insertions, 27 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index bfc439ef74..f07516c3fd 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -90,9 +90,9 @@ QT_BEGIN_NAMESPACE
This class implements cookies as described by the
\l{Netscape Cookie Specification}{initial cookie specification by
- Netscape}, which is somewhat similar to the \l{RFC 2109} specification,
+ Netscape}, which is somewhat similar to the \l{http://www.rfc-editor.org/rfc/rfc2109.txt}{RFC 2109} specification,
plus the \l{Mitigating Cross-site Scripting With HTTP-only Cookies}
- {"HttpOnly" extension}. The more recent \l{RFC 2965} specification
+ {"HttpOnly" extension}. The more recent \l{http://www.rfc-editor.org/rfc/rfc2965.txt}{RFC 2965} specification
(which uses the Set-Cookie2 header) is not supported.
\sa QNetworkCookieJar, QNetworkRequest, QNetworkReply
diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h
index 956d5c207f..54a4333dcf 100644
--- a/src/network/access/qnetworkreplyhttpimpl_p.h
+++ b/src/network/access/qnetworkreplyhttpimpl_p.h
@@ -119,7 +119,9 @@ public:
Q_PRIVATE_SLOT(d_func(), void replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *))
Q_PRIVATE_SLOT(d_func(), void replySslConfigurationChanged(const QSslConfiguration&))
#endif
+#ifndef QT_NO_NETWORKPROXY
Q_PRIVATE_SLOT(d_func(), void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth))
+#endif
Q_PRIVATE_SLOT(d_func(), void resetUploadDataSlot(bool *r))
Q_PRIVATE_SLOT(d_func(), void wantUploadDataSlot(qint64))
diff --git a/src/network/doc/images/network-examples.png b/src/network/doc/images/network-examples.png
new file mode 100644
index 0000000000..15dfba850a
--- /dev/null
+++ b/src/network/doc/images/network-examples.png
Binary files differ
diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf
index 17aa5e4251..702338e224 100644
--- a/src/network/doc/qtnetwork.qdocconf
+++ b/src/network/doc/qtnetwork.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtNetwork
description = Qt Network Reference Documentation
url = http://qt-project.org/doc/qtnetwork
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = network
qhp.projects = QtNetwork
qhp.QtNetwork.file = qtnetwork.qhp
-qhp.QtNetwork.namespace = org.qt-project.qtnetwork.500
+qhp.QtNetwork.namespace = org.qt-project.qtnetwork.501
qhp.QtNetwork.virtualFolder = qtnetwork
qhp.QtNetwork.indexTitle = Qt Network
qhp.QtNetwork.indexRoot =
-qhp.QtNetwork.filterAttributes = qtnetwork 5.0.0 qtrefdoc
-qhp.QtNetwork.customFilters.Qt.name = QtNetwork 5.0.0
-qhp.QtNetwork.customFilters.Qt.filterAttributes = qtnetwork 5.0.0
+qhp.QtNetwork.filterAttributes = qtnetwork 5.0.1 qtrefdoc
+qhp.QtNetwork.customFilters.Qt.name = QtNetwork 5.0.1
+qhp.QtNetwork.customFilters.Qt.filterAttributes = qtnetwork 5.0.1
qhp.QtNetwork.subprojects = classes
qhp.QtNetwork.subprojects.classes.title = C++ Classes
diff --git a/src/network/doc/snippets/code/src_network_access_qftp.cpp b/src/network/doc/snippets/code/src_network_access_qftp.cpp
index 77f5ee2df2..4fa81efd84 100644
--- a/src/network/doc/snippets/code/src_network_access_qftp.cpp
+++ b/src/network/doc/snippets/code/src_network_access_qftp.cpp
@@ -40,13 +40,13 @@
//! [0]
QFtp *ftp = new QFtp(parent);
-ftp->connectToHost("ftp.qt.nokia.com");
+ftp->connectToHost("ftp.qt-project.org");
ftp->login();
//! [0]
//! [1]
-ftp->connectToHost("ftp.qt.nokia.com"); // id == 1
+ftp->connectToHost("ftp.qt-project.org"); // id == 1
ftp->login(); // id == 2
ftp->cd("qt"); // id == 3
ftp->get("INSTALL"); // id == 4
diff --git a/src/network/doc/src/examples.qdoc b/src/network/doc/src/examples.qdoc
new file mode 100644
index 0000000000..1d3b83ae80
--- /dev/null
+++ b/src/network/doc/src/examples.qdoc
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \group examples-network
+ \ingroup all-examples
+ \title Network Examples
+ \brief How to do network programming in Qt.
+
+ \image network-examples.png
+
+ Qt is provided with an extensive set of network classes to support both
+ client-based and server side network programming.
+
+ These examples demonstrate the fundamental aspects of network programming
+ with Qt.
+
+*/
+
+/*
+ \list
+ \li \l{network/blockingfortuneclient}{Blocking Fortune Client}\raisedaster
+ \li \l{network/broadcastreceiver}{Broadcast Receiver}
+ \li \l{network/broadcastsender}{Broadcast Sender}
+ \li \l{network/download}{Download}
+ \li \l{network/downloadmanager}{Download Manager}
+ \li \l{network/network-chat}{Network Chat}
+ \li \l{network/fortuneclient}{Fortune Client}\raisedaster
+ \li \l{network/fortuneserver}{Fortune Server}\raisedaster
+ \li \l{network/qftp}{FTP}\raisedaster
+ \li \l{network/http}{HTTP}
+ \li \l{network/loopback}{Loopback}
+ \li \l{network/threadedfortuneserver}{Threaded Fortune Server}\raisedaster
+ \li \l{network/torrent}{Torrent}
+ \li \l{network/googlesuggest}{Google Suggest}
+ \li \l{network/bearercloud}{Bearer Cloud}\raisedaster
+ \li \l{network/bearermonitor}{Bearer Monitor}
+ \li \l{network/securesocketclient}{Secure Socket Client}
+ \li \l{network/multicastreceiver}{Multicast Receiver}
+ \li \l{network/multicastsender}{Multicast Sender}
+ \endlist
+
+ Examples marked with an asterisk (*) are fully documented.
+*/
diff --git a/src/network/doc/src/ssl.qdoc b/src/network/doc/src/ssl.qdoc
index 0a07e72f93..751c7cd668 100644
--- a/src/network/doc/src/ssl.qdoc
+++ b/src/network/doc/src/ssl.qdoc
@@ -33,8 +33,8 @@
\keyword SSL
The classes below provide support for secure network communication using
- the Secure Sockets Layer (SSL) protocol, using the \l{OpenSSL Toolkit} to
- perform encryption and protocol handling.
+ the Secure Sockets Layer (SSL) protocol, using the OpenSSL Toolkit (\l{http://www.openssl.org/})
+ to perform encryption and protocol handling.
See the \l{General Qt Requirements} page for information about the
versions of OpenSSL that are known to work with Qt.
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 60139dcc8a..7f1e66a2ce 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -84,7 +84,7 @@
\section1 SOCKS5
- The SOCKS5 support in Qt 4 is based on \l{RFC 1928} and \l{RFC 1929}.
+ The SOCKS5 support in Qt 4 is based on \l{http://www.rfc-editor.org/rfc/rfc1928.txt}{RFC 1928} and \l{http://www.rfc-editor.org/rfc/rfc1929.txt}{RFC 1929}.
The supported authentication methods are no authentication and
username/password authentication. Both IPv4 and IPv6 are
supported. Domain names are resolved through the SOCKS5 server if
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 5ff7da9e9d..124f15e586 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -195,7 +195,7 @@
\fn void QAbstractSocket::disconnected()
This signal is emitted when the socket has been disconnected.
-
+
\warning If you need to delete the sender() of this signal in a slot connected
to it, use the \l{QObject::deleteLater()}{deleteLater()} function.
@@ -639,7 +639,7 @@ bool QAbstractSocketPrivate::initSocketLayer(QAbstractSocket::NetworkLayerProtoc
socketEngine->errorString().toLatin1().constData());
#endif
socketError = socketEngine->error();
- q->setErrorString(socketEngine->errorString());
+ q->setErrorString(socketEngine->errorString());
return false;
}
diff --git a/src/network/socket/qlocalserver_tcp.cpp b/src/network/socket/qlocalserver_tcp.cpp
index cb727a9d2c..a705b18dc5 100644
--- a/src/network/socket/qlocalserver_tcp.cpp
+++ b/src/network/socket/qlocalserver_tcp.cpp
@@ -67,7 +67,7 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName)
else
fullServerName = prefix + requestedServerName;
- QSettings settings(QLatin1String("Trolltech"), QLatin1String("Qt"));
+ QSettings settings(QLatin1String("QtProject"), QLatin1String("Qt"));
if (settings.contains(fullServerName)) {
qWarning("QLocalServer::listen: server name is already in use.");
tcpServer.close();
@@ -87,7 +87,7 @@ bool QLocalServerPrivate::listen(qintptr socketDescriptor)
void QLocalServerPrivate::closeServer()
{
- QSettings settings(QLatin1String("Trolltech"), QLatin1String("Qt"));
+ QSettings settings(QLatin1String("QtProject"), QLatin1String("Qt"));
if (fullServerName == QLatin1String("QLocalServer"))
settings.setValue(fullServerName, QVariant());
else
@@ -126,7 +126,7 @@ bool QLocalServerPrivate::removeServer(const QString &name)
else
serverName = prefix + name;
- QSettings settings(QLatin1String("Trolltech"), QLatin1String("Qt"));
+ QSettings settings(QLatin1String("QtProject"), QLatin1String("Qt"));
if (settings.contains(serverName))
settings.remove(serverName);
diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp
index 5429d8dc36..913d10f50a 100644
--- a/src/network/socket/qlocalsocket_tcp.cpp
+++ b/src/network/socket/qlocalsocket_tcp.cpp
@@ -238,7 +238,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
else
d->fullServerName = prefix + name;
- QSettings settings(QLatin1String("Trolltech"), QLatin1String("Qt"));
+ QSettings settings(QLatin1String("QtProject"), QLatin1String("Qt"));
bool ok;
const quint16 port = settings.value(d->fullServerName).toUInt(&ok);
if (!ok) {
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index cb264a4c83..0138a96261 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -67,7 +67,7 @@ void QLocalSocketPrivate::_q_winError(ulong windowsError, const QString &functio
Q_Q(QLocalSocket);
QLocalSocket::LocalSocketState currentState = state;
- // If the connectToServer fails due to WaitNamedPipe() time-out, assume ConnectionError
+ // If the connectToServer fails due to WaitNamedPipe() time-out, assume ConnectionError
if (state == QLocalSocket::ConnectingState && windowsError == ERROR_SEM_TIMEOUT)
windowsError = ERROR_NO_DATA;
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index e9353916cb..6d3a77b45f 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -245,7 +245,7 @@ bool QSslCertificate::isNull() const
expiryDate() and effectiveDate() with QDateTime::currentDateTime()
This function checks that the current
- data-time is within the date-time range during which the
+ date-time is within the date-time range during which the
certificate is considered valid, and checks that the
certificate is not in a blacklist of fraudulent certificates.
diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h
index a222e2c58d..1acc5cb6e5 100644
--- a/src/network/ssl/qsslerror.h
+++ b/src/network/ssl/qsslerror.h
@@ -122,6 +122,10 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError::SslError &erro
QT_END_NAMESPACE
+#ifndef QT_NO_SSL
+Q_DECLARE_METATYPE(QList<QSslError>)
+#endif
+
QT_END_HEADER
#endif
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index 306fb636a6..37f7c484f4 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -223,10 +223,6 @@ private:
QT_END_NAMESPACE
-#ifndef QT_NO_SSL
-Q_DECLARE_METATYPE(QList<QSslError>)
-#endif
-
QT_END_HEADER
#endif
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 39b49ce09e..9e0331391b 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -229,12 +229,12 @@ static int q_X509Callback(int ok, X509_STORE_CTX *ctx)
{
if (!ok) {
// Store the error and at which depth the error was detected.
- _q_sslErrorList()->errors << qMakePair<int, int>(ctx->error, ctx->error_depth);
+ _q_sslErrorList()->errors << qMakePair<int, int>(q_X509_STORE_CTX_get_error(ctx), q_X509_STORE_CTX_get_error_depth(ctx));
#ifdef QSSLSOCKET_DEBUG
qDebug() << "verification error: dumping bad certificate";
- qDebug() << QSslCertificatePrivate::QSslCertificate_from_X509(ctx->current_cert).toPem();
+ qDebug() << QSslCertificatePrivate::QSslCertificate_from_X509(q_X509_STORE_CTX_get_current_cert(ctx)).toPem();
qDebug() << "dumping chain";
- foreach (QSslCertificate cert, QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(ctx->chain)) {
+ foreach (QSslCertificate cert, QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(q_X509_STORE_CTX_get_chain(ctx))) {
QString certFormat(QStringLiteral("O=%1 CN=%2 L=%3 OU=%4 C=%5 ST=%6"));
qDebug() << "Issuer:" << "O=" << cert.issuerInfo(QSslCertificate::Organization)
<< "CN=" << cert.issuerInfo(QSslCertificate::CommonName)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index eeae9d461f..0df77b07f7 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -294,6 +294,10 @@ DEFINEFUNC2(int, X509_STORE_add_cert, X509_STORE *a, a, X509 *b, b, return 0, re
DEFINEFUNC(void, X509_STORE_CTX_free, X509_STORE_CTX *a, a, return, DUMMYARG)
DEFINEFUNC4(int, X509_STORE_CTX_init, X509_STORE_CTX *a, a, X509_STORE *b, b, X509 *c, c, STACK_OF(X509) *d, d, return -1, return)
DEFINEFUNC2(int, X509_STORE_CTX_set_purpose, X509_STORE_CTX *a, a, int b, b, return -1, return)
+DEFINEFUNC(int, X509_STORE_CTX_get_error, X509_STORE_CTX *a, a, return -1, return)
+DEFINEFUNC(int, X509_STORE_CTX_get_error_depth, X509_STORE_CTX *a, a, return -1, return)
+DEFINEFUNC(X509 *, X509_STORE_CTX_get_current_cert, X509_STORE_CTX *a, a, return 0, return)
+DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
DEFINEFUNC(X509_STORE_CTX *, X509_STORE_CTX_new, DUMMYARG, DUMMYARG, return 0, return)
#ifdef SSLEAY_MACROS
DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
@@ -714,6 +718,10 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(X509_STORE_CTX_init)
RESOLVEFUNC(X509_STORE_CTX_new)
RESOLVEFUNC(X509_STORE_CTX_set_purpose)
+ RESOLVEFUNC(X509_STORE_CTX_get_error)
+ RESOLVEFUNC(X509_STORE_CTX_get_error_depth)
+ RESOLVEFUNC(X509_STORE_CTX_get_current_cert)
+ RESOLVEFUNC(X509_STORE_CTX_get_chain)
RESOLVEFUNC(X509_cmp)
#ifndef SSLEAY_MACROS
RESOLVEFUNC(X509_dup)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 40c6522d93..2be84331e3 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -398,6 +398,10 @@ int q_X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
X509 *x509, STACK_OF(X509) *chain);
X509_STORE_CTX *q_X509_STORE_CTX_new();
int q_X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
+int q_X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
+int q_X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
+X509 *q_X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
+STACK_OF(X509) *q_X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
#define q_BIO_get_mem_data(b, pp) (int)q_BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
#define q_BIO_pending(b) (int)q_BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)