-
Notifications
You must be signed in to change notification settings - Fork 35
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
Enable socket reuse #29
base: master
Are you sure you want to change the base?
Conversation
update my fork from master
Existing code checks req.useChunkedEncodingByDefault, which prevents socket reuse for persistent connection.
@mgorczyca the tests in the request module seems to be passing with this fix, however I'm a bit wary about adding fixes without tests. And since this repository doesn't have any, can you add a failing test in the request repository instead? We have a test-agent.js file or something similar there. |
@simov the error which led to this PR occurred when attempting to use a SOAP https client that required authentication via login. Because the forever-agent code currently does not reuse the socket in the case of https and PUT, the login worked but the authentication did not persist. So, the next command (after login) could not execute. The simpler test case we have been using is to see that there is only one connect in the strace output after doing two PUTs on an https URL. Seeing two connects in the strace output indicates that the socket is not being reused, but does not result in an error. Given the context of the issue as described, what are your thoughts on the type of test case that would mesh well with the tests you already have? Thanks! |
@simov I have added a test for this fix in the request repository, in the test-agent.js file as you suggested. |
@mgorczyca @simov Is there any reason why Happy to add some tests to this module directly for the behaviour if there's no obvious reason to stick with |
@robinjmurphy, sure, feel free to add tests in request, as for why |
I started to write a basic test, but on further investigation it looks like I think this means that including the I haven't yet looked at the core pooling code in Node v4, but if keep alive is disabled for POST/PUT requests there, maybe there's a reason for it that we're missing? |
Existing code checks req.useChunkedEncodingByDefault, which prevents socket reuse for persistent connection.