Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vncproxy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
86d60379
authored
Mar 07, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix flake8 warnings
parent
77c2960d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
proxy.py
+2
-2
websockets.py
+6
-5
No files found.
proxy.py
View file @
86d60379
...
...
@@ -33,7 +33,7 @@ class ProxyClientProtocol(protocol.Protocol):
self
.
cli_queue
.
get
()
.
addCallback
(
self
.
serverDataReceived
)
def
serverDataReceived
(
self
,
chunk
):
if
chunk
is
False
:
if
not
chunk
:
self
.
cli_queue
=
None
logger
.
info
(
"Client(
%
s): disconnecting from qemu (
%
s)"
,
self
.
factory
.
src
,
self
.
dst
)
...
...
@@ -105,7 +105,7 @@ class VNCWebSocketHandler(Protocol):
reactor
.
connectTCP
(
host
,
int
(
port
),
factory
)
def
clientDataReceived
(
self
,
chunk
):
if
chunk
is
False
:
if
not
chunk
:
self
.
transport
.
loseConnection
()
else
:
logger
.
debug
(
"Server(
%
s): writing
%
d bytes to original client"
,
...
...
websockets.py
View file @
86d60379
...
...
@@ -12,10 +12,6 @@ factory.
@since: 13.2
"""
__all__
=
[
"WebSocketsResource"
,
"IWebSocketsFrameReceiver"
,
"lookupProtocolForFactory"
,
"WebSocketsProtocol"
,
"WebSocketsProtocolWrapper"
,
"CONTROLS"
,
"STATUSES"
]
import
base64
from
hashlib
import
sha1
...
...
@@ -31,6 +27,11 @@ from twisted.web.resource import IResource
from
twisted.web.server
import
NOT_DONE_YET
__all__
=
[
"WebSocketsResource"
,
"IWebSocketsFrameReceiver"
,
"lookupProtocolForFactory"
,
"WebSocketsProtocol"
,
"WebSocketsProtocolWrapper"
,
"CONTROLS"
,
"STATUSES"
]
class
_WSException
(
Exception
):
"""
Internal exception for control flow inside the WebSockets frame parser.
...
...
@@ -457,7 +458,7 @@ class _WebSocketsProtocolWrapperReceiver():
@type fin: C{bool}
@param fin: Whether or not the frame is final.
"""
if
not
opcode
in
(
CONTROLS
.
BINARY
,
CONTROLS
.
TEXT
,
CONTROLS
.
CONTINUE
):
if
opcode
not
in
(
CONTROLS
.
BINARY
,
CONTROLS
.
TEXT
,
CONTROLS
.
CONTINUE
):
return
self
.
_messages
.
append
(
data
)
if
fin
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment