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 99e338e9ec
commit 4c5892dcab

View File

@ -445,7 +445,11 @@ func (c *Conn) sendAlertLocked(err alert) os.Error {
}
c.tmp[1] = byte(err)
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.