Skip to content

Commit

Permalink
server: fix Setting wait_timeout to 0 doesn't take effect #23351 (#23443
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Howie59 authored Apr 1, 2021
1 parent 2e30ac3 commit 2c83f2d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/packetio.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ func (p *packetIO) readOnePacket() ([]byte, error) {
}

func (p *packetIO) readPacket() ([]byte, error) {
if p.readTimeout == 0 {
if err := p.bufReadConn.SetReadDeadline(time.Time{}); err != nil {
return nil, errors.Trace(err)
}
}
data, err := p.readOnePacket()
if err != nil {
return nil, errors.Trace(err)
Expand Down

0 comments on commit 2c83f2d

Please sign in to comment.