brontide: address old TODO to reset the brontide state

In this commit, we address a suuuper old TODO to reset the brontide
state. We were allocating a read buf which we now set to nil, and we
free up the original brontide reference.
This commit is contained in:
Olaoluwa Osuntokun
2025-09-03 13:05:18 -07:00
parent 21c21b7bd5
commit a58e329b2c

View File

@@ -234,7 +234,10 @@ func (c *Conn) Flush() (int, error) {
//
// Part of the net.Conn interface.
func (c *Conn) Close() error {
// TODO(roasbeef): reset brontide state?
// Clear the state we created to be able to handle this connection.
c.noise = nil
c.readBuf = bytes.Buffer{}
return c.conn.Close()
}