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

存在err被覆盖导致无法触发的bug #85

Closed
cs-charles opened this issue Jun 5, 2021 · 1 comment · Fixed by #88
Closed

存在err被覆盖导致无法触发的bug #85

cs-charles opened this issue Jun 5, 2021 · 1 comment · Fixed by #88

Comments

@cs-charles
Copy link
Contributor

case err == nil && headerSeen != headerSeenAll:

由于在遍历请求头时,触发对请求头Connection校验的错误,之后触发onHost或者onHeader方法,但是由于onHost或者onHeader方法返回nil,导致原本err=ErrHandshakeBadConnection被nil覆盖。建议用临时变量接收onHost和onHeader返回的错误,只有错误不为空才赋值给err变量。
if onHost := u.OnHost; onHost != nil {
if e := onHost(c, v);e != nil; {
err = e
}
}

if onHeader := u.OnHeader; onHeader != nil {
if e := onHeader(c, k, v);e != nil {
err = e
}
}

cs-charles pushed a commit to cs-charles/gev that referenced this issue Jun 5, 2021
cs-charles pushed a commit to cs-charles/gev that referenced this issue Jun 7, 2021
Allenxuxu pushed a commit that referenced this issue Jun 7, 2021
* bugfix: fix(#85)

Co-authored-by: charlesxie <charlesxie@tencent.com>
cs-charles pushed a commit to cs-charles/gev that referenced this issue Jun 7, 2021
Allenxuxu pushed a commit that referenced this issue Jun 7, 2021
Co-authored-by: charlesxie <charlesxie@tencent.com>
@Allenxuxu
Copy link
Owner

#88

@Allenxuxu Allenxuxu linked a pull request Jun 8, 2021 that will close this issue
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 a pull request may close this issue.

2 participants