File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 13
13
# Treat this remote directory as a root for file transfers
14
14
SANDBOX = ""
15
15
#SANDBOX = "/tmp/webrepl/"
16
-
16
+ DEBUG = 0
17
17
18
18
WEBREPL_FILE = "<2sBBQLH64s"
19
19
20
+
21
+ def debugmsg (msg ):
22
+ if DEBUG :
23
+ print (msg )
24
+
25
+
20
26
if USE_BUILTIN_WEBSOCKET :
21
27
from websocket import websocket
22
28
else :
@@ -58,10 +64,10 @@ def read(self, size):
58
64
(sz ,) = struct .unpack (">H" , hdr )
59
65
if fl == 0x82 :
60
66
break
61
- print ("Got unexpected websocket record of type %x, skipping it" % fl )
67
+ debugmsg ("Got unexpected websocket record of type %x, skipping it" % fl )
62
68
while sz :
63
69
skip = self .s .recv (sz )
64
- print ("Skip data:" , skip )
70
+ debugmsg ("Skip data: %s" % skip )
65
71
sz -= len (skip )
66
72
data = self .recvexactly (sz )
67
73
assert len (data ) == sz
You can’t perform that action at this time.
0 commit comments