Skip to content

Commit 9c345c5

Browse files
committed
allow using user allocator
1 parent 09ffa8a commit 9c345c5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

std/crypto/tls/tls.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ func NewConn(conn net.Conn, config *Config, isClient bool, isNonBlock bool, v ..
4343
if isClient {
4444
c.handshakeFn = c.clientHandshake
4545
}
46-
// if len(v) > 0 {
47-
// if allocator, ok := v[0].(Allocator); ok {
48-
// c.allocator = allocator
49-
// }
50-
// }
51-
// if c.allocator == nil {
52-
// c.allocator = &NativeAllocator{}
53-
// }
54-
c.allocator = &NativeAllocator{}
46+
if len(v) > 0 {
47+
if allocator, ok := v[0].(Allocator); ok {
48+
c.allocator = allocator
49+
}
50+
}
51+
if c.allocator == nil {
52+
c.allocator = &NativeAllocator{}
53+
}
54+
// c.allocator = &NativeAllocator{}
5555
return c
5656
}
5757

0 commit comments

Comments
 (0)