From f75d950bd4353c436f9863d06af65b6cbc672c76 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 23 Mar 2016 11:04:06 +0100 Subject: Fix typo in QLocalServer documentation Change-Id: Iceababb1e137c2363ee8a75476ecb4f5dba53b28 Reviewed-by: Oswald Buddenhagen --- src/network/socket/qlocalserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp index 0f49cb986e..1c60cba903 100644 --- a/src/network/socket/qlocalserver.cpp +++ b/src/network/socket/qlocalserver.cpp @@ -178,7 +178,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() */ -- cgit v1.2.3 From 24411e9743735d6323f1d3686f8b989a5122f83b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 23 Mar 2016 15:45:12 +0100 Subject: Add a write buffer to QLocalSocket/Win Commit 0307c008 removed the buffering of data-to-be-written from QWindowsPipeWriter, because it was assumed that users of this class (QProcess and QLocalSocket) already buffer data internally. This assumption was wrong for QLocalSocket. The following sequence localSocket->write(someData); localSocket->write(someMoreData); would not write anything on the second write. Add a write buffer to the Windows implementation of QLocalSocket. Task-number: QTBUG-52073 Change-Id: I6d0f03a722ec48138cbde3e2f69aae7dafe790d3 Reviewed-by: Oswald Buddenhagen --- src/network/socket/qlocalsocket.h | 2 +- src/network/socket/qlocalsocket_p.h | 5 +++- src/network/socket/qlocalsocket_win.cpp | 48 ++++++++++++++++++++++++--------- 3 files changed, 41 insertions(+), 14 deletions(-) (limited to 'src/network') diff --git a/src/network/socket/qlocalsocket.h b/src/network/socket/qlocalsocket.h index 4b39a7c562..09828c8b0d 100644 --- a/src/network/socket/qlocalsocket.h +++ b/src/network/socket/qlocalsocket.h @@ -124,7 +124,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 46c93c01f7..a594605ae0 100644 --- a/src/network/socket/qlocalsocket_p.h +++ b/src/network/socket/qlocalsocket_p.h @@ -55,6 +55,7 @@ #if defined(QT_LOCALSOCKET_TCP) # include "qtcpsocket.h" #elif defined(Q_OS_WIN) +# include # include "private/qwindowspipereader_p.h" # include "private/qwindowspipewriter_p.h" # include @@ -123,10 +124,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 03ad2b6654..d477de9c47 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -207,15 +207,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() @@ -224,6 +230,7 @@ void QLocalSocket::abort() if (d->pipeWriter) { delete d->pipeWriter; d->pipeWriter = 0; + d->writeBuffer.clear(); } close(); } @@ -266,7 +273,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 @@ -298,9 +305,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() @@ -313,10 +323,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 { @@ -345,11 +356,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 -- cgit v1.2.3 From cd46a2daf57dea2e0b661d72f6eb2171079797ba Mon Sep 17 00:00:00 2001 From: Jani Heikkinen Date: Fri, 22 Jan 2016 14:24:00 +0200 Subject: Unify license header usage. Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll --- src/network/doc/snippets/code/doc_src_qtnetwork.cpp | 16 +++++++++++++--- .../doc/snippets/code/src_network_access_qftp.cpp | 16 +++++++++++++--- .../code/src_network_access_qnetworkaccessmanager.cpp | 16 +++++++++++++--- .../code/src_network_access_qnetworkdiskcache.cpp | 16 +++++++++++++--- .../snippets/code/src_network_access_qnetworkreply.cpp | 16 +++++++++++++--- .../snippets/code/src_network_access_qnetworkrequest.cpp | 16 +++++++++++++--- .../code/src_network_bearer_qnetworkconfigmanager.cpp | 16 +++++++++++++--- .../doc/snippets/code/src_network_kernel_qdnslookup.cpp | 16 +++++++++++++--- .../snippets/code/src_network_kernel_qhostaddress.cpp | 16 +++++++++++++--- .../doc/snippets/code/src_network_kernel_qhostinfo.cpp | 16 +++++++++++++--- .../snippets/code/src_network_kernel_qnetworkproxy.cpp | 16 +++++++++++++--- .../snippets/code/src_network_socket_qabstractsocket.cpp | 16 +++++++++++++--- .../code/src_network_socket_qlocalsocket_unix.cpp | 16 +++++++++++++--- .../code/src_network_socket_qnativesocketengine.cpp | 16 +++++++++++++--- .../doc/snippets/code/src_network_socket_qtcpserver.cpp | 16 +++++++++++++--- .../doc/snippets/code/src_network_socket_qudpsocket.cpp | 16 +++++++++++++--- .../snippets/code/src_network_ssl_qsslcertificate.cpp | 16 +++++++++++++--- .../snippets/code/src_network_ssl_qsslconfiguration.cpp | 16 +++++++++++++--- .../doc/snippets/code/src_network_ssl_qsslsocket.cpp | 16 +++++++++++++--- src/network/doc/snippets/network/tcpwait.cpp | 16 +++++++++++++--- src/network/doc/src/bearermanagement.qdoc | 10 +++++----- src/network/doc/src/examples.qdoc | 10 +++++----- src/network/doc/src/network-programming.qdoc | 10 +++++----- src/network/doc/src/qtnetwork.qdoc | 10 +++++----- src/network/doc/src/ssl.qdoc | 10 +++++----- 25 files changed, 285 insertions(+), 85 deletions(-) (limited to 'src/network') 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é -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 Jeremy Lainé +** 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$ ** ****************************************************************************/ -- cgit v1.2.3 From 91f8c9cc70bbfb752811cd29945fb37ff863d524 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 18 Mar 2016 10:49:43 +0100 Subject: Remove the traces of the discontinued android-no-sdk platform Cleaning out the workarounds for the discontinued "Embedded Android" platform of Boot2Qt. Change-Id: I0ff9d770e82a43457fb7e5da0428f4597ead4038 Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Oswald Buddenhagen --- src/network/ssl/qsslsocket_openssl.cpp | 2 -- src/network/ssl/qsslsocket_p.h | 2 +- src/network/ssl/ssl.pri | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/network') diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index b86b69cad4..b092dde0c9 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -729,14 +729,12 @@ QList QSslSocketPrivate::systemCaCertificates() directories << ministroPath; nameFilters << QLatin1String("*.der"); platformEncodingFormat = QSsl::Der; -# ifndef Q_OS_ANDROID_NO_SDK if (ministroPath.isEmpty()) { QList 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 018da2ffdb..5d4d52cd6d 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -209,7 +209,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 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: -- cgit v1.2.3 From d05673ac2067f2b1aa2c8594d744294a42d6abd6 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 27 Oct 2015 02:30:03 +0100 Subject: Adjust include file for native sockets on INTEGRITY. Change-Id: Ibe957eb510fd46d828acedd3e66fa0b49c9a42f0 Reviewed-by: Oswald Buddenhagen --- src/network/socket/qnativesocketengine_unix.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/network') 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 #endif +#ifdef Q_OS_INTEGRITY +#include +#endif #if defined QNATIVESOCKETENGINE_DEBUG #include -- cgit v1.2.3 From 3cbe25c9a657b3fbefd194df5dd34a7cbabb9331 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 30 Mar 2016 14:23:12 +0300 Subject: QtNetwork: use QStringRef to optimize memory allocation Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Change-Id: I697f776c60003629990cfd197534ffed63bafe2f Reviewed-by: Marc Mutz --- src/network/access/qftp.cpp | 14 +++++++------- src/network/kernel/qhostaddress.cpp | 4 ++-- src/network/ssl/qsslsocket_mac.cpp | 2 +- src/network/ssl/qsslsocket_openssl.cpp | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/network') 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/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index 6ccf40680a..0dbe1112cd 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -1041,11 +1041,11 @@ QPair 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/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp index 4122db4b65..da9c8c165b 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -867,7 +867,7 @@ 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"); diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index b092dde0c9..4f62f53a93 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); -- cgit v1.2.3 From 77c0730f55ede6117028805bbf05a6180c248c73 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Mar 2016 10:33:12 +0100 Subject: QtNetwork: Remove documentation references to QUdpDatagram. Fixes documentation warnings: qtbase/src/network/kernel/qnetworkinterface.cpp:528: warning: Can't link to 'QUdpDatagram::interfaceIndex()' qtbase/src/network/kernel/qnetworkinterface.cpp:587: warning: Can't link to 'QUdpDatagram::interfaceIndex()' Change-Id: I6579f7880b5e183b9c68dfe08fa7671f1511fdfa Reviewed-by: Alex Trotsenko Reviewed-by: Richard J. Moore --- src/network/kernel/qnetworkinterface.cpp | 4 ++-- src/network/socket/qnativesocketengine.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/network') 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 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/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" -- cgit v1.2.3 From f68c62cdfc4d66def52aa73fbc2ad58acc32af62 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Thu, 31 Mar 2016 13:05:11 +0300 Subject: QSslSocket (Mac): optimize string usage Wrap C-string in QL1S to prevent memory allocation. Replace startsWith() with comparing to first element of (existing) splitting result. Change-Id: Id47a0c350e4027abecd1394c1ee5dec8f346af00 Reviewed-by: Marc Mutz Reviewed-by: Edward Welbourne --- src/network/ssl/qsslsocket_mac.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/network') diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp index da9c8c165b..99ae7923f4 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -871,9 +871,9 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui 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; -- cgit v1.2.3