From: Adam Langley Date: Mon, 11 Oct 2010 14:41:01 +0000 (-0400) Subject: crypto/tls: make SetReadTimeout work. X-Git-Tag: weekly.2010-10-13~37 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2d8e2482cc0f290042f49dc3628922dcf40db5c9;p=gostls13.git crypto/tls: make SetReadTimeout work. Fixes #1181. R=rsc, agl1, cw, r2 CC=golang-dev https://golang.org/cl/2414041 --- diff --git a/src/pkg/crypto/tls/conn.go b/src/pkg/crypto/tls/conn.go index 9bf9f21851..b18cda7bba 100644 --- a/src/pkg/crypto/tls/conn.go +++ b/src/pkg/crypto/tls/conn.go @@ -598,7 +598,10 @@ func (c *Conn) Read(b []byte) (n int, err os.Error) { defer c.in.Unlock() for c.input == nil && c.err == nil { - c.readRecord(recordTypeApplicationData) + if err := c.readRecord(recordTypeApplicationData); err != nil { + // Soft error, like EAGAIN + return 0, err + } } if c.err != nil { return 0, c.err