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:
parent
426a6ac7bc
commit
2df001a5eb
|
|
@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in New Issue