lnrpc: fix WS close error

Fixes the logged error "WS: error closing upgraded conn: tls: failed to
send closeNotify alert (but connection was closed anyway): write tcp4
<ip>-><ip>: write: connection reset by peer" that is caused by the
client closing the connection on its end.
This commit is contained in:
Oliver Gugger committed 2021-04-29 10:39:12 +02:00
1 parent 993167f14e
commit 5e7b905f19
1 file changed
+3
+3
View File
@@ -372,6 +372,9 @@ func IsClosedConnError(err error) bool {
if strings.Contains(str, "broken pipe") {
return true
}
if strings.Contains(str, "connection reset by peer") {
return true
}
return websocket.IsCloseError(
err, websocket.CloseNormalClosure, websocket.CloseGoingAway,
)