Add missing responses to some FS operations

This commit is contained in:
Elara 2021-11-25 19:46:04 -08:00
parent cb8fb2c0bc
commit f5d326124d
1 changed files with 3 additions and 0 deletions

View File

@ -464,6 +464,7 @@ func handleConnection(conn net.Conn, dev *infinitime.Device, fs *blefs.FS) {
break break
} }
} }
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
case types.FSTypeMove: case types.FSTypeMove:
if len(reqData.Files) != 2 { if len(reqData.Files) != 2 {
connErr(conn, req.Type, nil, "Move FS command requires an old path and new path in the files list") connErr(conn, req.Type, nil, "Move FS command requires an old path and new path in the files list")
@ -474,6 +475,7 @@ func handleConnection(conn net.Conn, dev *infinitime.Device, fs *blefs.FS) {
connErr(conn, req.Type, err, "Error moving file") connErr(conn, req.Type, err, "Error moving file")
break break
} }
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
case types.FSTypeMkdir: case types.FSTypeMkdir:
for _, file := range reqData.Files { for _, file := range reqData.Files {
err := fs.Mkdir(file) err := fs.Mkdir(file)
@ -482,6 +484,7 @@ func handleConnection(conn net.Conn, dev *infinitime.Device, fs *blefs.FS) {
break break
} }
} }
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
case types.FSTypeList: case types.FSTypeList:
if len(reqData.Files) != 1 { if len(reqData.Files) != 1 {
connErr(conn, req.Type, nil, "List FS command requires a path to list in the files list") connErr(conn, req.Type, nil, "List FS command requires a path to list in the files list")