Skip to content

Commit

Permalink
no pool
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 28, 2022
1 parent d9bb2b7 commit 8a8a00b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions dot/network/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ func (s *Service) readStream(stream libp2pnetwork.Stream, decoder messageDecoder
s.streamManager.logNewStream(stream)

peer := stream.Conn().RemotePeer()
buffer := s.bufPool.Get().(*[]byte)
defer s.bufPool.Put(buffer)
msgBytes := *buffer
msgBytes := make([]byte, maxMessageSize)

for {
n, err := readStream(stream, msgBytes[:])
Expand Down
4 changes: 1 addition & 3 deletions dot/network/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,7 @@ func (s *Service) readHandshake(stream libp2pnetwork.Stream, decoder HandshakeDe
go func() {
defer close(hsC)

buffer := s.bufPool.Get().(*[]byte)
defer s.bufPool.Put(buffer)
msgBytes := *buffer
msgBytes := make([]byte, maxMessageSize)

tot, err := readStream(stream, msgBytes[:])
if err != nil {
Expand Down

0 comments on commit 8a8a00b

Please sign in to comment.