| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Gives us a more meaningful error rather than just "Error in push/pull
function".
|
|
|
|
|
|
|
| |
Having this early check means that we somewhat randomly get different
exception behaviours on errors in deeper layers as some exceptions are
allowed to propagate unhindered and some are not (since they are thrown
in the pull function).
|
|
|
|
|
| |
Give GnuTLS the correct errno from deeper layers, in the cases where we
know it. In most cases GnuTLS doesn't care, but just in case...
|
|
|
|
|
| |
This reverts commit d6e39658ae105fca2cfe37ba736dbf0e8d8356af. Apparently
this is broken on macOS so it's not something we can make use of.
|
|
|
|
| |
TCP_CORK is a Linux thing and BSD has TCP_NOPUSH instead.
|
|
|
|
|
| |
We didn't include the proper headers to get the correct define, so
corking was never enabled.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Major restructuring of how streams work. Neither input nor output
streams are now blocking. This avoids stalling the rest of the client or
server when a peer is slow or unresponsive.
Note that this puts an extra burden on users of streams to make sure
they are allowed to do their work once the underlying transports are
ready (e.g. monitoring fds).
|
|
|
|
|
| |
These are not universal in the protocol so having functions for them
only obfuscates things.
|
|
|
|
|
|
| |
Now measures over an entire update, which should hopefully give us more
stable values. They are still small values for fast networks though so
increase precision in the values we keep.
|
|
|
|
|
| |
Provide some safety checks when directly accessing the underlying
pointer of streams.
|
| |
|
|
|
|
|
| |
External callers don't need to know the exact details, only if there is
data that needs to be flushed or not.
|
|
|
|
|
| |
This allows us to handle peaks in input and output streams gracefully
without having to block processing.
|
| |
|
|
|
|
|
| |
The principle can be used in a more general fashion than just TCP
streams.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We use a lot of lengths given to us over the network, so be more
paranoid about them causing an overflow as otherwise an attacker
might trick us in to overwriting other memory.
This primarily affects the client which often gets lengths from the
server, but there are also some scenarios where the server might
theoretically be vulnerable.
Issue found by Pavel Cheremushkin from Kaspersky Lab.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Move the checks around to avoid missing cases where we might access
memory that is no longer valid. Also avoid touching the underlying
stream implicitly (e.g. via the destructor) as it might also no
longer be valid.
A malicious server could theoretically use this for remote code
execution in the client.
Issue found by Pavel Cheremushkin from Kaspersky Lab
|
|/
|
|
|
|
| |
There might be more bytes left in the current TLS record, even if
there is nothing on the underlying stream. Make sure we properly
return this when we aren't being requested to block.
|
| |
|
| |
|
|
|
|
|
| |
Applets don't work anymore so remove everything that has to do
with serving them.
|
| |
|
|
|
|
| |
We already assume sockets here since we use select().
|
| |
|
| |
|
|
|
|
|
| |
Include the type of exception in the string generated by each
subclass. Also simplify the constructs to what is needed.
|
|
|
|
|
|
|
|
|
| |
fread() returns size_t, which is unsigned. Don't check
for negative values to avoid warnings from Clang.
/home/shade/dev/tigervnc/common/rdr/FileInStream.cxx:74:13: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
if (n < 0 || ferror(file))
~ ^ ~
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix warnings emitted by Clang:
/home/shade/dev/tigervnc/common/rdr/FdInStream.h:30:9: error: 'rdr::FdInStreamBlockCallback' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor]
class FdInStreamBlockCallback {
^
In file included from /home/shade/dev/tigervnc/common/network/TcpSocket.cxx:44:
In file included from /home/shade/dev/tigervnc/common/network/TcpSocket.h:31:
/home/shade/dev/tigervnc/common/network/Socket.h:82:9: error: 'network::ConnectionFilter' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor]
class ConnectionFilter {
^
..etc
|
|
|
|
|
|
|
| |
This bug was introduced in c6df31db. A non-blocking socket that did
not have any more space would busy loop until the write succeeded.
Instead now it returns without any action, just as it did before
the bug was introduced.
|
|
|
|
| |
The logic was a bit confusing and superfluous.
|
|
|
|
| |
We haven't supported such an old version of Windows for some time.
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|