Pierre Ossman
94d6a693ea
Don't allow surrugate code points in UTF-8
These are not valid outside of UTF-16 so seeing them in a UTF-8 sequence
means that something is wrong with that sequence. Best to filter them
out rather than letting them propagate and have unknown effects.
1 år sedan
Pierre Ossman
c061a78dc1
Clean up string encoding handling
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.
1 år sedan
Pierre Ossman
fd243a8d3a
Remove "str" prefix from string helpers
This matches the naming in STL, which is what we are mostly mimicing now
that we are using std::string for these functions.
1 år sedan
Pierre Ossman
3143bfa154
Use standard C string functions
It's just confusing that we have our own variety that isn't compatible.
1 år sedan
Pierre Ossman
4293dc42f6
Remove custom CharArray type
It has now been replaced, mostly by std::string, so remove the actual
type definition.
1 år sedan
Pierre Ossman
b99daadb05
Use std::string instead of CharArray
Let's use a more common type instead of something homegrown. Should be
more familiar to new developers.
1 år sedan
Pierre Ossman
19badc4def
Make strSplit() simpler and safer
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.
1 år sedan
Pierre Ossman
337dbc3922
Return std::string instead of dynamic allocations
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.
1 år sedan
Pierre Ossman
dde95fccca
Specify expected array size in arguments
The compiler doesn't enforce this, but it at least documents the
expected array size.
1 år sedan
Pierre Ossman
2047dae22f
Return std::vector instead of dynamic allocation
This makes memory management more clear and robust when using these
helper functions.
1 år sedan
Pierre Ossman
07e541678c
Move hex conversion helpers to util
These are used here and there so let's make them more general rather
than hiding them in the stream classes.
1 år sedan
Pierre Ossman
9886e94d9b
Correctly clear out output UTF-16 buffer
Each character is more than one byte, so adjust the clearing of the
buffer to reflect that.
3 år sedan
Pierre Ossman
703eb4d130
Correctly handle invalid UTF-16 code points
Some code points are reserved for the UTF-16 coding itself and must not
appear as input data to the algorithm.
3 år sedan
Pierre Ossman
d163da9ac8
Fix conversion of latin-1 to UTF-8
Signed bug prevented anything not ASCII from being coded correctly.
3 år sedan
Pierre Ossman
6345c0f60f
Fix UTF-16 encoding/decoding of high code points
Everything outside of BMP was handled incorrectly and was coded as
completely different code points.
3 år sedan
Pierre Ossman
e61ff736c1
Return the correct number of consumed UTF-8 bytes
This would mess up most conversions from UTF-8 as the caller wouldn't
know how far to step to get to the next valid character, resulting in
markers for invalid data to be injected here and there.
Also add some unit tests to avoid this reoccurring.
3 år sedan
Pierre Ossman
02f87f37dd
Fix length checks in string conversion functions
We need to check the buffer length before accessing the incoming
string. Probably not a problem in practice as there should be a
final null in most incoming strings.
Issue found by Pavel Cheremushkin from Kaspersky Lab.
4 år sedan
Benoit Gschwind
ff2c39e270
fix test order in convertLF and convertCRLF
The new order of test avoid ready invalid memory address in ca.buf
4 år sedan
Pierre Ossman
5fbbe10b6c
Use UTF-8 in clipboard API
In prepartion for better clipboard extensions that can send Unicode
data between the client and server.
5 år sedan
Pierre Ossman
56fa782156
Add UTF-8 to/from ISO 8859-1 conversion routines
We convert between UTF-8 and ISO 8859-1 (latin 1) in several places
so create some common routines for this.
8 år sedan
Pierre Ossman
546b2ad80a
Make sure clipboard uses \n line endings
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.
5 år sedan
Pierre Ossman
4ae358d561
Remove no longer relevant license comment
8 år sedan
Pierre Ossman
a99d14d193
Improved congestion control handling
Refine the previous method by interpolating the values we need.
This reduces the effect of the problem that we cannot send enough
ping packets.
8 år sedan
Steve Kondik
b3c9f7ba52
rfb: vsnprintf returns an int, not size_t
Fixes:
/home/shade/dev/tigervnc/common/rfb/util.cxx:55:13: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
if (len < 0) {
~~~ ^ ~
1 error generated.
7 år sedan
Pierre Ossman
921f6c86ba
Display performance statistics in viewer
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.
7 år sedan
Pierre Ossman
ba6fbfe368
Give CharArray a printf style method to ease automatic allocation
9 år sedan
Pierre Ossman
64624342d9
Shorten stats from EncodeManager using SI/IEC prefixes
Also avoids %lld which isn't supported on Windows.
9 år sedan
Pierre Ossman
5ad4d06006
Remove a lot of platform compatibilty stuff
It's either not used, or no longer relevant.
10 år sedan
Pierre Ossman
5bc20a6993
Add helper to easily determine how much time has passed since some previous
event.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4783 3789f03b-4d11-0410-bbf8-ca57d06f2519
12 år sedan
Adam Tkac
8aee1a8c9d
- use unix/configure.ac as top-level configure.ac base
- 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
15 år sedan
Adam Tkac
d36b626bbb
Revert previous commit (r3889). Windows code has to be cleaned before this
change.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3890 3789f03b-4d11-0410-bbf8-ca57d06f2519
15 år sedan
Adam Tkac
97abe8a548
Replace rfb::strDup by safe_strdup and remove rfb::strFree in favor of free()
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3889 3789f03b-4d11-0410-bbf8-ca57d06f2519
15 år sedan
Adam Tkac
3a54922143
[Bugfix] Fixed typo in rfb/util.cxx (caused in r2890)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2916 3789f03b-4d11-0410-bbf8-ca57d06f2519
15 år sedan
Adam Tkac
ad1cbd968f
[Cleanup] Handle system dependent defines through autoheader & common-config.h
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2890 3789f03b-4d11-0410-bbf8-ca57d06f2519
15 år sedan
Constantin Kaplinsky
a2adc8d4cf
Migrating to new directory structure adopted from the RealVNC's source tree. More changes will follow.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@589 3789f03b-4d11-0410-bbf8-ca57d06f2519
18 år sedan
Constantin Kaplinsky
de179d4ed7
The "rfb" library merged with VNC 4.1.1 code.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/merge-with-vnc-4.1.1@522 3789f03b-4d11-0410-bbf8-ca57d06f2519
18 år sedan
Constantin Kaplinsky
a686690d07
Porting changes for LynxOS 2.3.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@499 3789f03b-4d11-0410-bbf8-ca57d06f2519
18 år sedan
Constantin Kaplinsky
47ed8d321c
Initial revision
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2 3789f03b-4d11-0410-bbf8-ca57d06f2519
20 år sedan