不要怂,就是干,撸起袖子干!

Commit 2b635550 by Sascha Depold

latest nodejs-mysql-native release

1 parent 27b50657
...@@ -14,22 +14,16 @@ ...@@ -14,22 +14,16 @@
return len; return len;
} }
exports.createTCPClient = function() exports.createTCPClient = function(host, port)
{ {
var args = exports.createTCPClient.arguments, var host = host ? host : "localhost";
host = (args.length == 3) ? args['0'] : "localhost", var port = port ? port : 3306;
port = (args.length == 3) ? args['1'] : 3306, var connection = net.createConnection(port, host);
callback = (args.length == 3) ? args['2'] : args['0'], connection.pscache = {};
connection = net.createConnection(port, host) connection.setEncoding("binary");
connection.setTimeout(0);
connection.on("connect", function() {
connection.pscache = {}; return new socketClient(connection);
connection.setEncoding("binary");
connection.setTimeout(0);
callback(null, new socketClient(connection))
})
connection.on("error", callback)
} }
exports.createUNIXClient = function(path) exports.createUNIXClient = function(path)
......
...@@ -191,7 +191,7 @@ function auth(db, user, password) ...@@ -191,7 +191,7 @@ function auth(db, user, password)
r.bytes(12); r.bytes(12);
salt += r.bytes(12); salt += r.bytes(12);
var token = password!=="" ? scramble(password, salt) : ""; var token = (password || password === "") ? scramble(password, salt) : "";
var reply = new writer(); var reply = new writer();
var client_flags = flags.CLIENT_BASIC_FLAGS; var client_flags = flags.CLIENT_BASIC_FLAGS;
reply.add(client_flags); reply.add(client_flags);
......
File mode changed
File mode changed
File mode changed
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!