Remove unused field in fxpOpenPacket

Update #14
This commit is contained in:
Dave Cheney 2014-09-28 13:00:42 +10:00
parent f881033388
commit ea8e50a388
2 changed files with 2 additions and 4 deletions

View File

@ -210,13 +210,12 @@ type sshFxpOpenPacket struct {
Path string
Pflags uint32
Flags uint32 // ignored
Size uint64 // ignored
}
func (p sshFxpOpenPacket) MarshalBinary() ([]byte, error) {
l := 1 + 4 +
4 + len(p.Path) +
4 + 4 + 8
4 + 4
b := make([]byte, 0, l)
b = append(b, ssh_FXP_OPEN)
@ -224,7 +223,6 @@ func (p sshFxpOpenPacket) MarshalBinary() ([]byte, error) {
b = marshalString(b, p.Path)
b = marshalUint32(b, p.Pflags)
b = marshalUint32(b, p.Flags)
b = marshalUint64(b, p.Size)
return b, nil
}

View File

@ -153,7 +153,7 @@ var sendPacketTests = []struct {
Id: 1,
Path: "/foo",
Pflags: flags(os.O_RDONLY),
}, []byte{0x0, 0x0, 0x0, 0x1d, 0x3, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x4, 0x2f, 0x66, 0x6f, 0x6f, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
}, []byte{0x0, 0x0, 0x0, 0x15, 0x3, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x4, 0x2f, 0x66, 0x6f, 0x6f, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0,}},
{sshFxpWritePacket{
Id: 124,