summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qftp.cpp14
-rw-r--r--src/network/doc/snippets/code/doc_src_qtnetwork.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_access_qftp.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_access_qnetworkreply.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_access_qnetworkrequest.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_kernel_qhostaddress.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_kernel_qnetworkproxy.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qnativesocketengine.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qtcpserver.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qudpsocket.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_ssl_qsslconfiguration.cpp16
-rw-r--r--src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp16
-rw-r--r--src/network/doc/snippets/network/tcpwait.cpp16
-rw-r--r--src/network/doc/src/bearermanagement.qdoc10
-rw-r--r--src/network/doc/src/examples.qdoc10
-rw-r--r--src/network/doc/src/network-programming.qdoc10
-rw-r--r--src/network/doc/src/qtnetwork.qdoc10
-rw-r--r--src/network/doc/src/ssl.qdoc10
-rw-r--r--src/network/kernel/qhostaddress.cpp4
-rw-r--r--src/network/kernel/qnetworkinterface.cpp4
-rw-r--r--src/network/socket/qlocalserver.cpp2
-rw-r--r--src/network/socket/qlocalsocket.h2
-rw-r--r--src/network/socket/qlocalsocket_p.h5
-rw-r--r--src/network/socket/qlocalsocket_win.cpp48
-rw-r--r--src/network/socket/qnativesocketengine.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp3
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp22
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp14
-rw-r--r--src/network/ssl/qsslsocket_p.h2
-rw-r--r--src/network/ssl/ssl.pri2
38 files changed, 361 insertions, 133 deletions
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index 0c1e04efee..ac6a5f46b1 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -587,10 +587,10 @@ static void _q_parseDosDir(const QStringList &tokens, const QString &userName, Q
int permissions = QUrlInfo::ReadOwner | QUrlInfo::WriteOwner
| QUrlInfo::ReadGroup | QUrlInfo::WriteGroup
| QUrlInfo::ReadOther | QUrlInfo::WriteOther;
- QString ext;
+ QStringRef ext;
int extIndex = name.lastIndexOf(QLatin1Char('.'));
if (extIndex != -1)
- ext = name.mid(extIndex + 1);
+ ext = name.midRef(extIndex + 1);
if (ext == QLatin1String("exe") || ext == QLatin1String("bat") || ext == QLatin1String("com"))
permissions |= QUrlInfo::ExeOwner | QUrlInfo::ExeGroup | QUrlInfo::ExeOther;
info->setPermissions(permissions);
@@ -961,19 +961,19 @@ void QFtpPI::readyRead()
endOfMultiLine[3] = QLatin1Char(' ');
QString lineCont(endOfMultiLine);
lineCont[3] = QLatin1Char('-');
- QString lineLeft4 = line.left(4);
+ QStringRef lineLeft4 = line.leftRef(4);
while (lineLeft4 != endOfMultiLine) {
if (lineLeft4 == lineCont)
- replyText += line.mid(4); // strip 'xyz-'
+ replyText += line.midRef(4); // strip 'xyz-'
else
replyText += line;
if (!commandSocket.canReadLine())
return;
line = QString::fromLatin1(commandSocket.readLine());
- lineLeft4 = line.left(4);
+ lineLeft4 = line.leftRef(4);
}
- replyText += line.mid(4); // strip reply code 'xyz '
+ replyText += line.midRef(4); // strip reply code 'xyz '
if (replyText.endsWith(QLatin1String("\r\n")))
replyText.chop(2);
@@ -1089,7 +1089,7 @@ bool QFtpPI::processReply()
} else {
++portPos;
QChar delimiter = replyText.at(portPos);
- QStringList epsvParameters = replyText.mid(portPos).split(delimiter);
+ const auto epsvParameters = replyText.midRef(portPos).split(delimiter);
waitForDtpToConnect = true;
dtp.connectToHost(commandSocket.peerAddress().toString(),
diff --git a/src/network/doc/snippets/code/doc_src_qtnetwork.cpp b/src/network/doc/snippets/code/doc_src_qtnetwork.cpp
index 9f9e62b323..a74a1fce41 100644
--- a/src/network/doc/snippets/code/doc_src_qtnetwork.cpp
+++ b/src/network/doc/snippets/code/doc_src_qtnetwork.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
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 6c047e9666..8472477a01 100644
--- a/src/network/doc/snippets/code/src_network_access_qftp.cpp
+++ b/src/network/doc/snippets/code/src_network_access_qftp.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp b/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp
index c51253f068..873b74363f 100644
--- a/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp
+++ b/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp b/src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp
index f2525af77a..f5791abd41 100644
--- a/src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp
+++ b/src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_access_qnetworkreply.cpp b/src/network/doc/snippets/code/src_network_access_qnetworkreply.cpp
index 79769d455f..3ac98302b6 100644
--- a/src/network/doc/snippets/code/src_network_access_qnetworkreply.cpp
+++ b/src/network/doc/snippets/code/src_network_access_qnetworkreply.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_access_qnetworkrequest.cpp b/src/network/doc/snippets/code/src_network_access_qnetworkrequest.cpp
index f9777ab56f..7b3efa812e 100644
--- a/src/network/doc/snippets/code/src_network_access_qnetworkrequest.cpp
+++ b/src/network/doc/snippets/code/src_network_access_qnetworkrequest.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp b/src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp
index 00bcf35c07..42992f08d9 100644
--- a/src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp
+++ b/src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp b/src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp
index 16d4a1c87c..dabd2373e7 100644
--- a/src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp
+++ b/src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2012 Jeremy Lainé <jeremy.laine@m4x.org>
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 Jeremy Lainé <jeremy.laine@m4x.org>
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_kernel_qhostaddress.cpp b/src/network/doc/snippets/code/src_network_kernel_qhostaddress.cpp
index dad537c062..60e2a8125d 100644
--- a/src/network/doc/snippets/code/src_network_kernel_qhostaddress.cpp
+++ b/src/network/doc/snippets/code/src_network_kernel_qhostaddress.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp b/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp
index 6cfd4088c2..0d06fb44c7 100644
--- a/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp
+++ b/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_kernel_qnetworkproxy.cpp b/src/network/doc/snippets/code/src_network_kernel_qnetworkproxy.cpp
index 136ba39a31..dd51fb1e5f 100644
--- a/src/network/doc/snippets/code/src_network_kernel_qnetworkproxy.cpp
+++ b/src/network/doc/snippets/code/src_network_kernel_qnetworkproxy.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp b/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
index 7914d09573..3db16b50e6 100644
--- a/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp b/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
index afe191df43..181f9c1686 100644
--- a/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_socket_qnativesocketengine.cpp b/src/network/doc/snippets/code/src_network_socket_qnativesocketengine.cpp
index e0503250af..8f7ff3bee4 100644
--- a/src/network/doc/snippets/code/src_network_socket_qnativesocketengine.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qnativesocketengine.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_socket_qtcpserver.cpp b/src/network/doc/snippets/code/src_network_socket_qtcpserver.cpp
index a4adb88f52..a19c44c986 100644
--- a/src/network/doc/snippets/code/src_network_socket_qtcpserver.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qtcpserver.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_socket_qudpsocket.cpp b/src/network/doc/snippets/code/src_network_socket_qudpsocket.cpp
index da9d1d98ed..9e491f802e 100644
--- a/src/network/doc/snippets/code/src_network_socket_qudpsocket.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qudpsocket.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp b/src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp
index d157af737c..fd1de88754 100644
--- a/src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp
+++ b/src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_ssl_qsslconfiguration.cpp b/src/network/doc/snippets/code/src_network_ssl_qsslconfiguration.cpp
index 2a909e5aeb..5d90dde5ea 100644
--- a/src/network/doc/snippets/code/src_network_ssl_qsslconfiguration.cpp
+++ b/src/network/doc/snippets/code/src_network_ssl_qsslconfiguration.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp b/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp
index 3bd57f1d44..c1b3ceaf69 100644
--- a/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp
+++ b/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/snippets/network/tcpwait.cpp b/src/network/doc/snippets/network/tcpwait.cpp
index 721c351e3d..97856e157f 100644
--- a/src/network/doc/snippets/network/tcpwait.cpp
+++ b/src/network/doc/snippets/network/tcpwait.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
diff --git a/src/network/doc/src/bearermanagement.qdoc b/src/network/doc/src/bearermanagement.qdoc
index 1f0e000ff1..52b5958996 100644
--- a/src/network/doc/src/bearermanagement.qdoc
+++ b/src/network/doc/src/bearermanagement.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** 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.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/network/doc/src/examples.qdoc b/src/network/doc/src/examples.qdoc
index 3a34296d50..3d31e04989 100644
--- a/src/network/doc/src/examples.qdoc
+++ b/src/network/doc/src/examples.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** 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.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/network/doc/src/network-programming.qdoc b/src/network/doc/src/network-programming.qdoc
index a007115ad3..ce99af034b 100644
--- a/src/network/doc/src/network-programming.qdoc
+++ b/src/network/doc/src/network-programming.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** 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.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/network/doc/src/qtnetwork.qdoc b/src/network/doc/src/qtnetwork.qdoc
index 303895e864..f15b180625 100644
--- a/src/network/doc/src/qtnetwork.qdoc
+++ b/src/network/doc/src/qtnetwork.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** 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.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/network/doc/src/ssl.qdoc b/src/network/doc/src/ssl.qdoc
index 45dffc95a3..0129673ea2 100644
--- a/src/network/doc/src/ssl.qdoc
+++ b/src/network/doc/src/ssl.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** 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.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index 4cf412b96e..dfade24edd 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -1041,11 +1041,11 @@ QPair<QHostAddress, int> QHostAddress::parseSubnet(const QString &subnet)
return invalid; // invalid netmask
// parse the address manually
- QStringList parts = netStr.split(QLatin1Char('.'));
+ auto parts = netStr.splitRef(QLatin1Char('.'));
if (parts.isEmpty() || parts.count() > 4)
return invalid; // invalid IPv4 address
- if (parts.last().isEmpty())
+ if (parts.constLast().isEmpty())
parts.removeLast();
quint32 addr = 0;
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 2cd834ff2c..e55e113619 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -536,7 +536,7 @@ QList<QNetworkAddressEntry> QNetworkInterface::addressEntries() const
QNetworkInterface::interfaceFromName(name).index()
\endcode
- \sa interfaceFromName(), interfaceNameFromIndex(), QUdpDatagram::interfaceIndex()
+ \sa interfaceFromName(), interfaceNameFromIndex()
*/
int QNetworkInterface::interfaceIndexFromName(const QString &name)
{
@@ -596,7 +596,7 @@ QNetworkInterface QNetworkInterface::interfaceFromIndex(int index)
QNetworkInterface::interfaceFromIndex(index).name()
\endcode
- \sa interfaceFromIndex(), interfaceIndexFromName(), QUdpDatagram::interfaceIndex()
+ \sa interfaceFromIndex(), interfaceIndexFromName()
*/
QString QNetworkInterface::interfaceNameFromIndex(int index)
{
diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp
index 76d61f6958..a1085f726a 100644
--- a/src/network/socket/qlocalserver.cpp
+++ b/src/network/socket/qlocalserver.cpp
@@ -184,7 +184,7 @@ QLocalServer::SocketOptions QLocalServer::socketOptions() const
/*!
Stop listening for incoming connections. Existing connections are not
- effected, but any new connections will be refused.
+ affected, but any new connections will be refused.
\sa isListening(), listen()
*/
diff --git a/src/network/socket/qlocalsocket.h b/src/network/socket/qlocalsocket.h
index 0eecab206b..da91ef0e85 100644
--- a/src/network/socket/qlocalsocket.h
+++ b/src/network/socket/qlocalsocket.h
@@ -130,7 +130,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_stateChanged(QAbstractSocket::SocketState))
Q_PRIVATE_SLOT(d_func(), void _q_error(QAbstractSocket::SocketError))
#elif defined(Q_OS_WIN)
- Q_PRIVATE_SLOT(d_func(), void _q_canWrite())
+ Q_PRIVATE_SLOT(d_func(), void _q_bytesWritten(qint64))
Q_PRIVATE_SLOT(d_func(), void _q_pipeClosed())
Q_PRIVATE_SLOT(d_func(), void _q_winError(ulong, const QString &))
#else
diff --git a/src/network/socket/qlocalsocket_p.h b/src/network/socket/qlocalsocket_p.h
index 56f8b590f1..0f84aeea3e 100644
--- a/src/network/socket/qlocalsocket_p.h
+++ b/src/network/socket/qlocalsocket_p.h
@@ -61,6 +61,7 @@
#if defined(QT_LOCALSOCKET_TCP)
# include "qtcpsocket.h"
#elif defined(Q_OS_WIN)
+# include <private/qringbuffer_p.h>
# include "private/qwindowspipereader_p.h"
# include "private/qwindowspipewriter_p.h"
# include <qwineventnotifier.h>
@@ -129,10 +130,12 @@ public:
~QLocalSocketPrivate();
void destroyPipeHandles();
void setErrorString(const QString &function);
- void _q_canWrite();
+ void startNextWrite();
+ void _q_bytesWritten(qint64 bytes);
void _q_pipeClosed();
void _q_winError(ulong windowsError, const QString &function);
HANDLE handle;
+ QRingBuffer writeBuffer;
QWindowsPipeWriter *pipeWriter;
QWindowsPipeReader *pipeReader;
QLocalSocket::LocalSocketError error;
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 7f9b8a7b06..245108911e 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -213,15 +213,21 @@ qint64 QLocalSocket::readData(char *data, qint64 maxSize)
}
}
-qint64 QLocalSocket::writeData(const char *data, qint64 maxSize)
+qint64 QLocalSocket::writeData(const char *data, qint64 len)
{
Q_D(QLocalSocket);
+ if (len == 0)
+ return 0;
+ char *dest = d->writeBuffer.reserve(len);
+ memcpy(dest, data, len);
if (!d->pipeWriter) {
d->pipeWriter = new QWindowsPipeWriter(d->handle, this);
- connect(d->pipeWriter, SIGNAL(canWrite()), this, SLOT(_q_canWrite()));
- connect(d->pipeWriter, SIGNAL(bytesWritten(qint64)), this, SIGNAL(bytesWritten(qint64)));
+ QObjectPrivate::connect(d->pipeWriter, &QWindowsPipeWriter::bytesWritten,
+ d, &QLocalSocketPrivate::_q_bytesWritten);
}
- return d->pipeWriter->write(data, maxSize);
+ if (!d->pipeWriter->isWriteOperationActive())
+ d->startNextWrite();
+ return len;
}
void QLocalSocket::abort()
@@ -230,6 +236,7 @@ void QLocalSocket::abort()
if (d->pipeWriter) {
delete d->pipeWriter;
d->pipeWriter = 0;
+ d->writeBuffer.clear();
}
close();
}
@@ -272,7 +279,7 @@ qint64 QLocalSocket::bytesAvailable() const
qint64 QLocalSocket::bytesToWrite() const
{
Q_D(const QLocalSocket);
- return (d->pipeWriter) ? d->pipeWriter->bytesToWrite() : 0;
+ return d->writeBuffer.size();
}
bool QLocalSocket::canReadLine() const
@@ -304,9 +311,12 @@ void QLocalSocket::close()
bool QLocalSocket::flush()
{
Q_D(QLocalSocket);
- if (d->pipeWriter)
- return d->pipeWriter->waitForWrite(0);
- return false;
+ bool written = false;
+ if (d->pipeWriter) {
+ while (d->pipeWriter->waitForWrite(0))
+ written = true;
+ }
+ return written;
}
void QLocalSocket::disconnectFromServer()
@@ -319,10 +329,11 @@ void QLocalSocket::disconnectFromServer()
// It must be destroyed before close() to prevent an infinite loop.
delete d->pipeWriter;
d->pipeWriter = 0;
+ d->writeBuffer.clear();
}
flush();
- if (d->pipeWriter && d->pipeWriter->bytesToWrite() != 0) {
+ if (bytesToWrite() != 0) {
d->state = QLocalSocket::ClosingState;
emit stateChanged(d->state);
} else {
@@ -351,11 +362,24 @@ bool QLocalSocket::setSocketDescriptor(qintptr socketDescriptor,
return true;
}
-void QLocalSocketPrivate::_q_canWrite()
+void QLocalSocketPrivate::startNextWrite()
+{
+ Q_Q(QLocalSocket);
+ if (writeBuffer.isEmpty()) {
+ if (state == QLocalSocket::ClosingState)
+ q->close();
+ } else {
+ Q_ASSERT(pipeWriter);
+ pipeWriter->write(writeBuffer.readPointer(), writeBuffer.nextDataBlockSize());
+ }
+}
+
+void QLocalSocketPrivate::_q_bytesWritten(qint64 bytes)
{
Q_Q(QLocalSocket);
- if (state == QLocalSocket::ClosingState)
- q->close();
+ writeBuffer.free(bytes);
+ startNextWrite();
+ emit q->bytesWritten(bytes);
}
qintptr QLocalSocket::socketDescriptor() const
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index 4063a225fb..9ba9d5317e 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -111,7 +111,7 @@
\value WantAll this is a catch-all value to indicate the caller is
interested in all the available information
- \sa readDatagram(), QUdpDatagram
+ \sa readDatagram()
*/
#include "qnativesocketengine_p.h"
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index de091753d2..6e6191154e 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -58,6 +58,9 @@
#ifdef Q_OS_BSD4
#include <net/if_dl.h>
#endif
+#ifdef Q_OS_INTEGRITY
+#include <sys/uio.h>
+#endif
#if defined QNATIVESOCKETENGINE_DEBUG
#include <qstring.h>
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index 4122db4b65..99ae7923f4 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -867,13 +867,13 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
ciph.d->protocolString = QLatin1String("TLSv1.2");
}
- const QStringList bits = ciph.d->name.split('-');
+ const auto bits = ciph.d->name.splitRef(QLatin1Char('-'));
if (bits.size() >= 2) {
if (bits.size() == 2 || bits.size() == 3) {
ciph.d->keyExchangeMethod = QLatin1String("RSA");
- } else if (ciph.d->name.startsWith("DH-") || ciph.d->name.startsWith("DHE-")) {
+ } else if (bits.front() == QLatin1String("DH") || bits.front() == QLatin1String("DHE")) {
ciph.d->keyExchangeMethod = QLatin1String("DH");
- } else if (ciph.d->name.startsWith("ECDH-") || ciph.d->name.startsWith("ECDHE-")) {
+ } else if (bits.front() == QLatin1String("ECDH") || bits.front() == QLatin1String("ECDHE")) {
ciph.d->keyExchangeMethod = QLatin1String("ECDH");
} else {
qCWarning(lcSsl) << "Unknown Kx" << ciph.d->name;
@@ -881,35 +881,35 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
if (bits.size() == 2 || bits.size() == 3) {
ciph.d->authenticationMethod = QLatin1String("RSA");
- } else if (ciph.d->name.contains("-ECDSA-")) {
+ } else if (ciph.d->name.contains(QLatin1String("-ECDSA-"))) {
ciph.d->authenticationMethod = QLatin1String("ECDSA");
- } else if (ciph.d->name.contains("-RSA-")) {
+ } else if (ciph.d->name.contains(QLatin1String("-RSA-"))) {
ciph.d->authenticationMethod = QLatin1String("RSA");
} else {
qCWarning(lcSsl) << "Unknown Au" << ciph.d->name;
}
- if (ciph.d->name.contains("RC4-")) {
+ if (ciph.d->name.contains(QLatin1String("RC4-"))) {
ciph.d->encryptionMethod = QLatin1String("RC4(128)");
ciph.d->bits = 128;
ciph.d->supportedBits = 128;
- } else if (ciph.d->name.contains("DES-CBC3-")) {
+ } else if (ciph.d->name.contains(QLatin1String("DES-CBC3-"))) {
ciph.d->encryptionMethod = QLatin1String("3DES(168)");
ciph.d->bits = 168;
ciph.d->supportedBits = 168;
- } else if (ciph.d->name.contains("AES128-")) {
+ } else if (ciph.d->name.contains(QLatin1String("AES128-"))) {
ciph.d->encryptionMethod = QLatin1String("AES(128)");
ciph.d->bits = 128;
ciph.d->supportedBits = 128;
- } else if (ciph.d->name.contains("AES256-GCM")) {
+ } else if (ciph.d->name.contains(QLatin1String("AES256-GCM"))) {
ciph.d->encryptionMethod = QLatin1String("AESGCM(256)");
ciph.d->bits = 256;
ciph.d->supportedBits = 256;
- } else if (ciph.d->name.contains("AES256-")) {
+ } else if (ciph.d->name.contains(QLatin1String("AES256-"))) {
ciph.d->encryptionMethod = QLatin1String("AES(256)");
ciph.d->bits = 256;
ciph.d->supportedBits = 256;
- } else if (ciph.d->name.contains("NULL-")) {
+ } else if (ciph.d->name.contains(QLatin1String("NULL-"))) {
ciph.d->encryptionMethod = QLatin1String("NULL");
} else {
qCWarning(lcSsl) << "Unknown Enc" << ciph.d->name;
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 9c27cd4a0f..48f8e258df 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -226,13 +226,13 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *ciph
char buf [256];
QString descriptionOneLine = QString::fromLatin1(q_SSL_CIPHER_description(cipher, buf, sizeof(buf)));
- QStringList descriptionList = descriptionOneLine.split(QLatin1Char(' '), QString::SkipEmptyParts);
+ const auto descriptionList = descriptionOneLine.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
if (descriptionList.size() > 5) {
// ### crude code.
ciph.d->isNull = false;
- ciph.d->name = descriptionList.at(0);
+ ciph.d->name = descriptionList.at(0).toString();
- QString protoString = descriptionList.at(1);
+ QString protoString = descriptionList.at(1).toString();
ciph.d->protocolString = protoString;
ciph.d->protocol = QSsl::UnknownProtocol;
if (protoString == QLatin1String("SSLv3"))
@@ -247,11 +247,11 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *ciph
ciph.d->protocol = QSsl::TlsV1_2;
if (descriptionList.at(2).startsWith(QLatin1String("Kx=")))
- ciph.d->keyExchangeMethod = descriptionList.at(2).mid(3);
+ ciph.d->keyExchangeMethod = descriptionList.at(2).mid(3).toString();
if (descriptionList.at(3).startsWith(QLatin1String("Au=")))
- ciph.d->authenticationMethod = descriptionList.at(3).mid(3);
+ ciph.d->authenticationMethod = descriptionList.at(3).mid(3).toString();
if (descriptionList.at(4).startsWith(QLatin1String("Enc=")))
- ciph.d->encryptionMethod = descriptionList.at(4).mid(4);
+ ciph.d->encryptionMethod = descriptionList.at(4).mid(4).toString();
ciph.d->exportable = (descriptionList.size() > 6 && descriptionList.at(6) == QLatin1String("export"));
ciph.d->bits = q_SSL_CIPHER_get_bits(cipher, &ciph.d->supportedBits);
@@ -715,14 +715,12 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
directories << ministroPath;
nameFilters << QLatin1String("*.der");
platformEncodingFormat = QSsl::Der;
-# ifndef Q_OS_ANDROID_NO_SDK
if (ministroPath.isEmpty()) {
QList<QByteArray> certificateData = fetchSslCertificateData();
for (int i = 0; i < certificateData.size(); ++i) {
systemCerts.append(QSslCertificate::fromData(certificateData.at(i), QSsl::Der));
}
} else
-# endif //Q_OS_ANDROID_NO_SDK
# endif //Q_OS_ANDROID
{
currentDir.setNameFilters(nameFilters);
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 09bbb703c5..e791b9d166 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -206,7 +206,7 @@ public:
private:
static bool ensureLibraryLoaded();
static void ensureCiphersAndCertsLoaded();
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+#if defined(Q_OS_ANDROID)
static QList<QByteArray> fetchSslCertificateData();
#endif
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index 2173bf6ccc..c70664ef9b 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -65,7 +65,7 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
darwin:SOURCES += ssl/qsslsocket_mac_shared.cpp
- android:!android-no-sdk: SOURCES += ssl/qsslsocket_openssl_android.cpp
+ android: SOURCES += ssl/qsslsocket_openssl_android.cpp
# Add optional SSL libs
# Static linking of OpenSSL with msvc: