Commit Graph

292 Commits

Author SHA1 Message Date
Jesper Alf Dam 08567b08ac When compacting the receive buffer don't copy unused buffer space
When compacting the receive buffer, we should only copy the bytes
between _rQi and _rQlen (the index of the first unread byte, and the
next write position).

Previously, we copied everything for _rQi up untill the end of the
buffer.
2019-08-16 19:34:09 +02:00
Jesper Alf Dam 7d755d10dc Don't compact the receive buffer unless we've actually run out of space
Previously, we would compact the buffer (moving unread data to the
start of the buffer) as follows:

- after processing a message, if there are zero unread bytes, just reset
  the indices for first and last unread byte to zero
- else, if at least 1/8th of the buffer is used, copy remaining data to the beginning of the buffer

The second option is never actually necessary, as before inserting new data
into the array, we already check if there's enough free space, and
compact the buffer first if necessary. So we've been doing a lot of
copies that weren't actually needed. Let's not do that any more.
2019-08-16 19:34:09 +02:00
Samuel Mannehed c912230309 Remove the default value of wsProtocols
Using the 'binary' protocol by default is very non-standard.
2019-07-23 16:03:49 +02:00
Shira Maximov 25b3d49d32 Add support in websocket sub-protocols 2019-07-23 13:44:18 +03:00
Pierre Ossman 755d6eae99 Remove server pixel format warnings
These are harmless and really only for debugging. So remove them
as they tend to trick people in to thinking something is wrong.
We already print the entire server pixel format earlier anyway in
case we need the details.
2019-05-24 13:06:26 +02:00
Samuel Mannehed a136b4b078 Allow autoscale() with zero height or width
Commit 6e7e6f9 stopped the function from running if width or height was
zero, this commit reverts that change. This commit also makes the
resulting canvas 0x0 if autoscale is called with zero. By adding this
special case we can avoid division by zero in the calculations.
2019-04-02 16:51:18 +02:00
Samuel Mannehed 6e7e6f9c9e Add check for bad values for Display.autoscale() 2019-03-08 16:30:43 +01:00
Juanjo Diaz 41ddb35458 Replace unnecessary function supportsCursorURIs by a constant variable 2019-02-27 10:14:50 +02:00
Juanjo Diaz 44f4c5545f Move support check from display to browser 2019-02-27 10:13:50 +02:00
Juanjo Diaz 0505214cd9 Convert DES into a class 2019-02-26 23:53:43 +02:00
Juanjo Diaz 9d2c9d1a75 Use default argument for base64 2019-02-26 23:52:47 +02:00
Juanjo Diaz 667f3cc20e Remove unnecessary context from eventtarget 2019-02-26 23:51:45 +02:00
Juanjo Diaz fe5974a740 Remove unnecessary constructor parameter from Cursor 2019-02-26 23:51:33 +02:00
Juanjo Diaz 9255e0fb47 Remove intermediate variable from mouse 2019-02-16 23:31:58 +02:00
Pierre Ossman b00a608af7 Remove error handling in clientCutText()
It is not necessary as Websock.flush() is guaranteed to succeed and
give us some space. It also remove the call to _fail(), which was
invalid at this place as clientCutText() is not a method on RFB.
2019-02-15 13:14:36 +01:00
Pierre Ossman 47c66517ae Throw correct Error object
We've already defined the name Error as a logging function, so we
need to be more explicit when we want to refer to the exception
class.
2019-02-15 13:01:28 +01:00
Pierre Ossman c02b18f06f Clean up RFB._rfb_auth_schema assignment 2019-02-15 10:25:50 +01:00
Pierre Ossman 3bb15d4aa0 Fix security failure reason handling of slow data
Things would break if the security result and security reason did
not arrive in the same WebSocket message.
2019-02-15 10:24:41 +01:00
Pierre Ossman c13df5ae67 Fix version handshake to handle slow data 2019-02-15 10:23:32 +01:00
Pierre Ossman b8ff5d1bde Use arrow function to avoid bind 2019-02-15 10:22:27 +01:00
Pierre Ossman 17eea9574d Consume data properly in Hextile decoder
We accidentally removed the code updating the data index in 8a189a6,
resulting in the decoder newer consuming any data. So the data would
be parsed as the next rect, causing weird errors.
2019-02-14 16:57:26 +01:00
Mykola Mokhnach d7791ebbcd Make the screen background cutomizable 2019-01-18 19:36:23 +01:00
Samuel Mannehed ef64917a90 Only disable scrollbars on Android and iOS
Previously scrollbars were disabled on all touch devices. This meant
that they were disabled on Windows when touch was detected. Windows does
in fact have useful scrollbars even in touch mode. Fixes Issue #1172
2019-01-09 14:59:22 +01:00
Samuel Mannehed 47b3eac82b Move UI.isSafari into core/util/browser.js
This is where the rest of these kinds of functions are.
2019-01-09 14:58:03 +01:00
Samuel Mannehed 97e23ebbb2 Reorder browser and platform info functions
Platform info functions grouped together and browser info functions
grouped together.
2019-01-09 14:56:59 +01:00
Juanjo Diaz 879e33ab64 Extract rQshift to common function 2018-12-08 17:32:00 +02:00
Juanjo Diaz 8a189a6291 Add getters/setter to websock 2018-12-08 17:31:20 +02:00
Samuel Mannehed 18439b0680
Merge pull request #1165 from juanjoDiaz/throw_errors_instead_of_strings
Throw Error instead of String
2018-11-26 19:09:44 +01:00
Samuel Mannehed 2bab9a0460
Merge pull request #1166 from juanjoDiaz/simplify_EventTargetMixin
Simplify EventTargetMixin
2018-11-26 18:42:10 +01:00
Juanjo Diaz 11ef53544f Simplify EventTargetMixin 2018-11-25 13:53:23 +02:00
Juanjo Diaz d3ed883a8f Use `new` when constructing errors 2018-11-24 21:44:11 +02:00
Juanjo Diaz 84a5a2d827 Throw Error instead of String 2018-11-24 19:47:57 +02:00
Solly Ross 84586c0f17 Change copyright header (#1138)
* Change copyright header

This updates the copyright header to say "The noVNC Authors".  People
who previously had copyright listings are now under the AUTHORS file.
2018-10-09 12:15:35 +02:00
Pierre Ossman 679535ec29 Fix cursor encoding handling from earlier merge
Old code snuck in when merging the split of decoders to separate
classes. Restore the proper handling of cursors.
2018-09-18 11:08:02 +02:00
Pierre Ossman 9881899e7b Merge branch 'style' of https://github.com/CendioOssman/noVNC 2018-09-17 13:54:04 +02:00
Pierre Ossman 934c606d91 Merge branch 'decoders' of https://github.com/CendioOssman/noVNC 2018-09-17 13:47:12 +02:00
Alexander E. Patrakov 4c38179d15 Show dot when there is no visible cursor
Disabled by default.
2018-09-14 20:31:59 +05:00
Alexander E. Patrakov d1314d4b3a Moved the "pixels + mask -> RGBA" logic to rfb.js
As requested by Pierre Ossman - he needs this for supporting other
cursor extensions.
2018-09-07 23:01:46 +08:00
Pierre Ossman 2c5491e131 Enforce space after function name 2018-09-06 17:34:15 +02:00
Pierre Ossman 3f1cda2e37 Enforce space before code block 2018-09-06 17:29:26 +02:00
Pierre Ossman 0ae5c54ab3 Enforce explicit semi-colons 2018-09-06 17:25:02 +02:00
Pierre Ossman 426a8c927b Enforce curly braces for control statements 2018-09-06 17:22:40 +02:00
Pierre Ossman 4a16dc51a8 Enforce no trailing whitespace 2018-09-06 17:12:45 +02:00
Pierre Ossman 942a312779 Enforce object key spacing 2018-09-06 17:07:11 +02:00
Pierre Ossman 6786fd8719 Enforce comma spacing 2018-09-06 16:43:31 +02:00
Pierre Ossman 7b536961b2 Enforce indentation 2018-09-06 16:37:38 +02:00
Pierre Ossman a98881151f Enforce brace style 2018-09-06 15:39:26 +02:00
Pierre Ossman 923cd22083 Move decoders to separate classes
Makes things a lot clearer by letting each encoding handle its own
details and state.
2018-08-22 15:12:34 +02:00
Pierre Ossman 11309f3243 Handle pseudo encodings directly
These have very special behaviour compared to normal data encodings,
so separate out them and handle them separately.
2018-08-22 15:12:10 +02:00
Pierre Ossman e17cae8f32 Remove statistics tracking
The profiles in the browsers are much better these days and give us
much better data than we can provide ourselves.
2018-08-22 15:12:05 +02:00