summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket_p.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/websockets/qwebsocket_p.cpp')
-rw-r--r--src/websockets/qwebsocket_p.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index 8cd7375..188df33 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -708,12 +708,11 @@ QByteArray QWebSocketPrivate::getFrameHeader(QWebSocketProtocol::OpCode opCode,
bool lastFrame)
{
QByteArray header;
- quint8 byte = 0x00;
bool ok = payloadLength <= 0x7FFFFFFFFFFFFFFFULL;
if (Q_LIKELY(ok)) {
//FIN, RSV1-3, opcode (RSV-1, RSV-2 and RSV-3 are zero)
- byte = static_cast<quint8>((opCode & 0x0F) | (lastFrame ? 0x80 : 0x00));
+ quint8 byte = static_cast<quint8>((opCode & 0x0F) | (lastFrame ? 0x80 : 0x00));
header.append(static_cast<char>(byte));
byte = 0x00;
@@ -773,7 +772,6 @@ qint64 QWebSocketPrivate::doWriteFrames(const QByteArray &data, bool isBinary)
if (Q_UNLIKELY(numFrames == 0))
numFrames = 1;
quint64 currentPosition = 0;
- qint64 bytesWritten = 0;
quint64 bytesLeft = data.size();
for (int i = 0; i < numFrames; ++i) {
@@ -789,7 +787,7 @@ qint64 QWebSocketPrivate::doWriteFrames(const QByteArray &data, bool isBinary)
: QWebSocketProtocol::OpCodeContinue;
//write header
- bytesWritten += m_pSocket->write(getFrameHeader(opcode, size, maskingKey, isLastFrame));
+ m_pSocket->write(getFrameHeader(opcode, size, maskingKey, isLastFrame));
//write payload
if (Q_LIKELY(size > 0)) {
@@ -798,7 +796,6 @@ qint64 QWebSocketPrivate::doWriteFrames(const QByteArray &data, bool isBinary)
QWebSocketProtocol::mask(currentData, size, maskingKey);
qint64 written = m_pSocket->write(currentData, static_cast<qint64>(size));
if (Q_LIKELY(written > 0)) {
- bytesWritten += written;
payloadWritten += written;
} else {
m_pSocket->flush();
@@ -881,7 +878,7 @@ qint64 QWebSocketPrivate::writeFrame(const QByteArray &frame)
/*!
\internal
*/
-QString readLine(QTcpSocket *pSocket)
+static QString readLine(QTcpSocket *pSocket)
{
Q_ASSERT(pSocket);
QString line;