mirror of
https://github.com/osnr/TabFS.git
synced 2024-05-23 16:02:18 +02:00
trying to fix resource read. fix releasedir call.
This commit is contained in:
parent
50c9f62890
commit
e4c92ac4e9
|
@ -237,7 +237,13 @@ router["/tabs/by-id/*/resources/*"] = {
|
|||
frameId: frameTree.frame.id,
|
||||
url: resource.url
|
||||
});
|
||||
return { buf: utf8(base64Encoded ? atob(content) : content, offset, size) };
|
||||
if (base64Encoded) {
|
||||
const arr = Uint8Array.from(atob(data), c => c.charCodeAt(0));
|
||||
const slice = arr.slice(offset, offset + size);
|
||||
return { buf: String.fromCharCode(...slice) };
|
||||
} else {
|
||||
return { buf: utf8(content, offset, size) };
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new UnixError(unix.ENOENT);
|
||||
|
|
|
@ -212,7 +212,7 @@ tabfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
|
|||
static int
|
||||
tabfs_releasedir(const char *path, struct fuse_file_info *fi) {
|
||||
send_request("{op: %Q, path: %Q, fh: %d}",
|
||||
"release", path, fi->fh);
|
||||
"releasedir", path, fi->fh);
|
||||
|
||||
receive_response("{}", NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue