Permalink
Browse files

fixes lies, adds pendantry

  • Loading branch information...
1 parent fb2ea0d commit 2f2949d4cfdcb47d7388e20ba845463f840a8f66 @fictorial committed Apr 6, 2010
Showing with 9 additions and 7 deletions.
  1. +9 −7 lib/redis-client.js
View
@@ -410,9 +410,9 @@ function maybeConvertReplyValue(commandName, reply) {
//
// We convert that to a JS object like:
// { redis_version: '1.3.8'
- // , arch_bits: 64
+ // , arch_bits: '64'
// , multiplexing_api: 'kqueue'
- // , process_id: 11604
+ // , process_id: '11604'
// , ... }
if (commandName === 'info' && reply.type === BULK) {
@@ -592,11 +592,7 @@ Client.prototype.sendCommand = function () {
callback.commandName = commandName;
- // All requests are formatted as multi-bulk and try to reuse the same
- // Buffer object (pre-allocated). If the serialized command/request will
- // not fit in the current Buffer, a larger buffer replaces it for this and
- // subsequent commands.
-
+ // All requests are formatted as multi-bulk.
// The first line of a multi-bulk request is "*<number of parts to follow>\r\n".
// Next is: "$<length of the command name>\r\n<command name>\r\n".
@@ -632,6 +628,12 @@ Client.prototype.sendCommand = function () {
// Now serialize the command into the request buffer.
// We assume that Redis command names are encoded in ASCII.
+ // FUTURE: would be good to use a free list of various fixed-sized buffers,
+ // get a free one in which our request will fit, and slice
+ // it in order to write, then put it back in the free list.
+ // at this time, I am not sure how much overhead there is to
+ // doing a little memory allocation per request. probably not
+ // much.
var requestBuffer = new Buffer(offset);

0 comments on commit 2f2949d

Please sign in to comment.