You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Fix #645
This commit is contained in:
10
index.js
10
index.js
@@ -1216,10 +1216,10 @@ RedisClient.prototype.eval = RedisClient.prototype.EVAL = function () {
|
|||||||
exports.createClient = function(arg0, arg1, arg2){
|
exports.createClient = function(arg0, arg1, arg2){
|
||||||
if( arguments.length === 0 ){
|
if( arguments.length === 0 ){
|
||||||
|
|
||||||
// createClient()
|
// createClient()
|
||||||
return createClient_tcp(default_port, default_host, {});
|
return createClient_tcp(default_port, default_host, {});
|
||||||
|
|
||||||
} else if( typeof arg0 === 'number' ||
|
} else if( typeof arg0 === 'number' ||
|
||||||
typeof arg0 === 'string' && arg0.match(/^\d+$/) ){
|
typeof arg0 === 'string' && arg0.match(/^\d+$/) ){
|
||||||
|
|
||||||
// createClient( 3000, host, options)
|
// createClient( 3000, host, options)
|
||||||
@@ -1238,10 +1238,10 @@ exports.createClient = function(arg0, arg1, arg2){
|
|||||||
|
|
||||||
} else if( arg0 === null && arg1 === null ){
|
} else if( arg0 === null && arg1 === null ){
|
||||||
|
|
||||||
// for backward compatibility
|
// for backward compatibility
|
||||||
// createClient(null,null,options)
|
// createClient(null,null,options)
|
||||||
return createClient_tcp(default_port, default_host, arg2);
|
return createClient_tcp(default_port, default_host, arg2);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error('unknown type of connection in createClient()');
|
throw new Error('unknown type of connection in createClient()');
|
||||||
}
|
}
|
||||||
@@ -1264,7 +1264,7 @@ var createClient_tcp = function (port_arg, host_arg, options) {
|
|||||||
var cnxOptions = {
|
var cnxOptions = {
|
||||||
'port' : port_arg || default_port,
|
'port' : port_arg || default_port,
|
||||||
'host' : host_arg || default_host,
|
'host' : host_arg || default_host,
|
||||||
'family' : (options && options.family === 'IPv6') ? 'IPv6' : 'IPv4'
|
'family' : (options && options.family === 'IPv6') ? 6 : 4
|
||||||
};
|
};
|
||||||
var net_client = net.createConnection(cnxOptions);
|
var net_client = net.createConnection(cnxOptions);
|
||||||
var redis_client = new RedisClient(net_client, options || {});
|
var redis_client = new RedisClient(net_client, options || {});
|
||||||
|
Reference in New Issue
Block a user