Pierre Ossman [Fri, 16 Apr 2021 11:28:47 +0000 (13:28 +0200)]
Revert "Fixed a race condition when attaching to an existing socket"
This reverts commit ef27628c6dff6120b0ed0d4728cc6e8a32b7be53. By
bypassing setTimeout() it creates other race conditions so this is not
the proper fix for the issue.
Tim Stableford [Tue, 23 Mar 2021 12:58:49 +0000 (12:58 +0000)]
Fixed a race condition when attaching to an existing socket
This is an error that presents itself with RTCDataChannel's, I suspect this could not
happen with a pre-existing WebSocket.
If the remote connection creates a data channel then the local (VNC) side gets a channel
created callback. It may also be the case that in that very same tick the socket is also
opened and buffered data received. This meant that (in my tests) about 1/3 of the time
noVNC would fail to respond to the initial message from the server because it was received
and subsequently not handled during that initial tick.
Also made the documentation reflect this new behaviour and document the existing behaviour.
lhchavez [Thu, 11 Mar 2021 13:38:13 +0000 (05:38 -0800)]
Normalize the credentials presence check
Most places that check for the presence / absence of credentials compare
them against `undefined`, except the one for Plain authentication.
This change makes the very last place to use the same pattern (instead
of checking for falsiness) for consistency. Additionally, there are ways
to configure PAM to accept empty passwords, so it's possible for a user
to legitimately send an empty string as password.
Tim Stableford [Thu, 18 Feb 2021 08:42:34 +0000 (08:42 +0000)]
Added support for RTCDataChannel
This work is originally by Ryan Castner <castner.rr@gmail.com> and
submitted as a PR here https://github.com/novnc/noVNC/pull/1362
Architecturally it is much the same except it doesn't rename a lot
of variables to make this more reviewable. It also avoids unrelated
changes such as replacing .onclose with an event listener, which
caused numerous test failures.
It also adds in ppoffice's fix to initialise the buffers.
Like the original author I don't have enough time available to
refactor this project to the new style event listeners.
Review cleanup for RTCDataChannel support (see below)
* More descriptive error when url or channel not set.
* Moved websocket property check to WebSock.
This had unintended consequences in the tests that required some
fixup. Mostly due to some tests not always passing FakeWebsocket.
FakeWebsocket also needs to set the listeners to null to be compatible
with what is in thw browser and expected by the property check code.
The property check code now also takes into account class prototypes
for test compatibility.
* Removed unreachable code.
* Reverted comment.
* Cleanup raw channel reference in rfb on websock close.
* Use readyState to check whether a socket is open rather than assuming.
* Updated RFB constructor documentation
lhchavez [Thu, 4 Mar 2021 01:34:02 +0000 (17:34 -0800)]
Allow longer passwords in Plain authentication
Some people have longer passwords than 256 characters (hooray for
password managers!). Server implementations also allow longer passwords:
TigerVNC allows up to 1024 characters.
Pierre Ossman [Thu, 10 Dec 2020 09:01:04 +0000 (10:01 +0100)]
Fake key releases for some Japanese IM keys
Windows behaves very oddly for some Japanese IM keys in that it won't
send a key release event when the key is released. In some keys it never
sends the event, and in some cases it sends the release as the key is
pressed the subsequent time.
Pierre Ossman [Thu, 10 Dec 2020 08:43:49 +0000 (09:43 +0100)]
Send combination keysyms for some Japanese keys
Windows doesn't give us stable symbols for a bunch of Japanese IM keys,
instead alternating between two symbols. This state is not synchronised
with the IM running on the remote server so to have stable behaviour we
have to collapse these multiple symbols in to a single keysym.
Pierre Ossman [Fri, 4 Sep 2020 14:16:44 +0000 (16:16 +0200)]
Handle empty rects from the server
These are very pointless for the server to send, but not a violation of
the protocol so we need to be able to handle them. We've seen this
happen in real world scenarios a few times.
Pierre Ossman [Thu, 25 Jun 2020 12:37:21 +0000 (14:37 +0200)]
Handle quick Cursor detach after mouse up
This timer might fire after the Cursor object has detached from a DOM
element, causing crashes. This will likely not happen in real scenarios,
but the tests are quick enough to trigger this.
Pierre Ossman [Tue, 23 Jun 2020 11:56:33 +0000 (13:56 +0200)]
Use GitHub actions instead of Travis/Sauce Labs
The ability to use Sauce Labs for pull requests has now stopped working,
as Travis warned about several years ago. Instead run our tests directly
on GitHub on their various virtual machines.
Pierre Ossman [Tue, 16 Jun 2020 13:32:38 +0000 (15:32 +0200)]
Alway focus on touchstart
The new gesture detection code will always prevent the default behaviour
of touchstart, so this check no longer works properly. We might want to
add something similar to GestureHandler in the future, but let's wait
and see what use cases are requested.
Samuel Mannehed [Thu, 11 Jun 2020 13:52:34 +0000 (15:52 +0200)]
Fake cursor position when using touch
With the new gestures we will simulate the cursor being in a different
location than any of the touch points. This is a bit too complex for the
Cursor class, so let's just explicitly tell it where we want the cursor
rendered.
Pierre Ossman [Wed, 10 Jun 2020 12:12:22 +0000 (14:12 +0200)]
Increase wheel step threshold
The previous value made the detection too sensitive and it was very
difficult to scroll precisely. A value of 50 pixels should give similar
behaviour to systems that don't do fine grained scrolling.
Pierre Ossman [Wed, 10 Jun 2020 10:55:27 +0000 (12:55 +0200)]
Remove delayed wheel timer
This isn't really expected behaviour from a user, i.e. that an extremely
small wheel movement still gives a large scroll event in the remote application.
Pierre Ossman [Sun, 7 Jun 2020 12:22:07 +0000 (14:22 +0200)]
Switch to RGBx pixel format
This is what the browser wants so it avoids having to spend time
converting everything. Unfortunately it usually means the server instead
needs to convert it for us, but we assume it has more power than we do.