From 54a39a94aca1c68d630c641187e135fd6873901b Mon Sep 17 00:00:00 2001 From: Daniel Norberg Date: Fri, 5 Dec 2014 16:32:30 +0900 Subject: [PATCH] example: memcache: fix set command Motivation: The example MemcacheClient set command doesn't work. Modifications: Fill the extras field buffer with zeros so that it gets written to the request payload. Result: The example MemcacheClient set command works. --- .../io/netty/example/memcache/binary/MemcacheClientHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/example/src/main/java/io/netty/example/memcache/binary/MemcacheClientHandler.java b/example/src/main/java/io/netty/example/memcache/binary/MemcacheClientHandler.java index d7eb127d4e..888fc8e048 100644 --- a/example/src/main/java/io/netty/example/memcache/binary/MemcacheClientHandler.java +++ b/example/src/main/java/io/netty/example/memcache/binary/MemcacheClientHandler.java @@ -54,6 +54,7 @@ public class MemcacheClientHandler extends ChannelDuplexHandler { ByteBuf content = Unpooled.wrappedBuffer(value.getBytes(CharsetUtil.UTF_8)); ByteBuf extras = ctx.alloc().buffer(8); + extras.writeZero(8); BinaryMemcacheRequest req = new DefaultFullBinaryMemcacheRequest(key, extras, content); req.setOpcode(BinaryMemcacheOpcodes.SET);