aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/util.h
Commit message (Collapse)AuthorAgeFilesLines
* Stop treating "0" as "no timeouts"Pierre Ossman2024-06-191-7/+0
| | | | | It is much more sane to treat "0" as "a timer is ready NOW", so let's change to using -1 as the invalid timeout value.
* Clean up string encoding handlingPierre Ossman2023-06-301-0/+3
| | | | | | We should handle this in the low-level protocol code as much as possible to avoid mistakes. This way the rest of the code can assume that strings are always UTF-8 with \n line endings.
* Remove "str" prefix from string helpersPierre Ossman2023-02-041-3/+3
| | | | | 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-041-9/+0
| | | | It's just confusing that we have our own variety that isn't compatible.
* Remove custom CharArray typePierre Ossman2023-02-041-24/+0
| | | | | It has now been replaced, mostly by std::string, so remove the actual type definition.
* Use std::string instead of CharArrayPierre Ossman2023-02-041-1/+5
| | | | | Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
* Make strSplit() simpler and saferPierre Ossman2023-02-041-8/+3
| | | | | | | 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-041-14/+13
| | | | | | 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-041-2/+2
| | | | | The compiler doesn't enforce this, but it at least documents the expected array size.
* Return std::vector instead of dynamic allocationPierre Ossman2023-02-041-1/+3
| | | | | This makes memory management more clear and robust when using these helper functions.
* Move hex conversion helpers to utilPierre Ossman2023-02-041-1/+9
| | | | | These are used here and there so let's make them more general rather than hiding them in the stream classes.
* 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-4/+0
| | | | | This allows us to separate accidentally unused, from explicitly unused parameters, which allows us to turn on such checks in the compiler.
* Be consistent in including config.hPierre Ossman2021-12-301-4/+0
| | | | | | 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.
* CharArray: pre-fill empty array with zeroesJan Grulich2021-06-071-0/+1
| | | | | | | | CharArray should always be null-terminated. There is a potential scenario where this all might lead to crash. In Password we call memset(), passing length of the array we get with strlen(), but this won't return correct value when the array is not properly null-terminated.
* Use size_t for lengths in stream objectsPierre Ossman2019-11-151-1/+1
| | | | | | | | 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.
* Use UTF-8 in clipboard APIPierre Ossman2019-07-011-0/+8
| | | | | In prepartion for better clipboard extensions that can send Unicode data between the client and server.
* Add UTF-8 to/from ISO 8859-1 conversion routinesPierre Ossman2019-07-011-0/+9
| | | | | We convert between UTF-8 and ISO 8859-1 (latin 1) in several places so create some common routines for this.
* Make sure clipboard uses \n line endingsPierre Ossman2019-07-011-0/+4
| | | | | | 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.
* Avoid potential crash when replacing buffer in PlainPasswdJan Grulich2018-10-031-1/+1
|
* Merge branch 'congestion' of https://github.com/CendioOssman/tigervncPierre Ossman2018-02-261-0/+8
|\
| * Improved congestion control handlingPierre Ossman2017-11-171-0/+8
| | | | | | | | | | | | Refine the previous method by interpolating the values we need. This reduces the effect of the problem that we cannot send enough ping packets.
* | rfb: Avoid unused argument warnings in headersSteve Kondik2017-09-151-0/+4
|/ | | | | Don't force users of these headers to squash compiler warnings about unused arguments, annotate with __unused_attr.
* Display performance statistics in viewerPierre Ossman2017-02-241-2/+2
| | | | | | Adds an optional graph to the viewer to display current frame rate, pixel rate and network bandwidth. Makes it easier to debug and test performance related issues.
* Give CharArray a printf style method to ease automatic allocationPierre Ossman2015-03-031-0/+7
|
* Shorten stats from EncodeManager using SI/IEC prefixesPierre Ossman2015-03-031-0/+5
| | | | Also avoids %lld which isn't supported on Windows.
* Remove a lot of platform compatibilty stuffPierre Ossman2014-07-071-13/+0
| | | | It's either not used, or no longer relevant.
* Add helper to easily determine how much time has passed since some previousPierre Ossman2011-11-081-0/+5
| | | | | | | event. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4783 3789f03b-4d11-0410-bbf8-ca57d06f2519
* - use unix/configure.ac as top-level configure.ac baseAdam Tkac2009-09-041-2/+2
| | | | | | | | - create stub top-level Makefile.am - make common/ subtree compilable git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/unified_buildsys@3892 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Revert previous commit (r3889). Windows code has to be cleaned before thisAdam Tkac2009-09-041-2/+3
| | | | | | | change. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3890 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Replace rfb::strDup by safe_strdup and remove rfb::strFree in favor of free()Adam Tkac2009-09-041-3/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3889 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Cleanup] Handle system dependent defines through autoheader & common-config.hAdam Tkac2008-10-061-0/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2890 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Migrating to new directory structure adopted from the RealVNC's source tree. ↵Constantin Kaplinsky2006-05-251-0/+111
More changes will follow. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@589 3789f03b-4d11-0410-bbf8-ca57d06f2519