mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
start to handle other auth messages
This commit is contained in:
parent
ec5f1b8831
commit
52a0d0459d
@ -54,10 +54,16 @@ p.parseMessage = function() {
|
||||
|
||||
p.parseR = function(msg) {
|
||||
if(msg.length == 8) {
|
||||
this.offset += 4;
|
||||
msg.code = this.parseInt32();
|
||||
}
|
||||
if(msg.code == 0) {
|
||||
return msg;
|
||||
}
|
||||
throw new Error("Unknown authenticatinOk message type");
|
||||
if(msg.code == 3) {
|
||||
msg.name = 'authenticationCleartextPassword';
|
||||
return msg;
|
||||
}
|
||||
throw new Error("Unknown authenticatinOk message type" + sys.inspect(msg));
|
||||
};
|
||||
|
||||
p.parseS = function(msg) {
|
||||
|
||||
@ -9,7 +9,7 @@ buffers.readyForQuery = function() {
|
||||
|
||||
buffers.authenticationOk = function() {
|
||||
return new BufferList()
|
||||
.addInt32(8)
|
||||
.addInt32(0)
|
||||
.join(true, 'R');
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user