Ver Fonte

codec: rpc: remove comments

Ugorji Nwoke há 7 anos atrás
pai
commit
e60e086af5
1 ficheiros alterados com 1 adições e 10 exclusões
  1. 1 10
      codec/rpc.go

+ 1 - 10
codec/rpc.go

@@ -104,7 +104,7 @@ func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2 bool) (err error) {
 		if err == nil {
 			err = c.f.Flush()
 		} else {
-			c.f.Flush()
+			_ = c.f.Flush() // swallow flush error, so we maintain prior error on write
 		}
 	}
 	return
@@ -144,15 +144,6 @@ func (c *rpcCodec) Close() error {
 	}
 	c.clsmu.Lock()
 	c.cls = true
-	// var fErr error
-	// if c.f != nil {
-	// 	fErr = c.f.Flush()
-	// }
-	// _ = fErr
-	// c.clsErr = c.c.Close()
-	// if c.clsErr == nil && fErr != nil {
-	// 	c.clsErr = fErr
-	// }
 	c.clsErr = c.c.Close()
 	c.clsmu.Unlock()
 	return c.clsErr