Skip to content

Commit

Permalink
save changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lxzan committed Jul 20, 2023
1 parent 229c2a1 commit 9120b96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ func TestBufferPool(t *testing.T) {

pool.Put(nil, 0)
pool.Put(NewBufferWithCap(0), 0)
buffer, _ := pool.Get(128 * 1024)
as.GreaterOrEqual(buffer.Cap(), 128*1024)
buffer, _ := pool.Get(256 * 1024)
as.GreaterOrEqual(buffer.Cap(), 256*1024)
}
2 changes: 1 addition & 1 deletion upgrader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func TestBuiltinEventEngine(t *testing.T) {

ev.OnOpen(nil)
ev.OnClose(nil, nil)
ev.OnMessage(nil, nil)
ev.OnMessage(nil, &Message{})
ev.OnPing(nil, nil)
ev.OnPong(nil, nil)
}
3 changes: 1 addition & 2 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ func (c *Conn) WritePong(payload []byte) error {
}

// WriteString write text frame
// force convert string to []byte
func (c *Conn) WriteString(s string) error {
return c.WriteMessage(OpcodeText, []byte(s))
return c.WriteMessage(OpcodeText, internal.StringToBytes(s))
}

// WriteAsync 异步非阻塞地写入消息
Expand Down

0 comments on commit 9120b96

Please sign in to comment.