]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: don't return an error from Close()
authorAdam Langley <agl@golang.org>
Fri, 10 Sep 2010 19:55:35 +0000 (15:55 -0400)
committerAdam Langley <agl@golang.org>
Fri, 10 Sep 2010 19:55:35 +0000 (15:55 -0400)
Fixes #1037.

R=adg, rsc1
CC=golang-dev
https://golang.org/cl/2107048

src/pkg/crypto/tls/conn.go

index 2357297b754f18544f96445444f7f5bce4762e0e..85e76a00c0275ccd50ae90d81606574c1f16702f 100644 (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.