summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocketframe_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Make QWebSocketFrame::readFrame as a non-static public functionRyan Chu2019-08-231-1/+1
| | | | | | | | | | | | The static function QWebSocketFrame::readFrame used to return a parsed QWebSocketFrame read from QIODevice. This change make QWebSocketFrame reusable. It will base on its internal state and keep processing the incoming data from QIODevice. Change-Id: Ic6dea59529fa935cdb8034519e633ea67e869674 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add an internal state to keep the processing state of frame readingRyan Chu2019-08-231-1/+1
| | | | | | | | | | | The macro 'WAIT_FOR_MORE_DATA' is revised because the processing state is kept by m_processingState. Remove the unused dataWaitSize and returnState local variables from QWebSocketFrame::readFrame. Change-Id: I8e270c5c7117b170159d4fb3b2bf1531a9cd5334 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Divide QWebSocketFrame::readFrame into subroutinesRyan Chu2019-08-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | To reduce the dependency of each state and remove local variables (bytesRead, hasMask, and payloadLength) from QWebSocketFrame::readFrame, this change breaks down the states of QWebSocketFrame::readFrame into subroutines. In this change, it uses a readFramePayloadLength function to handle PS_READ_PAYLOAD_LENGTH and PS_READ_BIG_PAYLOAD_LENGTH cases. In addition, a missing error-handling is added in the read-header case if the bytesAvailable is less than 2 bytes. The variable hasMask is replaced by transiently using m_mask to indicate whether to read a mask. After reading mask in readFrameMask, the transient value will be over-written and used in readFramePayload. To replace local variable payloadLength with QWebSocketFrame::m_length, m_length is expanded to hold the payload length. Change-Id: I1c2d197112cef5cea75215923fa28e6f2e6cbef8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Updated license headersAntti Kokko2016-01-201-14/+20
| | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I8c17da1f7e2f0a620e3627fa7f8087f185545c8a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-051-0/+11
| | | | | Change-Id: Icc8c6928619b2e16f5f13e852e559438faf9a03c Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* rsv1-3 should be bool instead of intLiang Qi2015-09-141-8/+7
| | | | | | | | | And reorded the data members of QWebSocketFrame to save some space. Change-Id: I6fdaf74f344ac84e5a3f19883309455503a7ec4c Reviewed-by: Luca Niccoli <lultimouomo@gmail.com> Reviewed-by: Maks Naumov <maksqwe1@ukr.net> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-161-6/+6
| | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I8467410bfad44e8d3fe6bd5724c61bb0c07c91f9 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* Fix the translation in QWebSocketFrameLiang Qi2015-02-101-0/+3
| | | | | | Task-number: QTBUG-38740 Change-Id: If8df86990686af6811ad3bb21f93448ced946b6c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update license headers and add new license filesv5.4.0-alpha1Antti Kokko2014-08-241-18/+10
| | | | | | | - Added LICENSE.LGPLv3, LICENSE.GPLv2 & LICENSE.LGPLv21 Change-Id: I0586e35a7aa99be1b5b3bda580b05897f451acbf Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Adapt copyright headerKurt Pattyn2014-02-151-1/+1
| | | | | Change-Id: I9773492d3673d8aabdb4dd178be6af12eca7ba74 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add a few more const refsFrederik Gladhorn2014-01-181-1/+1
| | | | | | | | | In case of processPing we need to make a copy that potentially detaches when masking is requested, but pings are < 125 bytes. Before this code would copy the byte array in the same way much earlier. Change-Id: If0592bb4b508eeb11fdbf05c4bb98b9679ed0549 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Move OpCode out of public APIKurt Pattyn2014-01-131-1/+2
| | | | | Change-Id: Ic0b34b684d6f9ca98789304ead1cf8b993422d02 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Limit line length to 100 characters.Kurt Pattyn2014-01-121-5/+5
| | | | | Change-Id: I9da963570b174b9a5a33e65cf144402677b4bab5 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Cleanup code to comply with Qt styleKurt Pattyn2013-12-101-0/+7
| | | | | | | | | | | | | | - Correct placement of curly braces - Remove commented-out code - Remove superfluous qDebug statements - Add missing QT_BEGIN_NAMESPACE declarations - Add move semantics - Add cleanup handling to QWebSocketServerPrivate - Add error handling to handshake response, QWebSocketServerPrivate, QWebSocketServer, dataprocessor Change-Id: I0690dc2c444fd6fc0db974d1459bf41bd8c31d40 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Sanitize include directivesKurt Pattyn2013-11-061-2/+2
| | | | | Change-Id: I510e5e8f263d3ea08dd3d623b054d06b2911c6d6 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Add correct license headersKurt Pattyn2013-11-011-18/+40
| | | | | Change-Id: I789cd780697aedbca7a90a5991df00b2c7e9ec98 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Remove const from return value of operator =Kurt Pattyn2013-10-191-1/+1
| | | | | Change-Id: I062756f8b337afee0b4f04bd6631d83bc560a607 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Renamed getter methods to be Qt compliantKurt Pattyn2013-10-131-10/+15
| | | | | | | Renamed all getXXX() methods in QWebSocketFrame to XXX() methods to be Qt compliant. Change-Id: Iea47bcf1772a755f303065ff12d07b0ba99d4aac Reviewed-by: Steven Ceuppens <steven.ceuppens@icloud.com>
* Added TODO explaining some optimizationsKurt Pattyn2013-10-131-13/+1
| | | | | | | | | Moved documentation from .h to .cpp Export QWebSocketFrame class for unit testing Added unit tests for web socket frames Change-Id: I824da86fed37fbcd1f5671a21467af7a66f5c019 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* moved class to separate fileSteven Ceuppens2013-09-291-0/+104
As QWebSocketFrame is quite big, i moved it into its own file, for futher implementation:wq Change-Id: Iadf51323d5e8151c8345057614f4c49f81e626b1 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>