From cb1693c5fdf24b485de2e898de13dda94022dfd5 Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Tue, 3 Oct 2023 14:53:56 -0400 Subject: [PATCH] Comment error string --- lib/memjs/utils.d.ts.map | 2 +- lib/memjs/utils.js | 5 ++++- src/memjs/utils.ts | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/memjs/utils.d.ts.map b/lib/memjs/utils.d.ts.map index 1394895..29bfad7 100644 --- a/lib/memjs/utils.d.ts.map +++ b/lib/memjs/utils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/memjs/utils.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,oBAAY,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,eAAO,MAAM,SAAS,QAAkB,WAAW,WAElD,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,IAAI,CACV,MAAM,CAAC,MAAM,EACb,OAAO,GAAG,WAAW,GAAG,cAAc,GAAG,iBAAiB,CAC3D,CAAC;IACF,GAAG,EAAE,WAAW,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,gBAAgB,UAgC1B;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAa/D;AAED,eAAO,MAAM,qBAAqB,WACxB,EAAE,OACL,WAAW,UACR,WAAW,SACZ,WAAW,UACV,MAAM,OACT,MAAM,uDAYZ,CAAC;AAEF,eAAO,MAAM,iBAAiB,WACpB,EAAE,OACL,WAAW,UACR,WAAW,SACZ,WAAW,wCAYnB,CAAC;AAEF,eAAO,MAAM,8BAA8B,W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xB,EAAE,OACL,WAAW,UACR,WAAW,SACZ,WAAW,UACV,MAAM,OACT,MAAM,uDAYZ,CAAC;AAEF,eAAO,MAAM,iBAAiB,WACpB,EAAE,OACL,WAAW,UACR,WAAW,SACZ,WAAW,wCAYnB,CAAC;AAEF,eAAO,MAAM,8BAA8B,WACjC,MAAM,iBACC,MAAM,cACT,MAAM,WASnB,CAAC;AAEF,eAAO,MAAM,cAAc,eAAyB,MAAM,WAIzD,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAkB,MAAM,WAM5C,CAAC;AAEF,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAOD,eAAO,MAAM,YAAY,YAAsB,MAAM,KAAG,OAAO,GAAG,KA6BjE,CAAC;AAEF,eAAO,MAAM,aAAa,YAAsB,MAAM,KAAG,OAAO,EAe/D,CAAC;AAEF,eAAO,MAAM,KAAK,gBAA0B,GAAG,gBAU9C,CAAC;AAIF,eAAO,MAAM,SAAS,cAGrB,CAAC"} \ No newline at end of file diff --git a/lib/memjs/utils.js b/lib/memjs/utils.js index 3179851..10dddd7 100644 --- a/lib/memjs/utils.js +++ b/lib/memjs/utils.js @@ -114,6 +114,9 @@ const hashCode = function (str) { return Math.abs(ret); }; exports.hashCode = hashCode; +// Error message from memcached when it rejects a request for having too many +// open connections +// https://github.com/memcached/memcached/blob/efee763c93249358ea5b3b42c7fd4e57e2599c30/memcached.c#L3044 const ERROR_TOO_MANY_OPEN_CONNECTIONS = "ERROR Too many open connections\r\n"; const parseMessage = function (dataBuf) { if (dataBuf.length < 24) { @@ -201,4 +204,4 @@ if (!Buffer.concat) { return buffer; }; } -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI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lmICh0eXBlb2YgbGVuZ3RoICE9PSBcIm51bWJlclwiKSB7XG4gICAgICBsZW5ndGggPSAwO1xuICAgICAgZm9yIChpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgYnVmID0gbGlzdFtpXTtcbiAgICAgICAgbGVuZ3RoICs9IGJ1Zi5sZW5ndGg7XG4gICAgICB9XG4gICAgfVxuXG4gICAgY29uc3QgYnVmZmVyID0gQnVmZmVyLmFsbG9jKGxlbmd0aCk7XG4gICAgbGV0IHBvcyA9IDA7XG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XG4gICAgICBidWYgPSBsaXN0W2ldO1xuICAgICAgYnVmLmNvcHkoYnVmZmVyLCBwb3MpO1xuICAgICAgcG9zICs9IGJ1Zi5sZW5ndGg7XG4gICAgfVxuICAgIHJldHVybiBidWZmZXI7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/src/memjs/utils.ts b/src/memjs/utils.ts index 9f4cd3f..bea061b 100644 --- a/src/memjs/utils.ts +++ b/src/memjs/utils.ts @@ -144,6 +144,9 @@ export interface Message { extras: Buffer; } +// Error message from memcached when it rejects a request for having too many +// open connections +// https://github.com/memcached/memcached/blob/efee763c93249358ea5b3b42c7fd4e57e2599c30/memcached.c#L3044 const ERROR_TOO_MANY_OPEN_CONNECTIONS = "ERROR Too many open connections\r\n"; export const parseMessage = function (dataBuf: Buffer): Message | false {