Skip to content

Commit 5f394b6

Browse files
author
mobus
committed
fix: nil pointer
1 parent 94dddf7 commit 5f394b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

netpoll/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type context struct {
8888
writing sync.Mutex
8989
upgrade bool
9090
conn net.Conn
91-
pool linear_ac.Allocator
91+
pool *linear_ac.Allocator
9292
buffer []byte
9393
}
9494

@@ -119,7 +119,7 @@ func (h *DataHandler) Upgrade(conn net.Conn) (Context, error) {
119119
if h.NoShared {
120120
ctx.buffer = make([]byte, h.BufferSize)
121121
} else {
122-
ctx.pool = *linear_ac.NewLinearAc()
122+
ctx.pool = linear_ac.BindNew()
123123
}
124124
return ctx, nil
125125
}

0 commit comments

Comments
 (0)