Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix UDP buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
bzEq committed Dec 15, 2023
1 parent bfe6890 commit ab80acd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (self *RawNetPort) Unpack(b *iovec.IoVec) error {
if err := self.C.SetReadDeadline(time.Now().Add(self.timeout)); err != nil {
return err
}
if self.lastRead == 0 {
if self.lastRead == 0 || self.lastRead < DEFAULT_UDP_BUFFER_SIZE {
self.lastRead = DEFAULT_BUFFER_SIZE
}
buf := make([]byte, self.lastRead*6/5)
Expand Down

0 comments on commit ab80acd

Please sign in to comment.