summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-25 10:14:38 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-25 10:15:01 +0100
commitfcd4c98922bd1a1a97ea264bd45e48cfa356c254 (patch)
treec01e6aee62e5c80c7d7f6f842de7bad3fbc46599 /src
parentb01068a406f6ebf51e103dd541f36fd6ef144805 (diff)
parentfc2b42c874fb41487b86700a04e932e2afaded94 (diff)
downloadqtwebsockets-fcd4c98922bd1a1a97ea264bd45e48cfa356c254.tar.gz
Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I218b5069480f60b88390c8540f01c3dbbee485d0
Diffstat (limited to 'src')
-rw-r--r--src/websockets/qwebsocket_p.cpp7
-rw-r--r--src/websockets/qwebsocketframe.cpp4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index f6b2f43..2bb5151 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -441,8 +441,13 @@ void QWebSocketPrivate::ping(const QByteArray &payload)
{
QByteArray payloadTruncated = payload.left(125);
m_pingTimer.restart();
+ quint32 maskingKey = 0;
+ if (m_mustMask)
+ maskingKey = generateMaskingKey();
QByteArray pingFrame = getFrameHeader(QWebSocketProtocol::OpCodePing, payloadTruncated.size(),
- 0 /*do not mask*/, true);
+ maskingKey, true);
+ if (m_mustMask)
+ QWebSocketProtocol::mask(&payloadTruncated, maskingKey);
pingFrame.append(payloadTruncated);
qint64 ret = writeFrame(pingFrame);
Q_UNUSED(ret);
diff --git a/src/websockets/qwebsocketframe.cpp b/src/websockets/qwebsocketframe.cpp
index e604a5e..a4e644b 100644
--- a/src/websockets/qwebsocketframe.cpp
+++ b/src/websockets/qwebsocketframe.cpp
@@ -307,7 +307,7 @@ bool QWebSocketFrame::isValid() const
// The arm compiler of Visual Studio 2013 Update 3 crashes when
// trying to optimize QWebSocketFrame::readFrame. Hence turn
// those off for this snippet
-#if defined(Q_OS_WINPHONE) && defined(__ARM__)
+#if (defined(Q_OS_WINPHONE) || defined(Q_OS_WINRT)) && defined(__ARM__)
# pragma optimize("", off)
#endif
@@ -519,7 +519,7 @@ QWebSocketFrame QWebSocketFrame::readFrame(QIODevice *pIoDevice)
return frame;
}
-#if defined(Q_OS_WINPHONE) && defined(__ARM__)
+#if (defined(Q_OS_WINPHONE) || defined(Q_OS_WINRT)) && defined(__ARM__)
# pragma optimize("", on)
#endif