Skip to content

[Filebeat] udp input - unneccessary multiplication by KiB #41131

@andrewkroh

Description

@andrewkroh

socketSize := int(u.config.ReadBuffer) * humanize.KiByte
if socketSize != 0 {
if err := listener.SetReadBuffer(int(u.config.ReadBuffer)); err != nil {

There is no need to multiple the config.ReadBuffer by the size of KiB. The value is already converted into the user's specified unit type when the config is unmarshaled. And secondly, the resulting value is only used in the context of checking if it is non-zero.

So just remove the entire declaration of the socketSize variable in this code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions