From 0b114118208b8bdd678e944d87e779d79bf80e5c Mon Sep 17 00:00:00 2001 From: Robert Coup Date: Mon, 22 Sep 2014 18:21:33 +1200 Subject: [PATCH] Improve libmemcached compatibility. When using ketama compatibility, utilise the `default_port` option from 3rd-Eden/node-hashring#23 --- lib/memcached.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/memcached.js b/lib/memcached.js index 3648aaa..e8b08d0 100644 --- a/lib/memcached.js +++ b/lib/memcached.js @@ -59,8 +59,10 @@ function Client (args, options) { Utils.merge(this, options); this.servers = servers; + var compatibility = this.compatibility || this.compatiblity; this.HashRing = new HashRing(args, this.algorithm, { - compatibility: this.compatibility || this.compatiblity + compatibility: compatibility, + default_port: (compatibility == 'ketama') ? 11211 : null }); this.connections = {}; this.issues = [];