mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Fix error handling at connection start.
This commit is contained in:
parent
965b59c9d5
commit
563545bd13
1 changed files with 4 additions and 3 deletions
|
@ -110,10 +110,11 @@ func startClient(conn *websocket.Conn) (err error) {
|
||||||
var m clientMessage
|
var m clientMessage
|
||||||
err = conn.ReadJSON(&m)
|
err = conn.ReadJSON(&m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
conn.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if m.Type != "handshake" {
|
if m.Type != "handshake" {
|
||||||
err = protocolError("expected handshake")
|
conn.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,7 +756,7 @@ func clientLoop(c *client, conn *websocket.Conn) error {
|
||||||
Type: "permissions",
|
Type: "permissions",
|
||||||
Permissions: c.permissions,
|
Permissions: c.permissions,
|
||||||
})
|
})
|
||||||
if(!c.permissions.Present) {
|
if !c.permissions.Present {
|
||||||
ids := getUpConns(c)
|
ids := getUpConns(c)
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
c.write(clientMessage{
|
c.write(clientMessage{
|
||||||
|
|
Loading…
Reference in a new issue