aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr
Commit message (Collapse)AuthorAgeFilesLines
* Send TLS alerts to peer on errorsPierre Ossman2025-06-181-2/+7
| | | | Better inform the peer why we are terminating the connection.
* Show TLS alerts in log and to userPierre Ossman2025-06-183-10/+42
| | | | | | If the peer decides to terminte the connection, then the reason will be sent as an alert rather than seen through the normal error code. Make sure we show this so it's easier to determine what went wrong.
* Propagate exceptions during TLS handshakePierre Ossman2025-06-181-0/+3
| | | | Just like we do for regular TLS communication.
* Let TLSSocket handle TLS handshakePierre Ossman2025-06-182-0/+19
| | | | More avoiding duplication and increasing encapsulation.
* Let TLSSocket handle TLS terminationPierre Ossman2025-06-182-0/+24
| | | | Let's avoid duplication and also raise the encapsulation a bit.
* Avoid static methods for TLSSocketPierre Ossman2025-06-182-27/+23
| | | | We can use lambdas as glue and let them be normal methods instead.
* Merge TLS I/O in common classPierre Ossman2025-06-187-173/+280
| | | | | | Input and output do not happen independently in TLS streams, so we need to have a coordinating central object for all I/O. E.g. a TLS read can result in a low level write.
* Always include InStream::checkedBytesPierre Ossman2025-06-181-7/+1
| | | | | The ABI for the class needs to be stable across modules, so we cannot have conditional class members like this.
* Use std::exception_ptr to store exceptionsPierre Ossman2025-03-134-36/+22
| | | | This is much more robust and flexible than what we came up with.
* Move winerrno.h to corePierre Ossman2025-02-253-3/+3
| | | | | OS abstractions are generic enough that we can merge these with the new core library.
* Rename core/util to core/stringPierre Ossman2025-02-255-5/+5
| | | | | It's just string helper functions here, so let's get rid of the catch-all name for this module.
* Get rid of __rfbmax()/__rfbmin()Pierre Ossman2025-02-251-5/+0
| | | | | | | | They weren't that well used, and were mostly just confusing special functions anyway. Allows us to move away from generic and ambigious headers such as "util".
* Move time utilities to separate filePierre Ossman2025-02-251-1/+1
| | | | Let's clear things up by categorizing our utility functions.
* Move logging to core libraryPierre Ossman2025-02-255-12/+10
| | | | | | | Make it clearer what is protocol handling and what is just general plumbing. This is one step of several.
* Move base exception classes to core libraryPierre Ossman2025-02-2512-243/+40
| | | | | | | Make it clearer what is protocol handling and what is just general plumbing. This is one step of several.
* Move utility functions to core libraryPierre Ossman2025-02-138-39/+44
| | | | | | | Make it clearer what is protocol handling and what is just general plumbing. This is one step of several.
* Also mark tls_error with noexceptPierre Ossman2024-11-262-2/+2
| | | | Overlooked this special exception in the previous commit.
* Mark all exception type methods as noexceptPierre Ossman2024-11-262-23/+25
| | | | | This is required for the built in exceptions, so let's do the same to avoid surprises.
* Don't save exceptions as std::exceptionPierre Ossman2024-11-262-6/+14
| | | | | | That type is not guaranteed to preserve anything useful at all. Instead, try to either preserve a more specific type, or use std::runtime_error which at least has a guaranteed message.
* Change some assertions to exceptionsPierre Ossman2024-11-222-3/+7
|
* Capitalize some more logging and exceptionsPierre Ossman2024-11-223-4/+4
|
* Merge branch 'master' of https://github.com/madnicendio/tigervncPierre Ossman2024-11-222-9/+9
|\
| * Capitalize first letter in log, exception & errorMadeleine Nilsson2024-11-212-9/+9
| | | | | | | | The reason for this is to keep a consistency through out the project.
* | Use standard library naming for exceptionsPierre Ossman2024-11-0611-49/+49
| | | | | | | | | | This makes things more consistent since we mix with the standard library exceptions so often.
* | Replace base exception class with standard libraryPierre Ossman2024-11-065-25/+56
| | | | | | | | | | There is no point to having our own generic exception class. Let's use the one provided by the standard C++ library.
* | Use standard exception classesPierre Ossman2024-11-068-33/+31
| | | | | | | | | | Use the more specific already included exception classes for common errors to keep things more understandable.
* | Subclass exceptions from std::exceptionPierre Ossman2024-11-067-24/+13
| | | | | | | | | | Make sure our exceptions are part of the standard exception class hierarchy.
* | Use what() to access exception descriptionPierre Ossman2024-11-063-5/+5
| | | | | | | | Harmonize with the standard C++ exceptions.
* | Don't modify exception description dynamicallyPierre Ossman2024-11-062-56/+56
| | | | | | | | | | In preparation for using the built-in exception types, where the string can only be set via the constructor.
* | Use static string for exceptionsPierre Ossman2024-11-065-18/+30
| | | | | | | | | | In preparation for using the built in C++ exception classes, which do not accept a format string.
* | Get Unicode Windows error stringsPierre Ossman2024-11-061-0/+9
|/ | | | | These seem to always be in ASCII and English, unfortunately, but let's at least use the API the could give use something more useful.
* Split SystemException to handle WindowsPierre Ossman2024-10-094-21/+38
| | | | | | | | | | | | | Windows has (at least) two error namespaces, both errno and GetLastResult(). These overlap, so it is important we keep track of which one we are dealing with. To make things extra problematic, the BSD socket API normally uses errno, but on Windows it has been mapped in to the GetLastResult() namespace. Try to keep better control of this by using separate classes for the namespaces.
* Consistently use SocketException for socket errorsPierre Ossman2024-10-094-8/+8
| | | | | | The behaviour is not consistent as Windows doesn't use errno for socket errors, but Unix systems do. Always use the same exception to keep things somewhat sane.
* Move SocketException to rdrPierre Ossman2024-10-091-0/+4
| | | | | | Socket APIs are used in more places than the abstraction in common/network. Make it easier to use this exception class by putting it in a more common place.
* Use std::min replace minKang Lin2024-07-263-9/+9
|
* Avoid shadowing variablesPierre Ossman2024-06-243-10/+10
| | | | | It's a source of confusion and possibly bugs to reuse the same variable name for multiple things.
* Mark overridden virtual functionsPierre Ossman2024-06-2416-30/+30
| | | | | Use the new "override" keyword to properly differentiate between new virtual methods, and existing virtual methods being overridden.
* Use nullptr in all C++ codePierre Ossman2024-06-2415-51/+53
| | | | | It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
* Merge branch 'types2' of https://github.com/CendioOssman/tigervncPierre Ossman2023-06-3010-12/+12
|\
| * Consistently use uint8_t for data buffersPierre Ossman2023-03-1810-12/+12
| | | | | | | | | | 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.
* | Emulate corking when TCP_CORK is missingPierre Ossman2023-06-281-1/+6
| | | | | | | | | | If we can't rely on the OS to handle corking for us, then we need to enable our own handling of it.
* | Prefer target_include_directories()Pierre Ossman2023-03-311-5/+4
| | | | | | | | | | It is more specific, and it properly sets up propagation when include directories also need to be used further down a dependency chain.
* | Add all common inter-dependenciesPierre Ossman2023-03-311-1/+1
|/ | | | | This is important in case there are build flags that need to propagate between libraries for things to build correctly.
* Avoid redefining errnoPierre Ossman2023-02-042-12/+12
| | | | | | This can have unexpected consequences as some code may rely on it being a simple variable. Instead to what we do in Socket, which is to define a unique name for getting socket error numbers.
* Get rid of TCHAR magicPierre Ossman2023-02-041-1/+0
| | | | | We never use Windows' "UNICODE" mode anyway, so let's get rid of this complexity.
* Move hex conversion helpers to utilPierre Ossman2023-02-044-78/+8
| | | | | 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-011-71/+0
| | | | | Avoid our own custom types in favour of what's already included with C++.
* Use stdint typesPierre Ossman2023-02-0123-117/+127
| | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* Use __attribute__:s directlyPierre Ossman2023-01-051-7/+2
| | | | | | 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.
* Explicitly mark unused parametersPierre Ossman2023-01-041-1/+1
| | | | | This allows us to separate accidentally unused, from explicitly unused parameters, which allows us to turn on such checks in the compiler.