1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-23 15:37:01 +00:00

Add missing Close calls

The SMTP courier was not properly closing the connection, and chasquid's
closing of incoming connections was not ideal (it was closing the
underlying one, not necessarily the active one, like in the case of a jump
to TLS).

This patch fixes both by adding the missing calls to Close.
This commit is contained in:
Alberto Bertogli
2016-10-08 12:16:27 +01:00
parent dbe3843e12
commit 08a5d19941
2 changed files with 6 additions and 1 deletions

View File

@@ -445,8 +445,12 @@ type Conn struct {
commandTimeout time.Duration
}
func (c *Conn) Close() {
c.netconn.Close()
}
func (c *Conn) Handle() {
defer c.netconn.Close()
defer c.Close()
c.tr = trace.New("SMTP.Conn", c.netconn.RemoteAddr().String())
defer c.tr.Finish()