diff options
Diffstat (limited to 'src/websockets/qwebsocketframe.cpp')
-rw-r--r-- | src/websockets/qwebsocketframe.cpp | 49 |
1 files changed, 6 insertions, 43 deletions
diff --git a/src/websockets/qwebsocketframe.cpp b/src/websockets/qwebsocketframe.cpp index 008fe8c..6ce8c13 100644 --- a/src/websockets/qwebsocketframe.cpp +++ b/src/websockets/qwebsocketframe.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Kurt Pattyn <pattyn.kurt@gmail.com>. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebSockets module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Kurt Pattyn <pattyn.kurt@gmail.com>. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only /*! \class QWebSocketFrame @@ -248,8 +212,7 @@ void QWebSocketFrame::readFrame(QIODevice *pIoDevice) return; default: - Q_UNREACHABLE(); - return; + Q_UNREACHABLE_RETURN(); } } } @@ -300,7 +263,7 @@ QWebSocketFrame::ProcessingState QWebSocketFrame::readFrameHeader(QIODevice *pIo */ QWebSocketFrame::ProcessingState QWebSocketFrame::readFramePayloadLength(QIODevice *pIoDevice) { - // see http://tools.ietf.org/html/rfc6455#page-28 paragraph 5.2 + // see https://tools.ietf.org/html/rfc6455#page-28 paragraph 5.2 // in all cases, the minimal number of bytes MUST be used to encode the length, // for example, the length of a 124-byte-long string can't be encoded as the // sequence 126, 0, 124" @@ -333,7 +296,7 @@ QWebSocketFrame::ProcessingState QWebSocketFrame::readFramePayloadLength(QIODevi return PS_DISPATCH_RESULT; } // Most significant bit must be set to 0 as - // per http://tools.ietf.org/html/rfc6455#section-5.2 + // per https://tools.ietf.org/html/rfc6455#section-5.2 m_length = qFromBigEndian<quint64>(length); if (Q_UNLIKELY(m_length & (quint64(1) << 63))) { setError(QWebSocketProtocol::CloseCodeProtocolError, @@ -388,7 +351,7 @@ QWebSocketFrame::ProcessingState QWebSocketFrame::readFramePayload(QIODevice *pI m_payload = pIoDevice->read(int(m_length)); // m_length can be safely cast to an integer, // because MAX_FRAME_SIZE_IN_BYTES = MAX_INT - if (Q_UNLIKELY(m_payload.length() != int(m_length))) { + if (Q_UNLIKELY(m_payload.size() != int(m_length))) { // some error occurred; refer to the Qt documentation of QIODevice::read() setError(QWebSocketProtocol::CloseCodeAbnormalDisconnection, tr("Some serious error occurred while reading from the network.")); |