nfhu / xmemcached

Automatically exported from code.google.com/p/xmemcached
Apache License 2.0
0 stars 0 forks source link

TextIncrDecrCommand 问题 #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
其中
{{{
public final void encode() {
        byte[] numBytes = ByteUtils.getBytes(String.valueOf(this.getAmount()));
        byte[] cmdBytes = this.commandType == CommandType.INCR ? Constants.INCR : Constants.DECR;
        int capacity = cmdBytes.length + 2 + this.key.length()
                + numBytes.length + Constants.CRLF.length;
}}}
的 
this.key.length()应该为字节数,而不是字符数,如果inc的key为中
文的话,会出现溢出问题。

Original issue reported on code.google.com by sunli1...@gmail.com on 24 Jan 2011 at 8:12

GoogleCodeExporter commented 9 years ago
是的,感谢指出,这是个bug,虽然一般用中文做key的情况不��
�。

Original comment by killme2...@gmail.com on 24 Jan 2011 at 8:35

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r803.

Original comment by killme2...@gmail.com on 24 Jan 2011 at 9:14