summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocketframe_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/websockets/qwebsocketframe_p.h')
-rw-r--r--src/websockets/qwebsocketframe_p.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/websockets/qwebsocketframe_p.h b/src/websockets/qwebsocketframe_p.h
index 5c3a7df..e2b4e9f 100644
--- a/src/websockets/qwebsocketframe_p.h
+++ b/src/websockets/qwebsocketframe_p.h
@@ -101,15 +101,16 @@ public:
void clear();
bool isValid() const;
+ bool isDone() const;
- static QWebSocketFrame readFrame(QIODevice *pIoDevice);
+ void readFrame(QIODevice *pIoDevice);
private:
QWebSocketProtocol::CloseCode m_closeCode;
QString m_closeReason;
quint32 m_mask;
QWebSocketProtocol::OpCode m_opCode;
- quint8 m_length;
+ quint64 m_length;
QByteArray m_payload;
bool m_isFinalFrame;
@@ -122,12 +123,16 @@ private:
{
PS_READ_HEADER,
PS_READ_PAYLOAD_LENGTH,
- PS_READ_BIG_PAYLOAD_LENGTH,
PS_READ_MASK,
PS_READ_PAYLOAD,
PS_DISPATCH_RESULT,
PS_WAIT_FOR_MORE_DATA
- };
+ } m_processingState{PS_READ_HEADER};
+
+ ProcessingState readFrameHeader(QIODevice *pIoDevice);
+ ProcessingState readFramePayloadLength(QIODevice *pIoDevice);
+ ProcessingState readFrameMask(QIODevice *pIoDevice);
+ ProcessingState readFramePayload(QIODevice *pIoDevice);
void setError(QWebSocketProtocol::CloseCode code, const QString &closeReason);
bool checkValidity();