Skip to content

Conversation

@truemedian
Copy link
Contributor

The connection pool is implemented as a TailQueue linked list, as there shouldn't be too many connections to loop over.

This should also fix a few problems that people were having where the server would try to read more data than the server was sending, leaving them in a deadlock.

Redirected requests now always read the content associated with the redirect, but the data is voided. This is required to prepare the connection for another request (but could potentially be avoided on a Connection:close)

Copy link
Contributor

@alichraghi alichraghi left a comment

Choose a reason for hiding this comment

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

test-filetimestamp.tmp what's this? lol

@truemedian
Copy link
Contributor Author

Really good question, not sure how I missed that or what that came from.

@kcbanner
Copy link
Contributor

kcbanner commented Mar 3, 2023

Really good question, not sure how I missed that or what that came from.

I've seen that file sometimes get leftover by running the tests.

@truemedian truemedian changed the title std.http: add connection pooling and make keep-alive requests by default std.http: add connection pooling, handle keep-alive and compressed content Mar 7, 2023
@andrewrk
Copy link
Member

andrewrk commented Mar 9, 2023

It looks good; I'd like to merge it.

How have you been testing it? Do you have any inclination to help out with adding a testing system for this stuff?

@truemedian
Copy link
Contributor Author

I've currently been testing the new features against http://httpbin.org (in http, to bypass all of the tls bugs in std.crypto). I can't really fuzz it against anything but it has worked for all of the things I've tested it against.

I don't see a way to seriously test std.http.Client without first implementing a std.http.Server to test against.

@andrewrk andrewrk enabled auto-merge March 9, 2023 20:56
@andrewrk andrewrk merged commit 7c9ed45 into ziglang:master Mar 10, 2023
@truemedian truemedian deleted the http-keepalive branch April 13, 2023 03:15
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.

4 participants