aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/InStream.h
Commit message (Collapse)AuthorAgeFilesLines
* Use nullptr in all C++ codePierre Ossman2024-06-241-6/+6
| | | | | It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
* Consistently use uint8_t for data buffersPierre Ossman2023-03-181-1/+1
| | | | | These will always be byte streams at heart, so let's try to keep them with a proper type. Should make it clearer how they will be used.
* Use stdint typesPierre Ossman2023-02-011-22/+30
| | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* Fix stream check for InStream::getptr()Pierre Ossman2022-08-251-3/+0
| | | | | This call should have been preceeded by hasData() or avail(), just like all other accessor functions.
* Enable stream sanity checks in debug buildsPierre Ossman2022-04-061-1/+3
| | | | | | Enable this automatically for developers so we increase the chance of these problems getting caught. There is a risk of overhead though so keep them disabled for release builds.
* Change streams to be asynchronousPierre Ossman2020-05-211-33/+104
| | | | | | | | | | 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).
* Remove readString()/writeString()Pierre Ossman2020-05-211-11/+0
| | | | | These are not universal in the protocol so having functions for them only obfuscates things.
* Make direct stream API a bit saferPierre Ossman2020-05-211-6/+8
| | | | | Provide some safety checks when directly accessing the underlying pointer of streams.
* Simplify stream availability handlingPierre Ossman2020-05-211-22/+14
| | | | | Just have a simply number of bytes argument to avoid a lot of complexity.
* Add stream avail() methodsPierre Ossman2020-05-211-2/+10
| | | | | Makes it more readable to write code that needs to know how much data/space is available in a stream.
* Be defensive about overflows in stream objectsPierre Ossman2019-11-151-11/+13
| | | | | | | | | | | | We use a lot of lengths given to us over the network, so be more paranoid about them causing an overflow as otherwise an attacker might trick us in to overwriting other memory. This primarily affects the client which often gets lengths from the server, but there are also some scenarios where the server might theoretically be vulnerable. Issue found by Pavel Cheremushkin from Kaspersky Lab.
* Use size_t for lengths in stream objectsPierre Ossman2019-11-151-8/+8
| | | | | | | | Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
* Remove unneeded virtual qualifiers on stream methodsPierre Ossman2015-11-271-1/+1
|
* Push encoding specific formats into the encoders and decodersPierre Ossman2014-07-071-23/+0
| | | | Keep the generic stream classes clean and general.
* Migrating to new directory structure adopted from the RealVNC's source tree. ↵Constantin Kaplinsky2006-05-251-0/+170
More changes will follow. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@589 3789f03b-4d11-0410-bbf8-ca57d06f2519