From 514731cf4b5dd97dc871b9fd84c4d9938900ef79 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 19 Nov 2021 20:35:38 +0100 Subject: WIP DEBUG --- sftp/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sftp') 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 } -- cgit v1.2.3