[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [flashproxy/master] Ignore errors that may happen while trying to write a Close frame.
commit 9302af93d7c8e02f01db3c0db25fabb661f1d8b6
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date: Sat Feb 2 22:27:15 2013 -0800
Ignore errors that may happen while trying to write a Close frame.
---
websocket-transport/websocket-server.go | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/websocket-transport/websocket-server.go b/websocket-transport/websocket-server.go
index e8ccd53..a0ba3d7 100644
--- a/websocket-transport/websocket-server.go
+++ b/websocket-transport/websocket-server.go
@@ -103,14 +103,10 @@ func (conn *websocketConn) Write(b []byte) (n int, err error) {
}
// Implements io.Closer.
-func (conn *websocketConn) Close() (err error) {
- err = conn.Ws.WriteFrame(8, nil)
- if err != nil {
- conn.Ws.Conn.Close()
- return
- }
- err = conn.Ws.Conn.Close()
- return
+func (conn *websocketConn) Close() error {
+ // Ignore any error in trying to write a Close frame.
+ _ = conn.Ws.WriteFrame(8, nil)
+ return conn.Ws.Conn.Close()
}
// Create a new websocketConn.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits