start to handle other auth messages

This commit is contained in:
brianc 2010-10-19 22:55:26 -05:00
parent ec5f1b8831
commit 52a0d0459d
2 changed files with 9 additions and 3 deletions

View File

@ -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) {

View File

@ -9,7 +9,7 @@ buffers.readyForQuery = function() {
buffers.authenticationOk = function() {
return new BufferList()
.addInt32(8)
.addInt32(0)
.join(true, 'R');
};