return
}
+func (n *node) fsPath() string {
+ return "/" + strings.Join(append([]string{n.metadata.Name}, n.path...), "/")
+}
+
func (fn fileNode) Read(req *fuse.ReadRequest, resp *fuse.ReadResponse, intr fusefs.Intr) fuse.Error {
if req.Dir {
panic("hodor")
}
+ log.Printf("read request for %s: offset=%d size=%d", fn.fsPath(), req.Offset, req.Size)
size := req.Size
if int64(fn.size)-req.Offset < int64(size) {
size = int(int64(fn.size) - req.Offset)
}
infoHash := fn.InfoHash
torrentOff := fn.TorrentOffset + req.Offset
- log.Print(torrentOff, size, fn.TorrentOffset)
if err := fn.FS.Client.PrioritizeDataRegion(infoHash, torrentOff, int64(size)); err != nil {
panic(err)
}