This commit is contained in:
xdrm-brackets 2018-05-05 23:53:06 +02:00
parent 14205a0b2e
commit 89124221fb
1 changed files with 5 additions and 5 deletions

View File

@ -173,9 +173,11 @@ func clientReader(c *client){
/* (6) Send PONG */ /* (6) Send PONG */
if msg.Type == PING { if msg.Type == PING {
// fmt.Printf("[reader] PING -> PONG\n") // fmt.Printf("[reader] PING -> PONG\n")
if c.io.writing {
msg.Final = true msg.Final = true
msg.Type = PONG msg.Type = PONG
c.ch.send <- *msg c.ch.send <- *msg
}
continue continue
} }
@ -280,8 +282,6 @@ func (c *client) close(status MessageError, clientACK bool){
Data: make([]byte, 2), Data: make([]byte, 2),
} }
binary.BigEndian.PutUint16(msg.Data, uint16(status)) binary.BigEndian.PutUint16(msg.Data, uint16(status))
// msg.Data = append(msg.Data, []byte("(closing)")...)
msg.Size = uint( len(msg.Data) )
/* (4) Send message */ /* (4) Send message */
err := msg.Send(c.io.sock) err := msg.Send(c.io.sock)