mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-26 23:19:58 +00:00
AUTH-2159: Moves shutdownC close into error handling
AUTH-2161: Lowers size of preamble length AUTH-2160: Fixes url parsing logic
This commit is contained in:
@@ -180,8 +180,12 @@ func sendSSHPreamble(stream net.Conn, destination, token string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if uint16(len(payload)) > ^uint16(0) {
|
||||
return errors.New("ssh preamble payload too large")
|
||||
}
|
||||
|
||||
sizeBytes := make([]byte, sshserver.SSHPreambleLength)
|
||||
binary.BigEndian.PutUint32(sizeBytes, uint32(len(payload)))
|
||||
binary.BigEndian.PutUint16(sizeBytes, uint16(len(payload)))
|
||||
if _, err := stream.Write(sizeBytes); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user