mirror of https://github.com/pkg/sftp.git
define supported extensions in one place and use for both server and request-server
This commit is contained in:
parent
a760e7925e
commit
b519cb8db9
|
@ -151,7 +151,7 @@ func (rs *RequestServer) packetWorker(
|
|||
var rpkt responsePacket
|
||||
switch pkt := pkt.requestPacket.(type) {
|
||||
case *sshFxInitPacket:
|
||||
rpkt = sshFxVersionPacket{Version: sftpProtocolVersion}
|
||||
rpkt = sshFxVersionPacket{Version: sftpProtocolVersion, Extensions: sftpExtensions}
|
||||
case *sshFxpClosePacket:
|
||||
handle := pkt.getHandle()
|
||||
rpkt = statusFromError(pkt, rs.closeRequest(handle))
|
||||
|
|
|
@ -157,11 +157,8 @@ func handlePacket(s *Server, p orderedRequest) error {
|
|||
switch p := p.requestPacket.(type) {
|
||||
case *sshFxInitPacket:
|
||||
rpkt = sshFxVersionPacket{
|
||||
Version: sftpProtocolVersion,
|
||||
Extensions: []sshExtensionPair{
|
||||
{"hardlink@openssh.com", "1"},
|
||||
{"posix-rename@openssh.com", "1"},
|
||||
},
|
||||
Version: sftpProtocolVersion,
|
||||
Extensions: sftpExtensions,
|
||||
}
|
||||
case *sshFxpStatPacket:
|
||||
// stat the requested file
|
||||
|
|
Loading…
Reference in New Issue