mongodb-core
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -0,1 +1,5 @@ | ||
1.2.4 07-07-2015 | ||
----------------- | ||
- NODE-493 staggering the socket connections to avoid overwhelming the mongod process. | ||
1.2.3 06-26-2015 | ||
@@ -2,0 +6,0 @@ ----------------- |
@@ -17,2 +17,3 @@ module.exports = { | ||
, GSSAPI: require('./lib/auth/gssapi') | ||
} | ||
, ScramSHA1: require('./lib/auth/scram') | ||
} |
@@ -77,2 +77,5 @@ "use strict"; | ||
// If connection was destroyed | ||
this.destroyed = false; | ||
// Check if we have a domain socket | ||
@@ -379,2 +382,3 @@ this.domainSocket = this.host.indexOf('\/') != -1; | ||
if(this.connection) this.connection.destroy(); | ||
this.destroyed = true; | ||
} | ||
@@ -388,8 +392,5 @@ | ||
Connection.prototype.write = function(buffer) { | ||
// console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ connection") | ||
// console.log(Array.isArray(buffer)) | ||
// Debug log | ||
if(this.logger.isDebug()) this.logger.debug(f('writing buffer [%s] to %s:%s', buffer.toString('hex'), this.host, this.port)); | ||
// Write out the command | ||
// this.connection.write(buffer, 'binary'); | ||
if(!Array.isArray(buffer)) return this.connection.write(buffer, 'binary'); | ||
@@ -424,2 +425,3 @@ // Iterate over all buffers and write them in order to the socket | ||
Connection.prototype.isConnected = function() { | ||
if(this.destroyed) return false; | ||
return !this.connection.destroyed && this.connection.writable; | ||
@@ -426,0 +428,0 @@ } |
@@ -49,3 +49,3 @@ "use strict"; | ||
this.options = options || {}; | ||
this.size = typeof options.size == 'number' ? options.size : 5; | ||
this.size = typeof options.size == 'number' ? options.size : 5; | ||
// Message handler | ||
@@ -169,18 +169,27 @@ this.messageHandler = options.messageHandler; | ||
this.dead = false; | ||
// Ensure we allow for a little time to setup connections | ||
var wait = 1; | ||
// Connect all sockets | ||
for(var i = 0; i < this.size; i++) { | ||
execute(function() { | ||
self.options.messageHandler = self.messageHandler; | ||
var connection = new Connection(self.options); | ||
// Add all handlers | ||
connection.once('close', closeHandler(self)); | ||
connection.once('error', errorHandler(self)); | ||
connection.once('timeout', timeoutHandler(self)); | ||
connection.once('parseError', parseErrorHandler(self)); | ||
connection.on('connect', connectHandler(self)); | ||
setTimeout(function() { | ||
execute(function() { | ||
self.options.messageHandler = self.messageHandler; | ||
var connection = new Connection(self.options); | ||
// Start connection | ||
connection.connect(_options); | ||
}); | ||
// Add all handlers | ||
connection.once('close', closeHandler(self)); | ||
connection.once('error', errorHandler(self)); | ||
connection.once('timeout', timeoutHandler(self)); | ||
connection.once('parseError', parseErrorHandler(self)); | ||
connection.on('connect', connectHandler(self)); | ||
// Start connection | ||
connection.connect(_options); | ||
}); | ||
}, wait); | ||
// wait for 1 miliseconds before attempting to connect, spacing out connections | ||
wait = wait + 1; | ||
} | ||
@@ -230,3 +239,3 @@ } | ||
return this.state == DESTROYED; | ||
} | ||
} | ||
@@ -233,0 +242,0 @@ |
@@ -465,2 +465,3 @@ "use strict"; | ||
} | ||
// Cursor is killed return null | ||
@@ -467,0 +468,0 @@ if(isCursorKilled(self, callback)) return; |
@@ -138,6 +138,6 @@ "use strict"; | ||
var createWireProtocolHandler = function(result) { | ||
// 3.2 wire protocol handler | ||
if(result && result.maxWireVersion >= 4) { | ||
return new ThreeTwoWireProtocolSupport(new TwoSixWireProtocolSupport()); | ||
} | ||
// // 3.2 wire protocol handler | ||
// if(result && result.maxWireVersion >= 4) { | ||
// return new ThreeTwoWireProtocolSupport(new TwoSixWireProtocolSupport()); | ||
// } | ||
@@ -144,0 +144,0 @@ // 2.6 wire protocol handler |
{ | ||
"name": "mongodb-core", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Core MongoDB driver functionality, no bells and whistles and meant for integration not end applications", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
418023
8442