aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/VNCSConnectionST.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add support for notifying clients about pointer movementslhchavez2021-03-021-0/+24
| | | | | | | | | | | | | | | | | | | | | | | 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
* Merge branch 'noblock' of https://github.com/CendioOssman/tigervncPierre Ossman2021-01-191-51/+26
|\
| * Change streams to be asynchronousPierre Ossman2020-05-211-21/+5
| | | | | | | | | | | | | | | | | | | | 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).
| * Make sure TLS is allowed to terminate gracefullyPierre Ossman2020-05-211-2/+2
| | | | | | | | | | | | Some systems (like TLS) need to send some final data before closing a connection. Make sure this is properly handled by cleaning up the security object before closing the underlying network socket.
| * Check buffer usage with a simply booleanPierre Ossman2020-05-211-4/+4
| | | | | | | | | | External callers don't need to know the exact details, only if there is data that needs to be flushed or not.
| * Generalise corking to all output streamsPierre Ossman2020-05-211-6/+6
| | | | | | | | | | The principle can be used in a more general fashion than just TCP streams.
| * Flush data on closePierre Ossman2020-05-211-0/+11
| | | | | | | | | | 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.
| * Move auth failure delay to SConnectionPierre Ossman2020-05-191-21/+1
| | | | | | | | | | It's a generic feature that is better handled as part of SConnection's state machine.
* | Fix handling of bad update requestsPierre Ossman2021-01-141-1/+1
| | | | | | | | | | | | 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.
* | Send response for refused SetDesktopSizematt3356722020-05-291-3/+4
|/ | | | | Sends response for SetDesktopSize as per the community wiki specification
* Allow XK_Scroll_Lock when LED state isn't supportedPierre Ossman2020-01-031-9/+1
| | | | | 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.
* Improved clipboard APIPierre Ossman2019-07-011-23/+55
| | | | | Change the internal clipboard API to use a request based model in order to be prepared for more advanced clipboard transfers.
* Clean up internal clipboard handlingPierre Ossman2019-07-011-4/+4
| | | | | | We now filter incoming data, which means we can start assuming the clipboard data is always null terminated. This allows us to clean up a lot of the internal handling.
* Add delay on authentication failuresPierre Ossman2019-04-011-1/+21
| | | | | | | This provides some basic rate limiting that will make it difficult for an attacker to brute force passwords. Only relevant when the blacklist is disabled as otherwise the attacker only gets a very limited number of attempts.
* Merge branch 'connparams' of https://github.com/CendioOssman/tigervncPierre Ossman2018-12-101-61/+53
|\
| * Require all SMsgWriter caller to check capabilitiesPierre Ossman2018-12-101-5/+7
| | | | | | | | | | | | Make the API consisitent by requiring the caller to check what the client supports before calling any of the write* functions. This avoids the confusion that the functions might not always do anything.
| * Abstract sending cursor and resizing the desktopPierre Ossman2018-12-101-18/+11
| | | | | | | | | | | | Avoid having the callers need to know about the different variants of these functions and instead have the writer pick the most appropriate extension.
| * Always send current screen layout to clientPierre Ossman2018-12-101-7/+3
| | | | | | | | | | | | This is what the protocol requires, rather than sending what the client specified in the request. This should be the same in practice except for failures and possibly some races.
| * Remove indirect capability attributesPierre Ossman2018-11-011-8/+7
| | | | | | | | | | Better to check the actual list of supported encodings directly. Makes parts more readable, and no risk of getting out of sync.
| * Move copy rect handling to EncodeManagerPierre Ossman2018-11-011-3/+1
| | | | | | | | | | No need to spread things out. Keep all of the handling in a single place to make things clearer.
| * Rename ConnParams to ClientParamsPierre Ossman2018-11-011-36/+36
| | | | | | | | | | | | Now that we've split out server state to ServerParams, ConnParams only contains state for a client. Rename the class and variables to reflect this.
| * Encapsulate screen layout storage in ConnParamsPierre Ossman2018-11-011-18/+20
| | | | | | | | | | | | | | Avoid direct access to the screen dimensions and layout so that we can make sure it stays sane. This also makes sure the layout is properly updated when we only get the screen dimensions from the server.
* | Abort unsafe lossless refresh earlyPierre Ossman2018-11-231-13/+15
| | | | | | | | | | | | | | We need to check earlier if we are going to send this refresh or not. Otherwise we send out pings pointlessly, and we also stall the request loop with a client as we clear the requested region without actually sending an update message.
* | Move lossless refresh handling to separate methodPierre Ossman2018-11-231-45/+78
| | | | | | | | | | It makes the logic a bit easier to follow, and also fixes the case where just a fake update is needed.
* | Change idle timeout to timerPierre Ossman2018-11-091-38/+23
| | | | | | | | | | Get this timeout in to the timer system as well to make things simpler and more robust.
* | Move ListConnInfo to WinVNC directoryPierre Ossman2018-11-091-43/+1
| | | | | | | | | | It is functionality specific to WinVNC, so move the code there to make things more clear.
* | Encapsulate client handling in VNCServerSTPierre Ossman2018-10-261-51/+4
| | | | | | | | | | | | Removed the last parts of VNCSConnectionST's back door in to VNCServerST and let the parent class fully handle coordination of clients, and access to the desktop.
* | Move access rights and closing to SConnection objectPierre Ossman2018-10-101-30/+49
| | | | | | | | | | This makes it generally useful and other code doesn't have to know of the specific sub-class.
* | Encapsulate setDesktopSize() in VNCServerSTPierre Ossman2018-10-101-19/+1
| | | | | | | | | | More encapsulation of functions that require coordinate between clients.
* | Encapsulate event handling in VNCServerSTPierre Ossman2018-10-101-36/+15
| | | | | | | | | | | | There is some client coordination needed which is better encapsulated inside VNCServerST. This also helps hiding the desktop from the individual clients.
* | Use accessor methods for VNCServerSTPierre Ossman2018-10-101-23/+24
| | | | | | | | | | Avoid having VNCSConnectionST poking around in VNCServerST's internals and instead access things via safer methods.
* | Remove QueryConnectionHandlerPierre Ossman2018-10-101-2/+3
| | | | | | | | | | Make things simpler by making this a part of the SDesktop interface that always needs to be implemented.
* | Force common flow of connection queriesPierre Ossman2018-10-091-10/+1
|/ | | | | | Force queryConnection() to always call back to approveConnection() rather than return special values. This makes the flow easier to follow as it will be the same in all cases.
* Limit maximum lossless refresh CPU usagePierre Ossman2018-09-201-2/+7
| | | | | | If we have plenty of bandwidth then CPU might be the limiting resource. Unfortunately we don't have a good number for that limit, so add a conservative hard coded value.
* Don't attempt to send empty lossless refreshPierre Ossman2018-09-201-6/+9
| | | | | If we're out of time then we will definitely overshoot, so don't even try.
* Avoid refresh of recently changed areasPeter Åstrand (astrand)2018-09-201-5/+17
| | | | | | | | If an area recently changed then we can guess that it will most likely change again very soon. In such a case it is meaningless to send a lossless refresh as it will directly be overwritten. Keep track of such areas and avoid refreshing them until we no longer see any changes to them.
* Fix bad type on congestion ETA variablePierre Ossman2018-07-171-1/+1
|
* Send lossless refresh even with pending updatesPierre Ossman2018-03-281-12/+19
| | | | | | There might be parts of the screen that haven't changed and can therefore be refreshed. Figure which parts these are and send just those.
* Limit lossless refresh update to safe sizePierre Ossman2018-03-281-2/+14
| | | | | | We don't want to waste bandwidth on the lossless refresh if we might need that bandwidth for a normal update. Try to estimate how much data we can safely send without interfering.
* Automatic lossless refreshPierre Ossman2018-03-281-3/+11
| | | | | | Resend pixel perfect copies of areas that were previously sent using a lossy encoder. This is done when there is no normal update to send, and no congestion.
* Remove redundant Region::copyFrom()Pierre Ossman2018-03-281-1/+1
| | | | We already have an assignment operator, so no need for this method.
* Respect request area for cursor renderingPierre Ossman2018-03-281-24/+23
| | | | | | | We cannot send updates for a cursor that is outside the requested region, so make sure we track things properly. This also has the nice side effect of just re-sending the bits needed when the cursor overlaps a changed part of the framebuffer.
* Merge branch 'congestion' of https://github.com/CendioOssman/tigervncPierre Ossman2018-02-261-194/+40
|\
| * Add crude congestion window debug tracePierre Ossman2017-11-171-0/+1
| | | | | | | | | | Allows us to compare our computed congestion window with the underlying one used by the TCP layer.
| * Improved congestion control handlingPierre Ossman2017-11-171-4/+23
| | | | | | | | | | | | Refine the previous method by interpolating the values we need. This reduces the effect of the problem that we cannot send enough ping packets.
| * Move congestion control to its own classPierre Ossman2017-11-171-194/+5
| | | | | | | | | | It's a general function and it's better to have that particular complexity in its own place.
| * Reduce header dependencies in server classesPierre Ossman2017-11-171-5/+8
| |
| * Use a queue for congestion pingsPierre Ossman2017-11-171-14/+26
| | | | | | | | | | This reduces the data sent, and avoids any problems with the client corrupting it.
* | Fix bug where server cursor might disappearPierre Ossman2017-11-171-6/+4
| | | | | | | | | | | | | | We shouldn't unconditionally remove the server side cursor just because the client supports client side cursors. We need to also check that the client fulfills the other criteria for taking over the cursor.
* | Avoid extra framebuffer update messagesPierre Ossman2017-11-171-17/+5
| | | | | | | | | | | | In most cases we will send an update at the end of processing client messages so these extra calls only slow things down. Server initiated events still need an explicit call though.