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

Fix Connection.close on 0.10 upwards #246

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix Connection.close on 0.10 upwards #246

wants to merge 4 commits into from

Conversation

davedoesdev
Copy link
Contributor

I've left the old behaviour in - did HTTP Agent change at some point?

@indexzero
Copy link
Member

I like this but it would be cleaner to check if it an object and if it is then make the same array from the keys instead of having a big if / else block

@davedoesdev
Copy link
Contributor Author

@indexzero OK I updated it - is that along the lines you were thinking?

@davedoesdev
Copy link
Contributor Author

Without this fix, I'm still getting:

     should be able to close the Connection 
      TypeError: this.agent.sockets.forEach is not a function 
      at Connection.cradle.Connection.close (/home/david/cradle/lib/cradle.js:173:24) 
      at Object.vows.describe.addBatch.Default connection settings.should be able to close the Connection (/home/david/cradle/test/connection-test.js:29:15) 
      at runTest (/home/david/cradle/node_modules/vows/lib/vows.js:136:26) 
      at EventEmitter.<anonymous> (/home/david/cradle/node_modules/vows/lib/vows.js:81:9) 
      at emitOne (events.js:82:20) 
      at EventEmitter.emit (events.js:169:7) 
      at EventEmitter.options.Emitter.emit (/home/david/cradle/node_modules/vows/lib/vows.js:241:24) 
      at /home/david/cradle/node_modules/vows/lib/vows/suite.js:170:45 
      at nextTickCallbackWith0Args (node.js:415:9) 
      at process._tickCallback (node.js:344:13)

@davedoesdev davedoesdev changed the title Fix Connection.close on 0.10 Fix Connection.close on 0.10 upwards Apr 28, 2016
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