aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/ZlibOutStream.cxx
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.
* Use BufferedOutStream in more streamsPierre Ossman2022-08-251-54/+19
| | | | | | Avoid duplicating all the memory mangement, and instead use the BufferedOutStream as a base clase for all out streams that need an intermediate buffer.
* Properly restore cork state when changedPierre Ossman2022-06-281-1/+7
| | | | | | | | | | | | These streams both need to change the corking state temporarily, but it is important it is restored to the previous state or things might get messed up. For the zlib stream it would just leave things uncorked, which still works but is less efficient. But for the TLS stream it might make things very unresponsive as the corking might be left on permanently, delaying packets indefinitely.
* Be consistent in including config.hPierre Ossman2021-12-301-0/+4
| | | | | | 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.
* Make direct stream API a bit saferPierre Ossman2020-05-211-4/+4
| | | | | Provide some safety checks when directly accessing the underlying pointer of streams.
* Generalise corking to all output streamsPierre Ossman2020-05-211-21/+23
| | | | | The principle can be used in a more general fashion than just TCP streams.
* Remove unused bufSize argument from streamsPierre Ossman2020-05-211-2/+2
|
* Simplify stream availability handlingPierre Ossman2020-05-211-11/+4
| | | | | Just have a simply number of bytes argument to avoid a lot of complexity.
* Add stream avail() methodsPierre Ossman2020-05-211-3/+3
| | | | | Makes it more readable to write code that needs to know how much data/space is available in a stream.
* Fix error check for zlib callsPierre Ossman2020-02-271-2/+2
| | | | | There are multiple "okay" return values, not just Z_OK. Make sure we don't bail out needlessly.
* Be defensive about overflows in stream objectsPierre Ossman2019-11-151-2/+4
| | | | | | | | | | | | 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-5/+5
| | | | | | | | 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.
* Do proper logging rather than fprintf(stderr, ...)Pierre Ossman2019-04-291-8/+11
|
* Remove a lot of platform compatibilty stuffPierre Ossman2014-07-071-1/+2
| | | | It's either not used, or no longer relevant.
* Another attempt at solving the compression level change problems. We were stillPierre Ossman2011-10-181-62/+74
| | | | | | | not detecting the correct approach properly, and hence still getting crashes. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4731 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Merge further fixes to Zlib encoder from 1.1 branchDRC2011-08-091-6/+26
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4623 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Revert r4498 and fix #3305357 properly. The issue was two-fold: (1) the ↵DRC2011-08-091-9/+12
| | | | | | compress buffer allocated by the Tight encoder was not large enough, and (2) Zlib 1.2.5 can sometimes call deflate(..., Z_BLOCK) within the body of deflateParams(), so we need to check avail_in after calling checkCompressionLevel() to ensure that there is still data left to compress before we call deflate() again. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4617 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Fix 3305357 (Enabling custom compression level on client crashes server)DRC2011-06-181-6/+8
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4508 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Refactoring] Improved rdr::Exception constructor. It now accepts variableAdam Tkac2008-11-141-0/+2
| | | | | | | | | number of arguments. [Bugfix] Minor compilation fixes (missing #includes) git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3168 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Migrating to new directory structure adopted from the RealVNC's source tree. ↵Constantin Kaplinsky2006-05-251-0/+161
More changes will follow. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@589 3789f03b-4d11-0410-bbf8-ca57d06f2519