The select call needs to timeout if a WebSocket socket keeps reporting
ready but actually isn't ready. To prevent it hanging forever in that
condition, the timeout value is now adjusted now for each call.
Move the DO_DEBUG and DO_TRACE settings to wswrapper.c.
Interpose on select/pselect so that WebSockets sockets are only
reported as ready if they have enough to actually decode at least
1 byte of real data. This prevents hanging in read/recv after
WebSocket is reported as ready but is not actually ready because empty
frames or less than four base64 bytes have been received.
Split defines and constant defintions into wswrapper.h.
Cleanup debug output and add TRACE for more detailed tracing debug
output.
Major TODO is that select needs to timeout if WebSocket socket keeps
reporting ready but actually isn't ready. That condition will
currently hang forever because the select timeout value is not
adjusted when looping.
Make path to ld preload library absolute so wswrapper works even if
path is changed before main program is executed (i.e. by the vncserver
wrapper script).
bind() was using the return value for the port number, but it's
actually the original port number that we should interpose on in the
bind() routine.
Allocate buffer and state memory for each accepted connection. This
allows all WebSockets connections to a given listen port to be wrapped
with WebSockets support.
wswrapper.so will only interpose on the listen port specified in
WSWRAP_PORT.
Add simple wswrap script that sets the WSWRAP_PORT, LD_PRELOAD and
invokes the command line to wrap.
Rename the $() selector to $D() so that it doesn't collide with
the jQuery name.
The API change is that the 'target' option for Canvas and RFB objects
must now be a DOM Canvas element. A string is no longer accepted
because this requires that a DOM lookup is done and the Canvas and RFB
should have no UI code in them. Modularity.
wswrapper.so is LD_PRELOAD shared library that interposes and turns
a generic TCP socket into a WebSockets service.
This current version works but will only allow work for a single
connection, subsequent connections will not be wrapped. In addition
the wrapper interposes on the first incoming network connection. It
should read an environment variable to determine the port to interpose
on. Also, should limit origin based on another environment variable.
Then there should be a wswrap setup script that allows easier
invocation.
Only call encode_message when the WebSockets object is actually
ready to send. Otherwise multiple base64 encode sequences can be
encoded into the same WebSockets frame. This causes the C version of
wsproxy to crash and the python version to ignore the subsequent
base64 sequence(s).
Thanks to Colin Dean (xvpsource.org) for finding this and helping
track it down.
- Add meta tag to vnc.html and vnc_auto.html so that if Chrome Frame
is installed, it is used.
- Add detection to default_controls.js that shows a message with
a Chrome Frame install link if the user is using a version of IE
without Canvas support.
- Fix web.py so that requests have their connection closed after they
are completed. This has been a bug for a while but it prevents
Chrome Frame from working because Chrome Frame doesn't activate
until the initial request connection closes.
Node:
http://nodejs.org/https://github.com/ry/node
It mostly works, but it eventually gets an error from the target which
is probably due to missing support for re-assembly of client
WebSockets frames.
This is WebKit bug https://bugs.webkit.org/show_bug.cgi?id=46319
The workaround is to wrap Canvas render functions with a function that
sets a flush timer. The flush function sets the right margin and then
1ms later sets it back. This triggers the canvas to redraw with the
correct contents.
Two downsides:
- rendering is slower, but only on the busted versions of webkit.
Correct and useful is better than fast and useless.
- There is a barely perceptible jitter of the control buttons because
the canvas size is changing by one pixel.
To support this functionality, we also have to read out the exact
webkit version from the user agent in the render engine detection code
in include/util.js.
- Make sure that canvas exists (i.e. didn't throw an error) before
trying to call canvas method get_canvas_uri.
- Typos in HTML render engine debug output.
- pass CFLAGS and LDFLAGS in case one needs to use -m32
- link to libcrypto for _ERR_print_errors_fp
- __THROW is non-standard define it to nothing by default
- use b64_ntop and b64_pton instead of mangled versions, OSX doesn't mangle them in the same way
- access() takes two arguments!
Signed-off-by: François Revol <revol@free.fr>
- Split out ClientInitialisation state.
- In version 3.3 and 3.7, when the server has no auth (scheme
1), then we should skip from Authentication to ClientInitialisation.
- Add wsproxy README.md in utils/ directory.
- Document how to build ssl module for python 2.5 and older in wsproxy
README.
- Update browsers.md to note revision that have the webkit Canvas
rendering bug: WebKit build 66396 through 68867 (Chrome/Chromium
build 57968 through 61278).
- rQwait checks the receive queue to see if there is enough data to
satisfy the following request. If not it returns true (which is
almost always translated into an immediate return false by the
caller).
- rQwait is called quite a bit and this generally allows 4 lines to
become 1 line where it is called.
- rQwait allows simplification of cuttext processing. No global
tracking needed anymore.
Overall, about 60 lines less code.
DES is just used once during authentication and is not performance
sensitive so we save some space by generating and/or removing some
lookup tables. Also, shorten some very frequently used variables.
Shaves off about 100 lines.
- util.js that contains essential functions
- webutils.js that contains the GUI utility function.js
this helps to include noVNC in other project, especially Cappuccino Application
i
The decrypt functionality is never used so remove it. Also, we can
assume that we are always DES encrypting 16 characters which allows
several things to be simplified in DES.
Overall this removes about 80 lines of code.
- include/rfb.js: Keep track of the number of rects of each encoding
type and print them out when we close a connection (if 'info'
logging level).
- tests/vnc_perf.html: first pass at a noVNC based performance
benchmark.
- utils/wsproxy.py: Fix the output of the record filename.