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

ConnState hook for StateActive not working #441

Closed
alxarch opened this issue Oct 23, 2018 · 3 comments
Closed

ConnState hook for StateActive not working #441

alxarch opened this issue Oct 23, 2018 · 3 comments

Comments

@alxarch
Copy link
Contributor

alxarch commented Oct 23, 2018

It seems that the ConnState hook is not called for a connection transitioning to StateActive. The hook call is inside an if that never evaluates to true since RequestHeader.tryRead() discards the header bytes before returning thus if r.Buffered() > 0 is always false for requests with no body.

@alxarch
Copy link
Contributor Author

alxarch commented Oct 23, 2018

Seems to be working OK with if err == nil here but i don't know if there are corner cases where a non nil err results in an non active connection.

@erikdubbelboer
Copy link
Collaborator

I think only setting it if err == nil should work. As you can see below it will always break out of the request loop if err != nil so it will never transition into an active connection state if err != nil.

alxarch added a commit to alxarch/fasthttp that referenced this issue Oct 23, 2018
erikdubbelboer pushed a commit that referenced this issue Oct 28, 2018
@erikdubbelboer
Copy link
Collaborator

Should be fixed in 1b3ac0c

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

No branches or pull requests

2 participants