-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
👍 Awesome! Thank you @dignifiedquire , want me to merge it now or want to add more tests to this PR? |
@diasdavid found my first bug while adding tests :) |
Needs libp2p/js-spdy-stream-muxer#3 to pass the tests |
@@ -20,7 +20,7 @@ function Swarm () { | |||
|
|||
self.port = parseInt(process.env.IPFS_SWARM_PORT, 10) || 4001 | |||
self.connections = {} // {peerIdB58: {conn: <>, socket: <>} | |||
self.handles = [] | |||
self.handles = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason on having handles as an object instead of an array? I see you changed the looped and both work fine. I might just be missing a perf improv, perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No perf reason but the lookup you were trying to do if there was alread a handler wasn't working, so I changed it to an object, as otherwise we would have to search the whole list to check if we already have a handler.
Thank you @dignifiedquire, this looking very good! I've went ahead and merged this PR, so that you don't have to be "linking" the patched version of spdy-stream-muxer. Plus is awesome to have bugs fixes pushed :) That was ⭐️ |
Thanks happy to help, even though I still don't understand all the dark connection magic. Btw you need to turn on travis, otherwise that badge will stay gray ;) |
Very slowly I'm getting to know the code base. Hopefully more interesting tests coming soon.