Skip to content

Commit

Permalink
[Filebeat][udp] - Remove unnecessary multiplication (#41211)
Browse files Browse the repository at this point in the history
Remove unnecessary multiplication

---------

Co-authored-by: Denis <[email protected]>
Co-authored-by: Kush Rana <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2024
1 parent cc4f951 commit 7ca9893
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions filebeat/inputsource/udp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ package udp
import (
"net"

"github.com/dustin/go-humanize"

"github.com/elastic/beats/v7/filebeat/inputsource"
"github.com/elastic/beats/v7/filebeat/inputsource/common/dgram"
"github.com/elastic/elastic-agent-libs/logp"
Expand Down Expand Up @@ -62,12 +60,13 @@ func (u *Server) createConn() (net.PacketConn, error) {
if err != nil {
return nil, err
}
socketSize := int(u.config.ReadBuffer) * humanize.KiByte
if socketSize != 0 {

if int(u.config.ReadBuffer) != 0 {
if err := listener.SetReadBuffer(int(u.config.ReadBuffer)); err != nil {
return nil, err
}
}

u.localaddress = listener.LocalAddr().String()

return listener, err
Expand Down

0 comments on commit 7ca9893

Please sign in to comment.