15
15
#SANDBOX = "/tmp/webrepl/"
16
16
17
17
18
- WEBREPL_FILE = "<3sBBBHQH64s "
18
+ WEBREPL_FILE = "<2sBBQLH64s "
19
19
20
20
if USE_BUILTIN_WEBSOCKET :
21
21
from websocket import websocket
@@ -85,7 +85,7 @@ def read_resp(ws):
85
85
def put_file (ws , local_file , remote_file ):
86
86
sz = os .stat (local_file )[6 ]
87
87
dest_fname = bytes (SANDBOX + remote_file , "utf-8" )
88
- rec = struct .pack (WEBREPL_FILE , b"WRA " , 1 , 0 , 0 , sz , 0 , len (dest_fname ), dest_fname )
88
+ rec = struct .pack (WEBREPL_FILE , b"WA " , 1 , 0 , 0 , sz , len (dest_fname ), dest_fname )
89
89
print (rec , len (rec ))
90
90
ws .write (rec [:10 ])
91
91
ws .write (rec [10 :])
@@ -100,7 +100,7 @@ def put_file(ws, local_file, remote_file):
100
100
101
101
def get_file (ws , local_file , remote_file ):
102
102
src_fname = bytes (SANDBOX + remote_file , "utf-8" )
103
- rec = struct .pack (WEBREPL_FILE , b"WRA " , 2 , 0 , 0 , 0 , 0 , len (src_fname ), src_fname )
103
+ rec = struct .pack (WEBREPL_FILE , b"WA " , 2 , 0 , 0 , 0 , len (src_fname ), src_fname )
104
104
print (rec , len (rec ))
105
105
ws .write (rec )
106
106
assert read_resp (ws ) == 0
0 commit comments