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

let ErrTimeout temporary #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

fatedier
Copy link
Contributor

@fatedier fatedier commented Jun 28, 2023

ErrTimeout should be temporary, just like the standard packages in Golang.

// Read header, payload.
if err := c.readFromUntil(c.conn, recordHeaderLen); err != nil {
    // RFC 8446, Section 6.1 suggests that EOF without an alertCloseNotify
    // is an error, but popular web sites seem to do this, so we accept it
    // if and only if at the record boundary.
    if err == io.ErrUnexpectedEOF && c.rawInput.Len() == 0 {
        err = io.EOF
    }
    if e, ok := err.(net.Error); !ok || !e.Temporary() {
        c.in.setErrorLocked(err)
    }
    return err
}

When we use tls.Conn to wrap yamux.Stream, if a read deadline occurs, it will cause subsequent read operations to fail continuously because e.Temporary() returns false, indicating a permanent error.

@jefferai @dadgar PTAL

@prashil-g
Copy link

@tgross Can you help merge this PR
@fatedier FRPS uses very old version on this pinned commit. should we rebase and pin the newer commit if merge is taking time?

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.

2 participants