Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle DATA read timeouts #197

Closed
wants to merge 1 commit into from

Conversation

kayrus
Copy link
Contributor

@kayrus kayrus commented Aug 17, 2022

Resolves #196

if err != nil {
break
}
if e, ok := err.(net.Error); ok && e.Timeout() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, so this checks a SetReadDeadline error? Weird, I would've expected to check the ReadByte error instead?

BTW, a better way to check for the timeout is: errors.Is(err, os.ErrDeadlineExceeded) (see https://pkg.go.dev/net#Conn).

@emersion
Copy link
Owner

See #196 (comment)

@emersion emersion closed this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server: DATA command timeout should close the connection
2 participants