aboutsummaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge branches 'vmware-cursor-position' and ↵Pierre Ossman2021-03-1114-9/+115
|\ \ | | | | | | | | | 'vmware-cursor-position-vncviewer' of https://github.com/lhchavez/tigervnc
| | * Support the VMware Cursor Position extension on vncviewerlhchavez2021-03-117-3/+30
| |/ |/| | | | | | | | | | | | | This change makes it possible for re-synchronizing the remote cursor on the vncviewer when in fullscreen mode. This is done by locally moving the cursor position to what the server thinks it should be. Now SDL games should work!
| * Add support for notifying clients about pointer movementslhchavez2021-03-0210-7/+104
|/ | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Support TCP_NOPUSH as alternative to TCP_CORK"Pierre Ossman2021-03-021-4/+0
| | | | | This reverts commit d6e39658ae105fca2cfe37ba736dbf0e8d8356af. Apparently this is broken on macOS so it's not something we can make use of.
* Fix some incorrect data waitsPierre Ossman2021-03-022-17/+17
| | | | | | | | Some of these were incorrectly calculated so the server or client would wait too long before proceeding with decoding. Change all of these to be a more explicit calculation to avoid such issues in the future.
* Support TCP_NOPUSH as alternative to TCP_CORKPierre Ossman2021-03-021-0/+4
| | | | TCP_CORK is a Linux thing and BSD has TCP_NOPUSH instead.
* Add missing headers for TCP_CORKPierre Ossman2021-03-021-0/+2
| | | | | We didn't include the proper headers to get the correct define, so corking was never enabled.
* Merge branch 'autoclip' of https://github.com/CendioOssman/tigervncPierre Ossman2021-02-0311-26/+202
|\
| * Update desktop if clipboard client goes awayPierre Ossman2021-01-051-1/+1
| | | | | | | | | | So the current clipboard state is properly reflected in the desktop session.
| * Add debug logging for ignored clipboard eventsPierre Ossman2021-01-053-7/+21
| |
| * Fix clipboard state tracking in serverPierre Ossman2021-01-051-2/+7
| | | | | | | | This was out of sync with the client handling for no good reason.
| * Handle clipboard peek with missing dataPierre Ossman2021-01-052-6/+2
| | | | | | | | | | The peer expects a response, so we should also be able to respond that there is no clipboard data currently available.
| * Handle unsolicited clipboard transfersPierre Ossman2021-01-048-10/+86
| | | | | | | | | | | | The extended clipboard protocol has the ability for the peer to request things to be sent automatically, without a request message. Make sure we honor such settings.
| * Log client/server clipboard capabilitiesPierre Ossman2021-01-042-0/+85
| |
* | Fix overloaded function signaturePierre Ossman2021-01-262-2/+2
| |
* | Remove unused attributesPierre Ossman2021-01-261-3/+0
| |
* | Merge branch 'noblock' of https://github.com/CendioOssman/tigervncPierre Ossman2021-01-1981-1259/+1808
|\ \
| * | Change streams to be asynchronousPierre Ossman2020-05-2158-516/+1037
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * | Remove readString()/writeString()Pierre Ossman2020-05-219-76/+37
| | | | | | | | | | | | | | | These are not universal in the protocol so having functions for them only obfuscates things.
| * | Don't read invalid TLS auth reasonPierre Ossman2020-05-211-9/+2
| | | | | | | | | | | | | | | The specification only states a single result byte and not any reason after a TLS authentication failure.
| * | Improved bandwidth monitoringPierre Ossman2020-05-212-60/+2
| | | | | | | | | | | | | | | | | | 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.
| * | Make direct stream API a bit saferPierre Ossman2020-05-217-38/+42
| | | | | | | | | | | | | | | Provide some safety checks when directly accessing the underlying pointer of streams.
| * | Make sure TLS is allowed to terminate gracefullyPierre Ossman2020-05-215-17/+39
| | | | | | | | | | | | | | | | | | 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.
| * | Log I/O errors from TLS streamsPierre Ossman2020-05-212-1/+10
| | |
| * | Separate query and authentication handlingPierre Ossman2020-05-211-6/+6
| | | | | | | | | | | | Otherwise we might send duplicate result codes and other weird things.
| * | Check buffer usage with a simply booleanPierre Ossman2020-05-213-12/+14
| | | | | | | | | | | | | | | External callers don't need to know the exact details, only if there is data that needs to be flushed or not.
| * | Dynamically allocate stream buffersPierre Ossman2020-05-214-28/+132
| | | | | | | | | | | | | | | This allows us to handle peaks in input and output streams gracefully without having to block processing.
| * | Don't shuffle input buffer unless actually neededPierre Ossman2020-05-211-4/+6
| | |
| * | Generalise corking to all output streamsPierre Ossman2020-05-2116-51/+78
| | | | | | | | | | | | | | | The principle can be used in a more general fashion than just TCP streams.
| * | Remove unused bufSize argument from streamsPierre Ossman2020-05-2117-35/+28
| | |
| * | Remove special functions from JPEG compressorPierre Ossman2020-05-212-7/+1
| | | | | | | | | | | | We can do what we want with the standard methods.
| * | Simplify stream availability handlingPierre Ossman2020-05-2119-116/+66
| | | | | | | | | | | | | | | Just have a simply number of bytes argument to avoid a lot of complexity.
| * | Create common base classes for buffered streamsPierre Ossman2020-05-2119-397/+413
| | | | | | | | | | | | | | | Most streams are backed by a memory buffer. Create common base classes for this functionality to avoid code duplication.
| * | Add stream avail() methodsPierre Ossman2020-05-2113-22/+38
| | | | | | | | | | | | | | | Makes it more readable to write code that needs to know how much data/space is available in a stream.
| * | Remove OutStream::skip()Pierre Ossman2020-05-212-9/+1
| | | | | | | | | | | | | | | It might leak data depending on what's in the buffer. Use pad() instead where blank space is needed.
| * | Remove unused stream methodsPierre Ossman2020-05-213-35/+1
| | | | | | | | | | | | | | | They were accidentally left unused in fbad8a9 so they haven't been used in some time.
| * | Throw more descriptive error on decode errorPierre Ossman2020-05-211-2/+7
| | | | | | | | | | | | We need to be able to tell this exception came from a decoder.
| * | Use proper constants for socket shutdown()Pierre Ossman2020-05-211-2/+5
| | | | | | | | | | | | For readability.
| * | 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.
| * | Fix connection close logPierre Ossman2020-05-192-2/+4
| | | | | | | | | | | | | | | The socket is closed at this point so we have to rely on a cached value for the logging.
| * | Move auth failure delay to SConnectionPierre Ossman2020-05-194-46/+54
| | | | | | | | | | | | | | | It's a generic feature that is better handled as part of SConnection's state machine.
| * | Support calling methods from timersPierre Ossman2020-05-191-0/+15
| | | | | | | | | | | | | | | | | | 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.
* | | 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.
* | Correctly clear out output UTF-16 bufferPierre Ossman2020-10-051-1/+1
| | | | | | | | | | Each character is more than one byte, so adjust the clearing of the buffer to reflect that.
* | Correctly handle invalid UTF-16 code pointsPierre Ossman2020-10-051-1/+1
| | | | | | | | | | Some code points are reserved for the UTF-16 coding itself and must not appear as input data to the algorithm.
* | Fix conversion of latin-1 to UTF-8Pierre Ossman2020-10-051-2/+2
| | | | | | | | Signed bug prevented anything not ASCII from being coded correctly.
* | Fix UTF-16 encoding/decoding of high code pointsPierre Ossman2020-10-051-3/+4
| | | | | | | | | | Everything outside of BMP was handled incorrectly and was coded as completely different code points.
* | Return the correct number of consumed UTF-8 bytesPierre Ossman2020-10-051-0/+2
| | | | | | | | | | | | | | | | 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.
* | Merge branch 'tlstofu' of https://github.com/CendioOssman/tigervncPierre Ossman2020-09-081-90/+73
|\ \
| * | Properly store certificate exceptionsPierre Ossman2020-05-211-90/+73
| |/ | | | | | | | | | | | | | | | | | | 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.