summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-04-06 08:08:02 +0700
committerShulhan <ms@kilabit.info>2021-04-06 08:08:02 +0700
commitd3cd3a6a6fcadc2f022c3965f54e238c791b9ca9 (patch)
treebcaa45829b1b63ed5b5d31139361fa5f668af672
parentdc303a8dab42522181e401687f1363c7bb11874b (diff)
downloadpakakeh.go-d3cd3a6a6fcadc2f022c3965f54e238c791b9ca9.tar.xz
websocket: suppress error on calling handleClose
The handleClose is a function that will be called when client receive control CLOSE frame from server. Default handle is to response with control CLOSE frame with the same payload. This field is not exported, and only defined to allow testing.
-rw-r--r--lib/websocket/client.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/websocket/client.go b/lib/websocket/client.go
index 9c8dec60..35355a06 100644
--- a/lib/websocket/client.go
+++ b/lib/websocket/client.go
@@ -605,7 +605,7 @@ func (cl *Client) handleFrame(frame *Frame) (isClosing bool) {
if cl.gracefulClose != nil {
cl.gracefulClose <- true
} else {
- cl.handleClose(cl, frame)
+ _ = cl.handleClose(cl, frame)
}
return true
case OpcodePing:
@@ -619,7 +619,7 @@ func (cl *Client) handleFrame(frame *Frame) (isClosing bool) {
if cl.HandleRsvControl != nil {
_ = cl.HandleRsvControl(cl, frame)
} else {
- cl.handleClose(cl, frame)
+ _ = cl.handleClose(cl, frame)
isClosing = true
}
}