Skip to content

Commit a58e329

Browse files
committed
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.
1 parent 21c21b7 commit a58e329

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

brontide/conn.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ func (c *Conn) Flush() (int, error) {
234234
//
235235
// Part of the net.Conn interface.
236236
func (c *Conn) Close() error {
237-
// TODO(roasbeef): reset brontide state?
237+
// Clear the state we created to be able to handle this connection.
238+
c.noise = nil
239+
c.readBuf = bytes.Buffer{}
240+
238241
return c.conn.Close()
239242
}
240243

0 commit comments

Comments
 (0)