server: report content length for session files in stat

makeStat was missing a case for /s/{id}/{file} paths, so stat
reported Length=0 and clients (cat via 9pfuse) read zero bytes.
This commit is contained in:
Levi Neely 2026-04-22 09:38:33 +02:00
parent 426a6ac7bc
commit 2df001a5eb
1 changed files with 9 additions and 0 deletions

View File

@ -1633,6 +1633,15 @@ func (s *Server) makeStat(path string) plan9.Dir {
}
}
}
case strings.HasPrefix(path, "/s/"):
parts := strings.SplitN(strings.TrimPrefix(path, "/s/"), "/", 2)
if len(parts) == 2 {
if sfs, ok := s.sessionFileStore(parts[0]); ok {
if info, err := sfs.Stat(parts[1]); err == nil {
dir.Length = uint64(info.Size())
}
}
}
}
}