diff --git a/package.json b/package.json index d5d93a26..a53645ca 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "scripts": { "test": "./node_modules/.bin/lab tests/*-test.js", "coverage": "./node_modules/.bin/lab -t 88 tests/*-test.js", - "laf": "./node_modules/.bin/standard --format", "lint": "./node_modules/.bin/standard" }, "repository": { diff --git a/src/identify/index.js b/src/identify/index.js index 181cd380..e7a857c4 100644 --- a/src/identify/index.js +++ b/src/identify/index.js @@ -38,14 +38,14 @@ function identify (muxedConns, peerInfoSelf, socket, conn, muxer) { socket: socket } - // TODO: Pass the new discovered info about the peer that contacted us - // to something like the Kademlia Router, so the peerInfo for this peer - // is fresh - // - before this was exectued through a event emitter - // self.emit('peer-update', { - // peerId: peerId, - // listenAddrs: msg.listenAddrs.map(function (mhb) {return multiaddr(mhb)}) - // }) + // TODO: Pass the new discovered info about the peer that contacted us + // to something like the Kademlia Router, so the peerInfo for this peer + // is fresh + // - before this was exectued through a event emitter + // self.emit('peer-update', { + // peerId: peerId, + // listenAddrs: msg.listenAddrs.map(function (mhb) {return multiaddr(mhb)}) + // }) }) var mh = getMultiaddr(socket) diff --git a/src/swarm.js b/src/swarm.js index 1cfff095..2fa4f5d4 100644 --- a/src/swarm.js +++ b/src/swarm.js @@ -67,9 +67,7 @@ function Swarm (peerInfo) { }) } - self.addUpgrade = function (ConnUpgrade, options) { - - } + self.addUpgrade = function (ConnUpgrade, options) {} self.addStreamMuxer = function (name, StreamMuxer, options) { self.muxers[name] = { @@ -260,7 +258,7 @@ function Swarm (peerInfo) { // we pass muxedConns so that identify can access the socket of the other // peer self.handleProtocol(identify.protoId, - identify.getHandlerFunction(self.peerInfo, self.muxedConns)) + identify.getHandlerFunction(self.peerInfo, self.muxedConns)) } self.handleProtocol = function (protocol, handlerFunction) { @@ -299,7 +297,7 @@ function Swarm (peerInfo) { muxer.on('stream', userProtocolMuxer) }) } else { - // if no stream muxer, then + // if no stream muxer, then userProtocolMuxer(conn) } } diff --git a/tests/swarm-test.js b/tests/swarm-test.js index 7975abf2..bf5baeaa 100644 --- a/tests/swarm-test.js +++ b/tests/swarm-test.js @@ -32,15 +32,15 @@ experiment('Without a Stream Muxer', function () { var sw = new Swarm(p) sw.addTransport('tcp', tcp, - { multiaddr: mh }, {}, {port: 8010}, function () { - expect(sw.transports['tcp'].options).to.deep.equal({ multiaddr: mh }) - expect(sw.transports['tcp'].dialOptions).to.deep.equal({}) - expect(sw.transports['tcp'].listenOptions).to.deep.equal({port: 8010}) - expect(sw.transports['tcp'].transport).to.deep.equal(tcp) - sw.closeListener('tcp', function () { - done() + { multiaddr: mh }, {}, {port: 8010}, function () { + expect(sw.transports['tcp'].options).to.deep.equal({ multiaddr: mh }) + expect(sw.transports['tcp'].dialOptions).to.deep.equal({}) + expect(sw.transports['tcp'].listenOptions).to.deep.equal({port: 8010}) + expect(sw.transports['tcp'].transport).to.deep.equal(tcp) + sw.closeListener('tcp', function () { + done() + }) }) - }) }) test('dial a conn', function (done) { @@ -185,9 +185,9 @@ experiment('Without a Stream Muxer', function () { } }) - // test('add an upgrade', function (done) { done() }) - // test('dial a conn on top of a upgrade', function (done) { done() }) - // test('dial a conn on a protocol on top of a upgrade', function (done) { done() }) + // test('add an upgrade', function (done) { done() }) + // test('dial a conn on top of a upgrade', function (done) { done() }) + // test('dial a conn on a protocol on top of a upgrade', function (done) { done() }) }) /* TODO @@ -210,15 +210,15 @@ experiment('Without a Stream Muxer', function () { test('dial a conn on a protocol on top of a upgrade', function (done) { done() }) }) */ - /* TODO - experiment('utp', function () { - test('add the transport', function (done) { done() }) - test('dial a conn', function (done) { done() }) - test('dial a conn on a protocol', function (done) { done() }) - test('add an upgrade', function (done) { done() }) - test('dial a conn on top of a upgrade', function (done) { done() }) - test('dial a conn on a protocol on top of a upgrade', function (done) { done() }) - }) */ +/* TODO +experiment('utp', function () { + test('add the transport', function (done) { done() }) + test('dial a conn', function (done) { done() }) + test('dial a conn on a protocol', function (done) { done() }) + test('add an upgrade', function (done) { done() }) + test('dial a conn on top of a upgrade', function (done) { done() }) + test('dial a conn on a protocol on top of a upgrade', function (done) { done() }) +}) */ }) experiment('With a SPDY Stream Muxer', function () {