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

Directly read HTTP response from connection instead of copying to byt… #79

Merged
merged 2 commits into from
Sep 23, 2022

Conversation

anuraaga
Copy link
Contributor

…es first.

Currently, there are cases where go-ftw will block until read timeout even after getting a whole HTTP response. I'm not exactly sure what causes it (I notice in my tests when Envoy returns an error response directly without proxying it seems to happen), but it sort of makes sense - usually you'd expect to need to parse the HTTP response to know when it's done since a connection is just otherwise a stream of bytes, so I'm actually less sure why it wouldn't always be blocking until read timeout.

This changes to parse straight into the HTTP response so HTTP semantics correctly let the response parsing finish when it's done, now I see some tests that always passed after 1s taking the expected several ms.

ftwhttp/connection.go Show resolved Hide resolved
ftwhttp/connection.go Show resolved Hide resolved
@fzipi fzipi merged commit fd953f4 into coreruleset:main Sep 23, 2022
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