aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Pixel" type in to PixelFormat headerPierre Ossman2023-02-184-29/+3
| | | | | It's a type specific to that class, so let's keep them close for clarity.
* Use operator overloading for comparisonPierre Ossman2023-02-0416-25/+38
| | | | | It is much more natural than custom methods for this very common operation.
* Warn if Point/Rect/Region methods are used wrongPierre Ossman2023-02-042-9/+24
| | | | | | It is easy to get confused if these methods modify the existing object, or return a new one. So let's mark the return value as critical so the compiler can help out if someone gets it wrong.
* Remove unneeded header from SDesktop.hPierre Ossman2023-02-043-3/+2
| | | | It doesn't use any exceptions, so stop including the header for it.
* Remove unused rfb/util.h includesPierre Ossman2023-02-0421-10/+13
| | | | | | | | 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.
* Remove "str" prefix from string helpersPierre Ossman2023-02-047-56/+55
| | | | | This matches the naming in STL, which is what we are mostly mimicing now that we are using std::string for these functions.
* Use standard C string functionsPierre Ossman2023-02-042-34/+0
| | | | It's just confusing that we have our own variety that isn't compatible.
* Remove custom CharArray typePierre Ossman2023-02-044-47/+4
| | | | | It has now been replaced, mostly by std::string, so remove the actual type definition.
* Use std::string for string memory managementPierre Ossman2023-02-0413-77/+50
| | | | | Avoids a bit of complexity by delegating that handling to a string object.
* Use std::string instead of CharArrayPierre Ossman2023-02-0422-170/+195
| | | | | Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
* Use std::vector for temporary char arraysPierre Ossman2023-02-043-20/+18
| | | | | | | | 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.
* Make strSplit() simpler and saferPierre Ossman2023-02-045-70/+49
| | | | | | | Get rid of all the magical re-allocation and shuffling and instead just return a new set of strings that is fully splitted. Will consume a bit more memory, but is a lot safer to use as there is less confusion about ownership of memory.
* Return std::string instead of dynamic allocationsPierre Ossman2023-02-0422-281/+225
| | | | | | 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.
* Specify expected array size in argumentsPierre Ossman2023-02-042-4/+4
| | | | | The compiler doesn't enforce this, but it at least documents the expected array size.
* Use fixed size character bufferPierre Ossman2023-02-046-52/+43
| | | | | We know the needed space here, so let's keep it simple with a constant size string buffer.
* Remove trailing slash from getvnchomedir()Pierre Ossman2023-02-041-3/+3
| | | | | It should return a path to the directory itself, just like its sister function getuserhomedir().
* Namespace directory functionsPierre Ossman2023-02-041-2/+2
| | | | All library functions should be in a proper namespace.
* Return static char buffer from some methodsPierre Ossman2023-02-043-18/+12
| | | | | | | | | This mimics how some system functions (like inet_ntop()) work, and avoids complexity around ownership of the returned string buffer. The downside is that the string must be consumed directly as it will be overwritten on the next call, but that is not an issue with the current usage.
* Remove unneded string duplicationPierre Ossman2023-02-041-8/+1
| | | | | It's unclear why this was initially added. The function takes string constants, so it is not going to modify these.
* Use StringParameters directlyPierre Ossman2023-02-0410-34/+11
| | | | | We don't need to make extra copies of the string in most cases, so let's simplify the code and access the string directly when we can.
* Get rid of TCHAR magicPierre Ossman2023-02-041-4/+3
| | | | | We never use Windows' "UNICODE" mode anyway, so let's get rid of this complexity.
* Return std::vector instead of dynamic allocationPierre Ossman2023-02-045-21/+23
| | | | | This makes memory management more clear and robust when using these helper functions.
* Avoid duplicating configuration settingPierre Ossman2023-02-041-16/+7
| | | | | Let the string helpers call the more fancy setParam(). This makes sure we can avoid duplicating things.
* Make sure length is reset on assignmentPierre Ossman2023-02-041-1/+3
| | | | | Otherwise the old length is preserved, which will result in NULL pointer dereferencing if the parameter is ever accessed.
* Clean up BinaryParameter typingPierre Ossman2023-02-043-16/+21
| | | | | This is explicitly a byte sequence, so let's try to keep a consistent typing.
* Move hex conversion helpers to utilPierre Ossman2023-02-043-5/+94
| | | | | These are used here and there so let's make them more general rather than hiding them in the stream classes.
* Use std::vector for basic data arraysPierre Ossman2023-02-019-111/+119
| | | | | Avoid our own custom types in favour of what's already included with C++.
* Use stdint typesPierre Ossman2023-02-0193-839/+858
| | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* Use templates for optimized codePierre Ossman2023-02-0131-2062/+1582
| | | | | Avoid preprocessor magic and instead rely on templating to generate optimized functions for performance critical code.
* Fix CRLF line endingsPierre Ossman2023-01-174-398/+398
| | | | Everything else uses LF line endings, so fix up the few stray ones.
* Use __attribute__:s directlyPierre Ossman2023-01-054-24/+15
| | | | | | These are supported by gcc and clang, and I don't think MSVC works well with our code anyway, so let's keep things simple and use these directly.
* Protect key variables from setjmp()Pierre Ossman2023-01-052-10/+13
| | | | | If we don't mark these as volatile then they might get reset on longjmp() and the code will misbehave.
* Remove useless const specifiersPierre Ossman2023-01-052-4/+4
| | | | | These are just values, so setting const on them has no effect as the caller will get a copy.
* Explicitly mark switch case fall throughPierre Ossman2023-01-053-0/+8
| | | | | This allows us to separate accidental fall through from explicit ones, which allows us to turn on such checks in the compiler.
* Fix RSA-AES state machinesPierre Ossman2023-01-052-48/+44
| | | | | | | | | | If there isn't enough data, then the client reading the hash will fall down and try to read the subtype instead, which isn't correct. Invert the logic so we get a more consistent way through where we only break out when there is insufficient data. Do the same for the server code, for consistency.
* Explicitly mark unused parametersPierre Ossman2023-01-0430-77/+94
| | | | | This allows us to separate accidentally unused, from explicitly unused parameters, which allows us to turn on such checks in the compiler.
* Don't include palette to full color methodsPierre Ossman2023-01-044-9/+7
| | | | They have no need for it, so let's simplify things.
* Remove unused flags to decoder contextsPierre Ossman2023-01-046-6/+13
| | | | Everything in flags is already handled at a higher level.
* Stop supplying flags to clipboard peek handlerPierre Ossman2023-01-0410-10/+10
| | | | The flags should always be empty anyway.
* Mark system include paths correctlyPierre Ossman2023-01-041-5/+5
| | | | | This makes sure the compiler doesn't complain about problems in those files.
* Add client-side support for the MSLogonII security type.Dinglan Peng2022-12-276-26/+232
|
* Add client-side support for the DH security type.Dinglan Peng2022-12-276-3/+210
|
* Flush decoder errors on close()Pierre Ossman2022-11-071-0/+10
| | | | | | We don't want any stray exceptions as we are cleaning up, so handle any still pending decoder errors by just logging them. We are already shutting down so there is no need to abort the connection here.
* Don't enable RSA-AES by default in serversPierre Ossman2022-10-141-3/+0
| | | | | | These require a key to have been set up on the server beforehand, so they do not give a good default experience as clients will be unable to connect.
* Ignore whitespace around components of host-and-port specificationCatherine Tower2022-09-011-2/+22
| | | | This is to make the code more tolerant of typos when entering a hostname
* Fix incorrect nettle library referencesPierre Ossman2022-09-011-1/+4
|
* Add support for RSA-AES security typespdlan2022-09-0112-13/+1316
|
* Move include_directories() to proper placesPierre Ossman2022-08-251-1/+5
| | | | We should scope these as narrowely as possible to avoid side effects.
* Remove unused CSecurity::description()Pierre Ossman2022-08-2510-25/+3
|
* Safely discard large (extended) clipboard contentsPierre Ossman2022-06-282-8/+40
| | | | | | | | | 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.