mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
code cleanup
This commit is contained in:
parent
961f3f1984
commit
d2c22afc36
20
lib/index.js
20
lib/index.js
@ -1,18 +1,14 @@
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var sys = require('sys');
|
||||
var net = require('net');
|
||||
var NUL = '\0';
|
||||
|
||||
var chars = Buffer('RSKZQCTD','utf8');
|
||||
var UTF8 = {
|
||||
R: chars[0],
|
||||
S: chars[1],
|
||||
K: chars[2],
|
||||
Z: chars[3],
|
||||
Q: chars[4],
|
||||
C: chars[5],
|
||||
T: chars[6],
|
||||
D: chars[7]
|
||||
var NUL = '\0';
|
||||
var chars = ['R','S','K','Z','Q','C','T','D'];
|
||||
var charBuff = Buffer(chars.join(''),'utf8');
|
||||
var UTF8 = {};
|
||||
for(var i = 0; i < charBuff.length; i++){
|
||||
var char = chars[i];
|
||||
UTF8[char] = charBuff[i];
|
||||
};
|
||||
|
||||
|
||||
@ -24,6 +20,7 @@ var Client = function(config) {
|
||||
this.port = config.port || 5432;
|
||||
this.queryQueue = [];
|
||||
};
|
||||
|
||||
sys.inherits(Client, EventEmitter);
|
||||
|
||||
Client.prototype.connect = function() {
|
||||
@ -111,6 +108,7 @@ p.parse = function() {
|
||||
}
|
||||
return messages;
|
||||
};
|
||||
|
||||
p.parseMessage = function() {
|
||||
if(this.buffer.length == this.offset) {
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user