Skip to content

Commit

Permalink
fix line parsing for larger objects
Browse files Browse the repository at this point in the history
  • Loading branch information
kschzt committed Apr 5, 2011
1 parent 4842c6e commit 48496fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/memcache.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,11 @@ Client.prototype.handle_get = function(buffer) {
var next_result_at = 0;
var result_value = null;
var end_indicator_len = 3;
var result_len = 0;

if (buffer.indexOf('END') == 0) {
return [result_value, end_indicator_len + crlf_len];
} else if (buffer.indexOf('VALUE') == 0) {
} else if (buffer.indexOf('VALUE') == 0 && buffer.indexOf('END') != -1) {
first_line_len = buffer.indexOf(crlf) + crlf_len;
var end_indicator_start = buffer.indexOf('END');
result_len = end_indicator_start - first_line_len - crlf_len;
Expand Down

0 comments on commit 48496fc

Please sign in to comment.