1
0
mirror of https://github.com/golang/go synced 2024-11-24 11:50:15 -07:00

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
This commit is contained in:
Graham Miller 2011-02-08 12:42:31 -08:00 committed by Rob Pike
parent b9183b986a
commit 69334ee62b

View File

@ -118,7 +118,9 @@ func (client *expClient) run() {
for { for {
*hdr = header{} *hdr = header{}
if err := client.decode(hdrValue); err != nil { if err := client.decode(hdrValue); err != nil {
expLog("error decoding client header:", err) if err != os.EOF {
expLog("error decoding client header:", err)
}
break break
} }
switch hdr.PayloadType { switch hdr.PayloadType {