1
0
mirror of https://github.com/golang/go synced 2024-11-22 08:14:40 -07:00

crypto/tls: don't return an error from Close()

Fixes #1037.

R=adg, rsc1
CC=golang-dev
https://golang.org/cl/2107048
This commit is contained in:
Adam Langley 2010-09-10 15:55:35 -04:00
parent 0f5830b9c3
commit 5011c27018

View File

@ -445,7 +445,11 @@ func (c *Conn) sendAlertLocked(err alert) os.Error {
} }
c.tmp[1] = byte(err) c.tmp[1] = byte(err)
c.writeRecord(recordTypeAlert, c.tmp[0:2]) c.writeRecord(recordTypeAlert, c.tmp[0:2])
return c.setError(&net.OpError{Op: "local error", Error: err}) // closeNotify is a special case in that it isn't an error:
if err != alertCloseNotify {
return c.setError(&net.OpError{Op: "local error", Error: err})
}
return nil
} }
// sendAlert sends a TLS alert message. // sendAlert sends a TLS alert message.