klemens
0536d0975b
spelling fixes
7 years ago
Pierre Ossman
1391fc4bd5
Crop cursor before calling maskRect()
We can no longer assume maskRect() will tolerate uncropped data.
7 years ago
Pierre Ossman
99871831d0
Restore cropping API to maskRect()
We need to restore the previous, more complex API in order to
easily handle masks now that we no longer accept out-of-bounds
operations.
7 years ago
Pierre Ossman
d5ab3e376f
Prevent invalid PixelBuffer accesses
There has been multiple attempts at tricking decoders to exceed
the boundaries of the active pixel buffer. Add extra checks to
prevent such invalid access.
7 years ago
Pierre Ossman
466de9c52e
Check invalid RRE rects
7 years ago
Michal Srb
18c020124f
Fix buffer overflow in ModifiablePixelBuffer::fillRect.
It can be triggered by RRE message with subrectangle out of framebuffer
boundaries. It may prevent the same kind of issue caused by evil message
from another encoding too.
7 years ago
Pierre Ossman
05338bccb7
Log statistics from ComparingUpdateTracker
7 years ago
Josef Gajdusek
2a4734c66f
hextileDecode.h: Fix buffer overflow
The hextileDecodexx functions do not properly check for out-of-bounds writes,
which allows a malicious server to overwrite parts of the stack.
7 years ago
Pierre Ossman
574dc64dfe
Move getSockets() to SocketServer interface
Any caller using add or remove should also be able to list the
sockets.
7 years ago
Pierre Ossman
1349e42e39
Fix temporary decoder buffer sizes
Some of these were excessively large because of redundant factors
in the size calculation.
7 years ago
Brian P. Hinz
5d663058f0
Fix minor typo in framebuffer initialization
7 years ago
Pierre Ossman
8aa4bc5320
Proper global init/deinit of GnuTLS
These are reference counted so it is important to retain symmetry
between the calls. Failure to do so will result in bad memory access
and crashes.
7 years ago
Pierre Ossman
7caaea1040
Fix display/port switch at display 100
168b92c
broke the handling that assumes display 100 and above are
actually a port number.
8 years ago
Pierre Ossman
338e73aef8
Replace Windows specific thread handling
Use the platform independent primitives instead.
8 years ago
Pierre Ossman
168b92c71d
Clean up getHostAndPort()
It now does more validation, and handles unescaped IPv6 addresses
better.
8 years ago
Pierre Ossman
88903f2205
Split Xregion headers according to upstream
We've stolen the Xregion code from libX11, so let's keep the same
header naming so that it is easier to keep things in sync.
8 years ago
Michal Srb
2a2a7bb577
Fix mistake in TightEncoder::setCompressLevel.
8 years ago
Pierre Ossman
352d062e98
Flush socket before checking buffer
There might be stuff lingering in the buffer simply because flush()
hasn't been called in a while, rather than because the transport is
congested.
8 years ago
Pierre Ossman
a40ab204bd
Asynchronously retry update on congestion
We now get notifications when the output buffer empties, and we
already caught incoming RTT pongs, meaning we can now react at the
proper time to retry a congested update rather than use a timer.
8 years ago
Pierre Ossman
3529468b8c
Flush socket after ever rect
This makes sure we keep the socket busy even if one rect takes some
time to encode.
8 years ago
Pierre Ossman
d408ca5146
Move socket write event handling in to the RFB core
What to do when a socket is writeable should be handled in the
RFB core code as there may be other events we want to fire off
when this happens.
8 years ago
Henrik Andersson
c1cbc705c2
Early propagate of access rights to connection.
8 years ago
Pierre Ossman
8e751955b6
Add workaround for Vino's VeNCrypt implementation
8 years ago
Pierre Ossman
1f8aba3147
Add workaround for Vino's VeNCrypt implementation
8 years ago
Pierre Ossman
2b8aa35468
Optimised shortcut for decoding on single CPU systems
8 years ago
Pierre Ossman
a0eb1e8af9
Limit the number of decoder threads to 4
They just end up burning CPU fighting each other without much
improvement to the decoding time beyond four threads.
8 years ago
Pierre Ossman
0560465250
Propagate exceptions from worker threads back to main thread
8 years ago
Pierre Ossman
7b63a7cef5
Create one decode thread for each CPU
We can start creating more decoding threads now that we handle
rect ordering properly. No point in creating more threads than
there are CPUs though.
8 years ago
Pierre Ossman
bf431a6b98
Allow parallel decoding of Tight JPEG rects
The cost is some more load on malloc(), but it should be small
compared to the gains of spreading the CPU heavy JPEG decoding
over multiple CPUs.
8 years ago
Pierre Ossman
e6ad445623
Allow conditional dependencies between rects when decoding
Some encodings only cause dependencies between rects some of the
time. Make sure we can allow parallel decoding of those rect that
aren't dependent on each other.
8 years ago
Pierre Ossman
a862add9b5
Decode rectangles in order if needed
Some encodings must be handled in the order they are received.
Make sure we respect this in the decode manager.
8 years ago
Pierre Ossman
1412789e12
Decode overlapping rectangles in order
8 years ago
Pierre Ossman
570cd5c478
Add flags member to decoders
Allows us to add attributes later that affect of the decoder
manager deals with the decoders.
8 years ago
Pierre Ossman
504afa27c1
Make the decoder multi-threaded
This implements the basic infrastructure for multi-threaded
decoding of rects. However there is just one thread reading data
and one thread decoding it. More logic is needed to safely decode
multiple rects at the same time.
8 years ago
Pierre Ossman
3da238dee8
Let CConnection intercept more callbacks
We need more callbacks for correct operation of multi-threaded
rect decoding.
8 years ago
Pierre Ossman
7d6bf11583
Fix copy-paste error for the secTypeX509Vnc security type
8 years ago
Pierre Ossman
6f318e4451
Clear up ZlibInStream::reset() behaviour
It previously only did a reset of the ZlibInStream object, not the
underlying zlib stream. It also had the side effect of flushing
the underlying stream and disassociating from it.
Clear things up by changing the naming, and introducing a proper
reset function (which is needed by the Tight decoder).
8 years ago
Pierre Ossman
80b4209b54
Split decoders into a read and decode step
We need to split these steps up in preparation for multi-core
support. Reading needs to be done in a serial manner, whilst
decoding can be done in parallel.
This also involved a rather large cleanup of the Tight decoder.
8 years ago
Pierre Ossman
7bfb73b612
Remove CMsgReader::getImageBuf() as nothing uses it
8 years ago
Pierre Ossman
8635062c07
Decouple decoders from CConnection
8 years ago
Pierre Ossman
f22d350e75
Make ConnParams useful when const
8 years ago
Pierre Ossman
9f273e9cd8
Delegate decoder object management to a separate class
Done in preparation for multi-core decoding. Keeps the complexity
out of the other classes. This also moves ownership of the
framebuffer in to CConnection. It's the CConnection object that is
aware of the threads and how to synchronise with them. Therefore
the ownership of the framebuffer must also be there to make sure
it isn't deleted whilst threads are working.
8 years ago
Pierre Ossman
0068a4f5fa
Clean out unused dependencies from CConnection.h
8 years ago
Pierre Ossman
7835815c1c
Remove old Windows CE code
8 years ago
Pierre Ossman
9c181baf3c
Use mingw's gettimeofday()
mingw has a perfectly functional gettimeofday() so use that instead
of having multiple copies of our own version.
8 years ago
Pierre Ossman
07eec1b59b
Remove unused deleteReaderAndWriter() method
8 years ago
Pierre Ossman
1e61325dea
Flush entire JPEG buffer, ignoring state
libjpeg doesn't update the buffer state before calling the
empty_output_buffer() callback so we need to flush everything,
not just the apparent size.
8 years ago
Pierre Ossman
158e69d735
Don't shadow member variable
8 years ago
Pierre Ossman
e539cb857f
Track statistics for CopyRect
8 years ago
Pierre Ossman
9a153b0a7a
Add keyboard debug log to servers
Makes it easier to troubleshoot keyboard issues by printing exactly
what key events the server is getting from the client.
8 years ago