Hi,
You should put the code snippet, otherwise it is difficult.
You can get the value of "reply-> len"
when "reply-> str" contains "value" is 5, but if "0" ...? maybe it
helps the debugging.
--Paulino
2014-10-30 6:51 GMT+01:00, Ricky Leo <
rick...@gmail.com>:
> I am encountering a circumstance that I have set a hash field&value like
>
> HSET test field1 value1
>
> and I can get the value correctly in the redis-cli,
> <
https://lh3.googleusercontent.com/-qtxhCNwcEkM/VFHQhe6AQYI/AAAAAAAAAAw/JaQIDJYTi3g/s1600/QQ%E5%9B%BE%E7%89%8720141030134206.jpg>
>
>
> but when I run the command in my own program, it always returns "0", but
> there maybe one correct in 5 executes, I am using the hiredis in c++
> program,
> <
https://lh3.googleusercontent.com/-Zj-LzztZ-X4/VFHRGAC1l7I/AAAAAAAAABA/11PSC8DWDOI/s1600/QQ%E5%9B%BE%E7%89%8720141030134748.png>
>
> /* This is the reply object returned by redisCommand() */
> typedef struct redisReply {
> int type; /* REDIS_REPLY_* */
> long long integer; /* The integer when type is REDIS_REPLY_INTEGER */
> int len; /* Length of string */
> char *str; /* Used for both REDIS_REPLY_ERROR and REDIS_REPLY_STRING */
> size_t elements; /* number of elements, for REDIS_REPLY_ARRAY */
> struct redisReply **element; /* elements vector for REDIS_REPLY_ARRAY
> */
> } redisReply;
>
> This is the redisReply structure from the hiredis.h, I print the type and
> it's 1(REDIS_REPLY_STRING), but there is nothing in the str.
>
> I do not know if had do someting wrong, any ideas will be appreciated,
> thanks!
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
redis-db+u...@googlegroups.com.
> To post to this group, send email to
redi...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/redis-db.
> For more options, visit
https://groups.google.com/d/optout.
>