diff options
Diffstat (limited to 'sftp/server.go')
-rw-r--r-- | sftp/server.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sftp/server.go b/sftp/server.go index 6b2b20f..51db31a 100644 --- a/sftp/server.go +++ b/sftp/server.go @@ -183,7 +183,7 @@ func handlePacket(s *Server, p orderedRequest) error { case *sshFxpStatPacket: log.Println("pkt: stat: ", p.Path) // stat the requested file - info, err := os.Stat(toLocalPath(p.Path)) + info, err := s.fs.Stat(s.ctx, p.Path) rpkt = &sshFxpStatResponse{ ID: p.ID, info: info, @@ -286,13 +286,14 @@ func handlePacket(s *Server, p orderedRequest) error { }).respond(s) } case *sshFxpReadPacket: - log.Println("pkt: read handle: ", p.Handle) var err error = EBADF f, ok := s.getHandle(p.Handle) + log.Println("pkt: read handle: ", p.Handle, f.Path.Path) if ok { err = nil data := p.getDataSlice(s.pktMgr.alloc, orderID) n, _err := f.ReadAt(data, int64(p.Offset)) + log.Println("DEBUG: ", n, _err, p.Offset) if _err != nil && (_err != io.EOF || n == 0) { err = _err } |