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.
This commit is contained in:
Daniel Norberg 2014-12-05 16:32:30 +09:00 committed by Norman Maurer
parent 46576fd2ff
commit 54a39a94ac

View File

@ -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);