DavidAlphaFox / memlink

Automatically exported from code.google.com/p/memlink
0 stars 1 forks source link

cmd_range 中len过大会core #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
int
hashtable_range(HashTable *ht, char *key, unsigned char kind,
                unsigned int *maskarray, int masknum,
                int frompos, int len, Conn *conn)
{
  .....
int  wlen = CMD_REPLY_HEAD_LEN + 3 + node->masknum + (node->valuesize + 
node->masksize) * len;

len应该做一下判断,如果过大,应该使用list有效长度。

Original issue reported on code.google.com by Mr.Brigh...@gmail.com on 13 Jul 2011 at 10:27

GoogleCodeExporter commented 9 years ago
可以仿照一下redis
Out-of-range indexes
Out of range indexes will not produce an error. If start is larger than the end 
of the list, or start > end, an empty list is returned. If end is larger than 
the actual end of the list, Redis will treat it like the last element of the 
list.

Original comment by Mr.Brigh...@gmail.com on 13 Jul 2011 at 11:08

GoogleCodeExporter commented 9 years ago
应该不会core,在client端有限制的。

out-of-range这里,memlink和redis是差不多的,只是在client端预估��
�一下数据的大小,超过1M就会返回错误。

Original comment by zhaowei...@gmail.com on 14 Jul 2011 at 2:40