From: Graham Miller Date: Tue, 8 Feb 2011 20:42:31 +0000 (-0800) Subject: netchan: graceful handling of closed connection X-Git-Tag: weekly.2011-02-15~72 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=69334ee62ba8bdfd754e8c38eb6b90768e2d3807;p=gostls13.git netchan: graceful handling of closed connection Currently, when an importer closes the connection, the exporter gives an error message 'netchan export: error decoding client header:EOF'. This change causes the exporter to look for an EOF during the parse of the header, and silences the log message in that case. R=r CC=golang-dev, rog https://golang.org/cl/4132044 --- diff --git a/src/pkg/netchan/export.go b/src/pkg/netchan/export.go index 0b28536edf..675e252d5c 100644 --- a/src/pkg/netchan/export.go +++ b/src/pkg/netchan/export.go @@ -118,7 +118,9 @@ func (client *expClient) run() { for { *hdr = header{} if err := client.decode(hdrValue); err != nil { - expLog("error decoding client header:", err) + if err != os.EOF { + expLog("error decoding client header:", err) + } break } switch hdr.PayloadType {