Skip to content
Browse files

Issue 152: Fix error message from mget

  • Loading branch information...
1 parent b4936c4 commit 31c7156735c15ffa1c47268fb2513b4ee6240f01 @trondn committed Aug 30, 2010
Showing with 23 additions and 0 deletions.
  1. +6 −0 memcached.c
  2. +17 −0 t/issue_152.t
View
6 memcached.c
@@ -764,6 +764,12 @@ static void out_string(conn *c, const char *str) {
if (settings.verbose > 1)
fprintf(stderr, ">%d %s\n", c->sfd, str);
+ /* Nuke a partial output... */
+ c->msgcurr = 0;
+ c->msgused = 0;
+ c->iovused = 0;
+ add_msghdr(c);
+
len = strlen(str);
if ((len + 2) > c->wsize) {
/* ought to be always enough. just fail for simplicity */
View
17 t/issue_152.t
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+
+use strict;
+use Test::More tests => 2;
+use FindBin qw($Bin);
+use lib "$Bin/lib";
+use MemcachedTest;
+
+my $server = new_memcached();
+my $sock = $server->sock;
+my $key = "a"x251;
+
+print $sock "set a 1 0 1\r\na\r\n";
+is (scalar <$sock>, "STORED\r\n", "Stored key");
+
+print $sock "get a $key\r\n";
+is (scalar <$sock>, "CLIENT_ERROR bad command line format\r\n", "illegal key");

0 comments on commit 31c7156

Please sign in to comment.
Something went wrong with that request. Please try again.