diff --git a/src/identify.js b/src/identify.js index 559644b8..5746fa95 100644 --- a/src/identify.js +++ b/src/identify.js @@ -15,8 +15,6 @@ function Identify (swarm, peerSelf) { var self = this swarm.registerHandler('/ipfs/identify/1.0.0', function (stream) { - console.log('DO I EVER GET CALLED?') - var identifyMsg = {} identifyMsg = {} identifyMsg.sender = exportPeer(peerSelf) @@ -42,22 +40,12 @@ function Identify (swarm, peerSelf) { }) swarm.on('connection-unknown', function (conn) { - console.log('IDENTIFY - DIALING STREAM FROM SERVER') - - conn.on('error', function (err) { - console.log('CAPUT-A', err) - }) conn.dialStream(function (err, stream) { if (err) { return console.log(err) } - stream.on('error', function (err) { - console.log('CAPUT-B', err) - }) - console.log('GOT STREAM') var msi = new Interactive() msi.handle(stream, function () { - console.log('HANDLE GOOD') msi.select('/ipfs/identify/1.0.0', function (err, ds) { if (err) { return console.log(err) } var identifyMsg = {} @@ -78,7 +66,6 @@ function Identify (swarm, peerSelf) { swarm.connections[answer.sender.id] = conn - console.log('BAM') self.emit('peer-update', answer) }) diff --git a/src/swarm.js b/src/swarm.js index 06ee8ffb..bf5ae5ce 100644 --- a/src/swarm.js +++ b/src/swarm.js @@ -35,10 +35,7 @@ function Swarm () { // self.listener = tcp.createServer(function (socket) { - socket.on('error', function (err) { - console.log('listener socket err - ', err) - }) - + errorUp(self, socket) var ms = new Select() ms.handle(socket) ms.addHandler('/spdy/3.1.0', function (ds) { @@ -48,13 +45,6 @@ function Swarm () { // attach multistream handlers to incoming streams - conn.on('stream', function () { - console.log('HERE') - }) - conn.on('error', function () { - console.log('error here') - }) - conn.on('stream', registerHandles) errorUp(self, conn) @@ -109,12 +99,6 @@ function Swarm () { if (err) { cb(err) } var conn = new Muxer().attach(ds, false) - conn.on('stream', function () { - console.log('WOOHO NEW STREAM') - }) - conn.on('error', function () { - console.log('BADUM TSS') - }) conn.on('stream', registerHandles) self.connections[peer.id.toB58String()] = conn conn.on('close', function () { delete self.connections[peer.id.toB58String()] }) @@ -131,9 +115,6 @@ function Swarm () { conn.dialStream(function (err, stream) { if (err) { return cb(err) } errorUp(self, stream) - stream.on('error', function (err) { - console.log('error here - ', err) - }) // negotiate desired protocol var msi = new Interactive() msi.handle(stream, function () { @@ -147,9 +128,7 @@ function Swarm () { } self.registerHandler = function (protocol, handlerFunc) { - console.log('new handler coming in for - ', protocol) if (self.handles[protocol]) { - console.log('here already - ', protocol) return handlerFunc(new Error('Handle for protocol already exists', protocol)) } self.handles.push({ protocol: protocol, func: handlerFunc }) @@ -174,12 +153,10 @@ function Swarm () { function registerHandles (stream) { log.info('Registering protocol handlers on new stream') - console.log('REGISTERING HANDLES') errorUp(self, stream) var msH = new Select() msH.handle(stream) self.handles.forEach(function (handle) { - console.log(' ->', handle.protocol) msH.addHandler(handle.protocol, handle.func) }) } diff --git a/tests/swarm-test.js b/tests/swarm-test.js index 807ae8f0..b696f94a 100644 --- a/tests/swarm-test.js +++ b/tests/swarm-test.js @@ -96,7 +96,6 @@ experiment('IDENTIFY', function () { }) identifyB.on('peer-update', function (answer) { - console.log('SUCH PEER-UPDATE') done() }) identifyA.on('peer-update', function (answer) {})