forked from External/ergo
initial work on #1483
Add the new utf8-only cap, disallow non-utf8 when websockets are enabled
This commit is contained in:
parent
5095a4d814
commit
db81b15acb
4 changed files with 18 additions and 12 deletions
|
|
@ -686,9 +686,12 @@ func (client *Client) run(session *Session) {
|
|||
if err == errInvalidUtf8 {
|
||||
invalidUtf8 = true // handle as normal, including labeling
|
||||
} else if err != nil {
|
||||
quitMessage := "connection closed"
|
||||
if err == errReadQ {
|
||||
quitMessage = "readQ exceeded"
|
||||
var quitMessage string
|
||||
switch err {
|
||||
case errReadQ, errWSBinaryMessage:
|
||||
quitMessage = err.Error()
|
||||
default:
|
||||
quitMessage = "connection closed"
|
||||
}
|
||||
client.Quit(quitMessage, session)
|
||||
// since the client did not actually send us a QUIT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue