| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows has (at least) two error namespaces, both errno and
GetLastResult(). These overlap, so it is important we keep track of
which one we are dealing with.
To make things extra problematic, the BSD socket API normally uses
errno, but on Windows it has been mapped in to the GetLastResult()
namespace.
Try to keep better control of this by using separate classes for the
namespaces.
|
|
|
|
|
|
| |
The behaviour is not consistent as Windows doesn't use errno for socket
errors, but Unix systems do. Always use the same exception to keep
things somewhat sane.
|
|
|
|
|
|
|
|
|
| |
This method should only be called when the client actually sends a
framebuffer update request, otherwise we might send data the client is
not ready for.
It's unclear what the purpose of this call is, so we have no better fix
than to just remove it.
|
|
|
|
|
| |
This is a very limited bit field, so use an 8 bit type to clearly show
how many bits are available.
|
|
|
|
|
| |
It's a source of confusion and possibly bugs to reuse the same variable
name for multiple things.
|
|
|
|
|
|
|
|
|
| |
These are often more readable as they avoid a lot of the boilerplate of
iterating over fixed arrays or STL containers.
Note that this change is very conservative to avoid noise in "git
blame". Only loops where this is a clear improvement have been
converted.
|
|
|
|
|
| |
Use the new "override" keyword to properly differentiate between new
virtual methods, and existing virtual methods being overridden.
|
|
|
|
|
| |
It's more readable than 0, and a bit safer than NULL, so let's try to
follow modern norms.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The desktop isn't completely paused just because there are no clients,
so it might still need some support from the server object.
This is primarily an issue for headless servers, where they need to
continue emulating things even without clients. A scraping server can
generally go completely passive if there are no clients.
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
This should have been done in a4308c9.
|
| |
| |
| |
| |
| |
| |
| | |
Move these RFB specific things to rfb::VNCServer, for clarity.
Signed-off-by: Pierre Ossman <ossman@cendio.se>
Signed-off-by: Carlos Santos <casantos@redhat.com>
|
|/
|
|
|
|
|
|
|
| |
They must belong to the rfb namespace, not to the SConnection class.
Also add an AccessNone constant, since it's better to use a mnemonic
symbol rather than zero to initialize the accessRights members.
Signed-off-by: Carlos Santos <casantos@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It's a reoccurring issue that users try to build individual components
by pointing cmake at a specific subdirectory, e.g. 'cmake vncviewer'.
CMake, unfortunately, has insufficient protection against this so we'll
need to add a manual check.
This commit only adds it to the most likely places for misuse so we
don't have to pollute every CMakeLists.txt.
|
| |
|
|
|
|
|
| |
It is more specific, and it properly sets up propagation when include
directories also need to be used further down a dependency chain.
|
|
|
|
|
| |
It is much more natural than custom methods for this very common
operation.
|
|
|
|
|
|
|
|
| |
These files don't use anything from this header, so remove the include.
This exposes some missing includes in other places, though. So add an
explicit include in the files that were relying on an indirect
inclusion.
|
|
|
|
|
| |
This matches the naming in STL, which is what we are mostly mimicing now
that we are using std::string for these functions.
|
|
|
|
|
| |
Avoids a bit of complexity by delegating that handling to a string
object.
|
|
|
|
|
| |
Let's use a more common type instead of something homegrown. Should be
more familiar to new developers.
|
|
|
|
|
|
|
|
| |
It's more standard and familiar than our custom CharArray type, and it
still gives us automatic freeing of the buffer.
We could probably have used std::unique_ptr instead, but we are
currently targeting older compilers where C++11 isn't standard yet.
|
|
|
|
|
| |
It's extreme overkill to inherit from CharArray just to get the
automatic freeing of the buffer when the object is destroyed.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
We know the needed space here, so let's keep it simple with a constant
size string buffer.
|
|
|
|
|
|
|
|
|
| |
This mimics how some system functions (like inet_ntop()) work, and
avoids complexity around ownership of the returned string buffer.
The downside is that the string must be consumed directly as it will be
overwritten on the next call, but that is not an issue with the current
usage.
|
|
|
|
|
| |
These don't need to be changed, so let's just keep it simple with a
constant string literal.
|
|
|
|
|
| |
Avoid complicating things by moving things in to a second buffer here as
there is no need for it.
|
|
|
|
|
| |
We don't need to make extra copies of the string in most cases, so let's
simplify the code and access the string directly when we can.
|
|
|
|
|
| |
We never use Windows' "UNICODE" mode anyway, so let's get rid of this
complexity.
|
|
|
|
|
| |
This makes memory management more clear and robust when using these
helper functions.
|
|
|
|
|
| |
These are used here and there so let's make them more general rather
than hiding them in the stream classes.
|
|
|
|
|
| |
Avoid our own custom types in favour of what's already included with
C++.
|
|
|
|
|
| |
Avoid having our own custom stuff and instead use the modern, standard
types, for familiarity.
|
|
|
|
|
| |
That warning doesn't play well with Windows' GetProcAddress(), so add
some extra casting to work around it.
|
|
|
|
|
| |
These types caused an incorrect signed/unsigned behaviour, so let's make
sure we use the appropriate type.
|
|
|
|
| |
These are all truisms because of the valid range of the types.
|
|
|
|
|
| |
This allows us to separate accidental fall through from explicit ones,
which allows us to turn on such checks in the compiler.
|
|
|
|
|
| |
This allows us to separate accidentally unused, from explicitly unused
parameters, which allows us to turn on such checks in the compiler.
|
|
|
|
|
| |
They don't get access bits until they've been authenticated, so avoid
doing any checks on clients in those early states.
|
|
|
|
|
| |
Modern cmake has better support for adding source files and libraries
incrementally, so let's use that to clean things up.
|
|
|
|
|
|
| |
Enable this automatically for developers so we increase the chance of
these problems getting caught. There is a risk of overhead though so
keep them disabled for release builds.
|
|
|
|
|
| |
The migration from 32-bit to 64-bit has long passed. Let's get rid of
all distinctions as native applications it the norm now.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds support for the VMware Mouse Position
pseudo-encoding[1], which is used to notify VNC clients when X11 clients
call `XWarpPointer()`[2]. This function is called by SDL (and other
similar libraries) when they detect that the server does not support
native relative motion, like some RFB clients.
With this, RFB clients can choose to adjust the local cursor position
under certain circumstances to match what the server has set. For
instance, if pointer lock has been enabled on the client's machine and
the cursor is not being drawn locally, the local position of the cursor
is irrelevant, so the RFB client can use what the server sends as the
canonical absolute position of the cursor. This ultimately enables the
possibility of games (especially FPS games) to behave how users expect
(if the clients implement the corresponding change).
Part of: #619
1: https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#vmware-cursor-position-pseudo-encoding
2: https://tronche.com/gui/x/xlib/input/XWarpPointer.html
3: https://hg.libsdl.org/SDL/file/28e3b60e2131/src/events/SDL_mouse.c#l804
|
| |
|