Skip to content

Commit

Permalink
Some details after elastic#8278 (elastic#8295)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano authored Sep 13, 2018
1 parent ab8e6b6 commit ff566e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff]
- Add experimental socket summary metricset to system module {pull}6782[6782]
- Increase ignore_above for system.process.cmdline to 2048. {pull}8101[8100]
- Add support to renamed fields planned for redis 5.0. {pull}8167[8167]
- Allow TCP helper to support delimiters. {pull}8278[8278]
- Allow TCP helper to support delimiters and graphite module to accept multiple metrics in a single payload. {pull}8278[8278]

*Packetbeat*

Expand Down
11 changes: 5 additions & 6 deletions metricbeat/helper/server/tcp/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,18 @@ func (g *TcpServer) watchMetrics() {
continue
}

if conn != nil {
go g.handle(conn)
}
go g.handle(conn)
}
}

func (g *TcpServer) handle(conn net.Conn) {
if conn == nil {
return
}
logp.Debug("tcp", "Handling new connection...")

// Close connection when this function ends
defer func() {
conn.Close()
}()
defer conn.Close()

// Get a new reader with buffer size as the same as receiveBufferSize
bufReader := bufio.NewReaderSize(conn, g.receiveBufferSize)
Expand Down

0 comments on commit ff566e7

Please sign in to comment.