user avatar
Fixed possible block clearing in QWebSocketDataProcessor::process method
Aleksey Lysenko authored
In QWebSocketDataProcessor::process() the signals text(binary)MessageReceived
are emitted before clear() method. If signal handler blocks loop
(for example, using QDialog::exec()), clear() will be called only after
resuming loop. It may lead to the data corruption due to the fact that
QWebSocketDataProcessor clearing won't be performed before the new data
arrived.

Task-number: QTBUG-55506
Change-Id: Ib7016a91d3987dec7c1af977b17f86a53568c413
Reviewed-by: default avatarTimur Pocheptsov <timur.pocheptsov@qt.io>
2eeee81b

Introduction

QtWebSockets is a pure Qt implementation of WebSockets - both client and server. It is implemented as a Qt add-on module, that can easily be embedded into existing Qt projects. It has no other dependencies than Qt.

Features

  • Client and server capable
  • Text and binary sockets
  • Frame-based and message-based signals
  • Strict Unicode checking
  • WSS and proxy support

Requirements

Qt 5.x

Build And Usage

Checkout the source code from code.qt.io Go into the source directory and execute:

qmake
make
make install

The last command will install QtWebSockets as a Qt module.

To use, add websockets to the QT variable.

QT += websockets

Compliance

QtWebSockets is compliant with RFC6455 and has been tested with the Autobahn Testsuite.

Missing Features

  • Extensions and sub-protocols

License

This code is licensed under LGPLv3 or LGPLv2.1.