From pkg/record/record.go:
|
// A Record represents the data read from or written to a file descriptor. |
|
type Record struct { |
|
Time time.Time // received time |
|
Fd int // integer file descriptor |
|
Size int // size of data |
|
Data []byte // data |
|
} |
|
|
Field r.Size is redundant with len(r.Data).
Removing the Size field will reduce memory allocated and could improve throughput. This could also eliminate any risk of mishandling Size vs Data (record.Encode, for example, doesn't do any consistency check).
From pkg/record/record.go:
sshproxy/pkg/record/record.go
Lines 48 to 55 in 7239859
Field
r.Sizeis redundant withlen(r.Data).Removing the
Sizefield will reduce memory allocated and could improve throughput. This could also eliminate any risk of mishandlingSizevsData(record.Encode, for example, doesn't do any consistency check).