Fix HyBi support on 64-bit systems.

https://github.com/kanaka/noVNC/issues/76

- cleanup/update TODO.
- remove explicit check for ctypes module for HyBi.
This commit is contained in:
Joel Martin 2011-08-24 13:23:15 -05:00
parent 2e00f96431
commit 86af0b614d
2 changed files with 6 additions and 15 deletions

View File

@ -1,17 +1,9 @@
- Support protocol version 07:
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07
- Go implementation
- Support multiple targets that are selected by the path line. Some
sort of wildcarding of ports too.
- Support SSL targets too.
- wstelnet: support CSI L and CSI M
- create gevent version:
http://nichol.as/benchmark-of-python-web-servers
http://n01se.net/paste/QXO
- Need at least libevent-1.4 (i.e. not 9.04 Jaunty)
sudo aptitude install python-dev libevent-dev python-setuptools
sudo easy_install gevent

View File

@ -49,8 +49,7 @@ else:
# Degraded functionality if these imports are missing
for mod, sup in [('numpy', 'HyBi protocol'),
('ctypes', 'HyBi protocol'), ('ssl', 'TLS/SSL/wss'),
('resource', 'daemonizing')]:
('ssl', 'TLS/SSL/wss'), ('resource', 'daemonizing')]:
try:
globals()[mod] = __import__(mod)
except ImportError:
@ -298,9 +297,9 @@ Sec-WebSocket-Accept: %s\r
f['mask'] = buf[f['hlen']:f['hlen']+4]
b = c = ''
if f['length'] >= 4:
mask = numpy.frombuffer(buf, dtype=numpy.dtype('<L4'),
mask = numpy.frombuffer(buf, dtype=numpy.dtype('<u4'),
offset=f['hlen'], count=1)
data = numpy.frombuffer(buf, dtype=numpy.dtype('<L4'),
data = numpy.frombuffer(buf, dtype=numpy.dtype('<u4'),
offset=f['hlen'] + 4, count=int(f['length'] / 4))
#b = numpy.bitwise_xor(data, mask).data
b = numpy.bitwise_xor(data, mask).tostring()