Comparing version 3.0.4 to 3.1.0
@@ -179,3 +179,3 @@ var crypto = require('crypto'); | ||
// haven't received a connection message yet ! | ||
var err = new Error("Stream unexpectedly ended before getting ready for query execution"); | ||
var err = new Error('Connection was ended during query'); | ||
callback(err); | ||
@@ -186,3 +186,3 @@ callback = null; | ||
if(self.activeQuery) { | ||
var disconnectError = new Error('Stream unexpectedly ended during query execution'); | ||
var disconnectError = new Error('Connection was ended during query'); | ||
self.activeQuery.handleError(disconnectError, con); | ||
@@ -189,0 +189,0 @@ self.activeQuery = null; |
@@ -92,2 +92,6 @@ var net = require('net'); | ||
self.emit('sslconnect'); | ||
self.stream.on('error', function(error){ | ||
self.emit('error', error); | ||
}); | ||
}); | ||
@@ -289,2 +293,3 @@ }; | ||
this.writer.add(emptyBuffer); | ||
this._ending = true; | ||
this._send(0x53); | ||
@@ -296,4 +301,4 @@ }; | ||
this.writer.add(emptyBuffer); | ||
this._ending = true; | ||
this._send(0x58); | ||
this._ending = true; | ||
}; | ||
@@ -484,3 +489,3 @@ | ||
var DATA_ROW = 'dataRow'; | ||
var DataRowMessage = function(name, length, fieldCount) { | ||
var DataRowMessage = function(length, fieldCount) { | ||
this.name = DATA_ROW; | ||
@@ -487,0 +492,0 @@ this.length = length; |
@@ -22,7 +22,14 @@ var EventEmitter = require('events').EventEmitter; | ||
var self = this; | ||
Object.keys(self.pools.all).forEach(function(key) { | ||
var keys = Object.keys(self.pools.all); | ||
var count = keys.length; | ||
keys.forEach(function(key) { | ||
var pool = self.pools.all[key]; | ||
delete self.pools.all[key]; | ||
pool.drain(function() { | ||
pool.destroyAllNow(); | ||
pool.destroyAllNow(function() { | ||
count--; | ||
if(count === 0) { | ||
self.emit('end'); | ||
} | ||
}); | ||
}); | ||
@@ -32,2 +39,3 @@ }); | ||
PG.prototype.connect = function(config, callback) { | ||
@@ -34,0 +42,0 @@ if(typeof config == "function") { |
@@ -121,8 +121,3 @@ //require the c++ bindings & export to javascript | ||
if(!initialConnection) { | ||
//TODO remove all the pause-drain stuff for v1.0 | ||
if(this._drainPaused) { | ||
this._drainPaused++; | ||
} else { | ||
this.emit('drain'); | ||
} | ||
this.emit('drain'); | ||
} | ||
@@ -149,15 +144,2 @@ return; | ||
//TODO remove all the pause-drain stuff for v1.0 | ||
Connection.prototype.pauseDrain = function() { | ||
this._drainPaused = 1; | ||
}; | ||
//TODO remove all the pause-drain stuff for v1.0 | ||
Connection.prototype.resumeDrain = function() { | ||
if(this._drainPaused > 1) { | ||
this.emit('drain'); | ||
} | ||
this._drainPaused = 0; | ||
}; | ||
Connection.prototype.sendCopyFail = function(msg) { | ||
@@ -164,0 +146,0 @@ this.endCopyFrom(msg); |
@@ -44,3 +44,3 @@ var EventEmitter = require('events').EventEmitter; | ||
}); | ||
client.poolCount = 0; | ||
return cb(null, client); | ||
@@ -51,2 +51,3 @@ }); | ||
client._destroying = true; | ||
client.poolCount = undefined; | ||
client.end(); | ||
@@ -71,2 +72,3 @@ } | ||
if(err) return cb(err, null, function() {/*NOOP*/}); | ||
client.poolCount++; | ||
cb(null, client, function(err) { | ||
@@ -73,0 +75,0 @@ if(err) { |
{ | ||
"name": "pg.js", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "node-postgres without the bindings", | ||
@@ -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
62229
1972