Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix port #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
/.idea/
4 changes: 2 additions & 2 deletions lib/memcached.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Client.config = {
// will receive the connection if the operation was successful
memcached.connect = function connect(server, callback) {
// Default port to 11211
if(!server.match(/(.+):(\d+)$/)) {
if(server[0] !== '/' && !server.match(/(.+):(\d+)$/)) {
server = server + ':11211';
}

Expand Down Expand Up @@ -556,7 +556,7 @@ Client.config = {
}

, 'VERSION': function version(tokens, dataSet) {
var versionTokens = /(\d+)(?:\.)(\d+)(?:\.)(\d+)$/.exec(tokens[1]);
var versionTokens = /^(\d+)(?:\.)(\d+)(?:\.)(\d+)/.exec(tokens[1]);

return [CONTINUE, {
server: this.serverAddress
Expand Down
9 changes: 5 additions & 4 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
* @type {Object}
* @api public
*/
var testMemcachedHost = process.env.MEMCACHED__HOST || '127.0.0.1';

require('should');
var testMemcachedHost = process.env.MEMCACHED__HOST || '10.211.55.5';
var testMemcachedSocketPath = process.env.MEMCACHED__SOCKET_PATH;

exports.servers = {
single: testMemcachedHost + ':11211'
single: testMemcachedHost + ':11211',
singleSocket: testMemcachedSocketPath
, multi: [
testMemcachedHost + ':11211'
, testMemcachedHost + ':11212'
, testMemcachedHost + ':11213'
, testMemcachedSocketPath
]
};

Expand Down
4 changes: 3 additions & 1 deletion test/memcached-add.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
var assert = require('assert')
, fs = require('fs')
, common = require('./common')
, Memcached = require('../');
, Memcached = require('../')
, should = require('should')
;

global.testnumbers = global.testnumbers || +(Math.random(10) * 1000000).toFixed();

Expand Down
4 changes: 3 additions & 1 deletion test/memcached-cas.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
*/
var assert = require('assert')
, common = require('./common')
, Memcached = require('../');
, Memcached = require('../')
, should = require('should')
;

global.testnumbers = global.testnumbers || +(Math.random(10) * 1000000).toFixed();

Expand Down
4 changes: 3 additions & 1 deletion test/memcached-connections.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ var assert = require('assert')
, fs = require('fs')
, net = require('net')
, common = require('./common')
, Memcached = require('../');
, Memcached = require('../')
, should = require('should')
;

global.testnumbers = global.testnumbers || +(Math.random(10) * 1000000).toFixed();

Expand Down
Loading