diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-11-19 20:35:38 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-11-19 20:35:38 +0100 |
commit | 514731cf4b5dd97dc871b9fd84c4d9938900ef79 (patch) | |
tree | a15575ef430fe3ada0c8c79ce740770bce737c74 /sftp | |
parent | 0ee29e31ddcc81f541de7459b0a5e40dfa552672 (diff) | |
download | bagage-514731cf4b5dd97dc871b9fd84c4d9938900ef79.tar.gz bagage-514731cf4b5dd97dc871b9fd84c4d9938900ef79.zip |
WIP DEBUG
Diffstat (limited to 'sftp')
-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 } |