| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | | |
Just have a simply number of bytes argument to avoid a lot of
complexity.
|
| | |
| | |
| | |
| | |
| | | |
Most streams are backed by a memory buffer. Create common base classes
for this functionality to avoid code duplication.
|
| | |
| | |
| | |
| | |
| | | |
Makes it more readable to write code that needs to know how much
data/space is available in a stream.
|
| | |
| | |
| | |
| | |
| | | |
It might leak data depending on what's in the buffer. Use pad() instead
where blank space is needed.
|
| | |
| | |
| | |
| | |
| | | |
They were accidentally left unused in fbad8a9 so they haven't been used
in some time.
|
| | |
| | |
| | |
| | | |
We need to be able to tell this exception came from a decoder.
|
| | |
| | |
| | |
| | | |
For readability.
|
| | |
| | |
| | |
| | |
| | | |
There might be some final handshake data that is still stuck in the
buffers, so make a best effort attempt at getting it to the client.
|
| | |
| | |
| | |
| | |
| | | |
The socket is closed at this point so we have to rely on a cached
value for the logging.
|
| | |
| | |
| | |
| | |
| | | |
It's a generic feature that is better handled as part of SConnection's
state machine.
|
| | |
| | |
| | |
| | |
| | |
| | | |
We can't safely use the normal timers in base classes as we cannot
guarantee that subclasses will call the base class' handleTimeout()
properly if the subclass overrides it.
|
| |/
|/|
| |
| |
| |
| | |
We computed a safe area if a client gave us a bogus one, but we didn't
actually use it. Fix this properly and make sure we don't pass on bad
coordinates further.
|
| |
| |
| |
| |
| | |
Each character is more than one byte, so adjust the clearing of the
buffer to reflect that.
|
| |
| |
| |
| |
| | |
Some code points are reserved for the UTF-16 coding itself and must not
appear as input data to the algorithm.
|
| |
| |
| |
| | |
Signed bug prevented anything not ASCII from being coded correctly.
|
| |
| |
| |
| |
| | |
Everything outside of BMP was handled incorrectly and was coded as
completely different code points.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous method stored the certificates as authorities, meaning that
the owner of that certificate could impersonate any server it wanted
after a client had added an exception.
Handle this more properly by only storing exceptions for specific
hostname/certificate combinations, the same way browsers or SSH does
things.
|
| |
| |
| |
| |
| | |
It should be using the safe wrappers for everything so make sure it
cannot bypass those and call the SConnection methods directly.
|
| |
| |
| |
| |
| |
| |
| | |
We incorrectly called the underlying functions instead of the safe
wrappers for the new clipboard functions. This had the effect of a)
crashing the entire server if one of these functions failed, and b) not
respecting the settings disabling the clipboard.
|
|\ \
| | |
| | |
| | | |
https://github.com/MarkMielke/tigervnc
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
64x64 changed block can be large for fine changes such as cursor
movement and typing in terminal windows, or an update to a clock.
If the block can be efficiently cropped, this will reduce latency
and bandwidth. Every pixel cropped is a pixel less to analyze, encode,
transmit, and decode.
The previous code already detected the top of the change in order
to determine if the block had changed. However, it did not use
this information to reduce the size of the change rectangle, nor
did it calculate any of the other edges.
The new code introduces detection of the other edges, and uses
the information to build a reduced area change rectangle. This
has the additional effect of reducing the number of discrete pixel
values in the change block which may allow a more efficient
encoding algorithm to be selected.
As this section of code is performance sensitive, the method
of detecting the edges has been optimized to quickly fall back
to pessimistic values as soon as a single comparison fails on
each edge. In the case that full 64x64 block are changing,
there will be three extra comparisons per block.
In cases where the change rectangle can be reduced from 64x64,
the reduced size of the change rectangle represents reduced
effort to encode, transfer, and decode the contained pixels.
In the case of images with high frequency changes, which
specifically includes text, the lossy JPEG encoding can be
highly distorted, especially with JPEG level 6 or less. The
quick flash from a distorted JPEG to a lossless JPEG can
appear as a flickering to some people. This effect was more
obvious when the surrounding area is not expected to change,
but is being distorted anyways due to being part of the 64x64
blocking algorithm.
In the case of a user typing in a terminal window, this change
may commonly reduce the number of pixels updated with every
character typed from 4096 pixels (64x64) to 640 pixels (32x20)
or less.
|
|/ /
| |
| |
| |
| | |
We handled this in the failure scenario, but not in the vastly more
common successful case.
|
|\ \ |
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If using SSecurityPlain and the user specifies an empty username
and password, it will invoke InStream::checkNoWait(0) which will
cause a division by zero when calculating the number of available
items.
Enhance InStream::check() to behave properly when asked for
zero items, or zero sized items.
Add comments to InStream::check(), InStream::checkNoWait(),
and InStream::readBytes() to document expected behaviour
when requested to check or read zero items, or an item with
zero size.
|
| |
| |
| |
| |
| |
| | |
Since 8e09912 this wasn't triggered properly as we checked if all
clients were gone before we actually removed the last client from our
list.
|
|\ \ |
|
| | |
| | |
| | |
| | | |
Might as well make these explicit so the cost is apparent.
|
| |/
| |
| |
| |
| | |
This is the current upstream so let's make use of it to get the latest
in features and fixes.
|
| | |
|
| |
| |
| |
| |
| | |
The method it overloads got tweaked some time ago, so we need to make
sure this method follows suit.
|
| |
| |
| |
| |
| | |
Sends response for SetDesktopSize as per the community wiki
specification
|
|/
|
|
|
| |
We'll just crash later if we try to use such a large screen, so reject
the request from the client instead and keep the server running.
|
|\ |
|
| |
| |
| |
| |
| | |
It is present on all UNIX systems anyway, so let's simplify things.
We will need it for more proper session startup anyway.
|
| | |
|
| | |
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Created a new subclass of Exception called GAIException() that will
handle error messages from getaddrinfo() instead of letting Exception()
handle it. GAIException() will make use of gai_strerror() to map the
error code to text. On Windows, gai_strerrorW() must be used if the text
is encoded with UTF-8.
|
| | |
|
| |
| |
| |
| |
| |
| | |
The previous error messages did not support Unicode characters. This
commit will use UTF-8 encoding to be able to display error messages in
every language.
|
|/
|
|
|
| |
There are multiple "okay" return values, not just Z_OK. Make sure we
don't bail out needlessly.
|
|
|
|
|
|
| |
Modern MinGW seems to provide this, so simplify things a bit. This also
side steps some of the issue of the windows.h/winsock2.h include
ordering.
|
|
|
|
|
| |
Otherwise such clients cannot use Scroll Lock at all, and that is
probably worse than any effects we might get from getting out of sync.
|
|
|
|
| |
new throws an exception on allocation errors rather than return NULL.
|
|
|
|
|
| |
This check is completely backwards and it is currently unknown how
this ever worked.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Our fast paths assume that each channel fits in to a separate byte.
That means the shift needs to be a multiple of 8. Start actually
checking this so that a client cannot trip us up and possibly cause
incorrect code exection.
Issue found by Pavel Cheremushkin from Kaspersky Lab.
|