mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
fixed protocol version
This commit is contained in:
parent
dea4424e97
commit
bdb4d28038
@ -35,10 +35,13 @@ p.connect = function() {
|
||||
var self = this;
|
||||
this.stream.on('connect', function() {
|
||||
var data = ['user',self.user,'database', self.database, '\0'].join('\0');
|
||||
var dataBuffer = Buffer(data, self.encoding);
|
||||
var fullBuffer = Buffer(4 + dataBuffer.length);
|
||||
self.writeInt32(fullBuffer, 0, 0x03);//write protocol version
|
||||
dataBuffer.copy(fullBuffer, 4, 0);
|
||||
var byteLength = Buffer.byteLength(data);
|
||||
var fullBuffer = new Buffer(byteLength + 4);
|
||||
fullBuffer[0] = 0;
|
||||
fullBuffer[1] = 3;
|
||||
fullBuffer[2] = 0;
|
||||
fullBuffer[3] = 0;
|
||||
fullBuffer.write(data, 4);
|
||||
self.send(null, fullBuffer);
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user