aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/SMsgReader.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused rfb/util.h includesPierre Ossman2023-02-041-0/+1
| | | | | | | | These files don't use anything from this header, so remove the include. This exposes some missing includes in other places, though. So add an explicit include in the files that were relying on an indirect inclusion.
* Use std::vector for temporary char arraysPierre Ossman2023-02-041-4/+3
| | | | | | | | It's more standard and familiar than our custom CharArray type, and it still gives us automatic freeing of the buffer. We could probably have used std::unique_ptr instead, but we are currently targeting older compilers where C++11 isn't standard yet.
* Return std::string instead of dynamic allocationsPierre Ossman2023-02-041-2/+2
| | | | | | We mostly use classical C strings, but the memory management around them can get confusing and error prone. Let's use std::string for the cases where we need to return a newly allocated string.
* Use std::vector for basic data arraysPierre Ossman2023-02-011-5/+6
| | | | | Avoid our own custom types in favour of what's already included with C++.
* Use stdint typesPierre Ossman2023-02-011-15/+16
| | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* Stop supplying flags to clipboard peek handlerPierre Ossman2023-01-041-1/+1
| | | | The flags should always be empty anyway.
* Safely discard large (extended) clipboard contentsPierre Ossman2022-06-281-4/+20
| | | | | | | | | Avoid having to buffer everything we want to discard, and instead do it piece by piece. This is more efficient, and avoids hitting any limits on the buffering. Note that this is safe here because we already know we have all the compressed data. It would not be safe for a general input stream.
* Be consistent in including config.hPierre Ossman2021-12-301-0/+5
| | | | | | The generally recommended way is to include it from source files, not headers. We had a mix of both. Let's try to be consistent and follow the recommended way.
* Fix some incorrect data waitsPierre Ossman2021-03-021-10/+10
| | | | | | | | Some of these were incorrectly calculated so the server or client would wait too long before proceeding with decoding. Change all of these to be a more explicit calculation to avoid such issues in the future.
* Change streams to be asynchronousPierre Ossman2020-05-211-36/+156
| | | | | | | | | | Major restructuring of how streams work. Neither input nor output streams are now blocking. This avoids stalling the rest of the client or server when a peer is slow or unresponsive. Note that this puts an extra burden on users of streams to make sure they are allowed to do their work once the underlying transports are ready (e.g. monitoring fds).
* Make ZlibInStream more robust against failuresPierre Ossman2019-11-151-1/+2
| | | | | | | | | | | | Move the checks around to avoid missing cases where we might access memory that is no longer valid. Also avoid touching the underlying stream implicitly (e.g. via the destructor) as it might also no longer be valid. A malicious server could theoretically use this for remote code execution in the client. Issue found by Pavel Cheremushkin from Kaspersky Lab
* Support extended clipboard transfersPierre Ossman2019-07-011-5/+107
| | | | | | | Implements support in both client and server for the extended clipboard format first seen in UltraVNC. Currently only implements text handling, but that is still an improvement as it extends the clipboard from ISO 8859-1 to full Unicode.
* Clean up internal clipboard handlingPierre Ossman2019-07-011-1/+1
| | | | | | We now filter incoming data, which means we can start assuming the clipboard data is always null terminated. This allows us to clean up a lot of the internal handling.
* Make sure clipboard uses \n line endingsPierre Ossman2019-07-011-3/+3
| | | | | | This is required by the protocol so we should make sure it is enforced. We are tolerant of clients that violate this though and convert incoming clipboard data.
* Do proper logging rather than fprintf(stderr, ...)Pierre Ossman2019-04-291-2/+2
|
* Basic support for QEMU Extended Key EventsPierre Ossman2017-08-281-1/+28
| | | | | | This adds the basic infrastructure and handshake for the QEMU Extended Key Events extension. No viewer or server makes use of the extra functionality yet though.
* Fix crash from integer overflow in SMsgReader::readClientCutTextMichal Srb2017-03-271-0/+3
| | | | | | The length sent by client is U32, but is converted into int. If it was bigger than 0x7fffffff the resulting int is negative, it passes the check against maxCutText and later throws std::bad_alloc from CharArray which takes down the whole server. All the Streaming API deals with lengths in ints, so we can't tell it to skip that big amount of data. And it is not realistic to expect more than 2GB of clipboard data anyway. So lets just throw rdr::Exception that will disconnect this client and keep the server alive.
* Merge the "V3" message classes into the normal onesPierre Ossman2014-07-071-0/+112
| | | | We have no need for this abstraction so let's keep things simple.
* Eliminate GCC signed/unsigned warnings related to encodings: ThePeter Åstrand2010-02-101-1/+1
| | | | | | | | | | | | encoding in the RFB protocol has always been signed, and signed values are also used in the specification (ie DesktopName = -307 etc). In the code, however, unsigned types were used in a number of places, but not all, which causes warnings. This patch fixes the problem by switching to signed values everywhere. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3968 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Remove the "video" feature and its associated custom JPEG handling.Pierre Ossman2009-03-051-22/+0
| | | | | | | | Having the client specifiy the video region is conceptually wrong and a problem like this should be handled by better encoding selection. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3635 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Enhancements, refactoring] Rationalized functions to control videoConstantin Kaplinsky2008-09-051-4/+7
| | | | | | | | rectangle selection and default video rectangle. Added more logging and improved error checking in the related code. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2753 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Handling VideoRectangleSelection protocol message (TightVNC extension).Constantin Kaplinsky2008-06-141-2/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2585 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Removed support for continuous updates, a TightVNC-specific RFB protocolConstantin Kaplinsky2008-06-051-14/+0
| | | | | | | | | extension. That extension used to send framebuffer updates continuously, not waiting for clients' requests. However, it showed bad results with low-bandwidth connections, due to lack of proper data flow control. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2581 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Using proper logging in SMsgReader class. Reporting details on receiving ↵Constantin Kaplinsky2008-04-241-3/+10
| | | | | | VideoRectangleSelection messages. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2560 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Support for VideoRectangleSelection client message in the server code. The ↵Constantin Kaplinsky2008-04-241-0/+15
| | | | | | message is read but ignored (only a message will be written to stderr). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2559 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Initial implementation of continuous updates in the server code. This code ↵Constantin Kaplinsky2007-04-051-0/+15
| | | | | | does not handle framebuffer size changes properly yet. Also, the server does not send the client EndOfContinuousUpdates message yet (documented in doc/rfbproto.tex). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2251 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Migrating to new directory structure adopted from the RealVNC's source tree. ↵Constantin Kaplinsky2006-05-251-0/+97
More changes will follow. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@589 3789f03b-4d11-0410-bbf8-ca57d06f2519