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

[http] Handle aborted http Requests #450

Closed
wants to merge 2 commits into from
Closed

[http] Handle aborted http Requests #450

wants to merge 2 commits into from

Conversation

zekth
Copy link
Contributor

@zekth zekth commented May 24, 2019

fix: #442

All the reward go to @MarkTiedemann . Great work on investigation.

Btw we may need to think about working on some e2e tests for the server, handling aborted connections etc. (dial does not provide this capability atm)

11: {
in: "ToTAlly \\ Non REAdable HTTTTTTp pRotOcOlz",
err: "EOF",
headers: []
Copy link
Member

Choose a reason for hiding this comment

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

This test doesn't demonstrate the error. When I run it without your other change, it passes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mm you're right. We may work on a way to mock the request flow in the test runner. I'll try to find a way.

Copy link
Member

Choose a reason for hiding this comment

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

Have you looked at these tests? https://github.com/golang/go/blob/master/src/net/http/requestwrite_test.go

They're quite nice. I think we need to add ResponseWriter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case it will not be revelant because we will not write the response. But yes it would be a good addition sure. Adding this in another PR?

@zekth zekth changed the title Handle aborted http Requests [http] Handle aborted http Requests May 24, 2019
});
// in case of wrong first line HTTP header or
// aborted request we don't have to respond
if (req) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we still run the risk of responding to the previous request.
This could be fixed by adding req = undefined to the start of the while loop above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH i don't know if this case could happen. As i haven't found a way to test it. I trust you on this.

@bartlomieju
Copy link
Member

I believe this issue was resolved by #546, can we close this PR now?

@MarkTiedemann
Copy link
Contributor

Yes, I think this is fixed, but not yet released.

@ry
Copy link
Member

ry commented Jul 30, 2019

Closing... thanks @zekth

@ry ry closed this Jul 30, 2019
@zekth zekth deleted the fix_442 branch July 30, 2019 12:14
inverted-capital pushed a commit to dreamcatcher-tech/napps that referenced this pull request Oct 24, 2024
This also includes some related cleanups and fixes.
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.

Error "Cannot read property 'w' of null at iterateHttpRequests" on aborted connections
5 participants