You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi,
I got some problem about c client using when i was using function as redisCommand(c,'get key') ,the key is exists.At the beginning all goes right,but when the function was called fast some problem come.
In another thread i also call redisCommand(c,"ping")
exception:
the correct output is " get account@test0001 1"
but sometimes the output is " get account@test0001 PONG "
sometimes the output is "get account@test0001 get exception"
when i debug the client i found something:
at the file hiredis.c
function:redisReaderGetReply(redisReader r,void *_reply)
at the last of the function:
/ Emit a reply when there is one. */
if(r->ridx == -1){
if(reply != NULL)
*reply = r->reply;
r->reply = NULL;
}
"_reply = r->reply;" was not called,
r->reply = NULL; called.
My client package is antriez-hiredis-7bc9f54. redis-server version:2.4.1.
The text was updated successfully, but these errors were encountered:
hi,
I got some problem about c client using when i was using function as redisCommand(c,'get key') ,the key is exists.At the beginning all goes right,but when the function was called fast some problem come.
This is my code:
CFKeyValueDB *ptclient;
void CFKeyValueDB::InitializeKeyValueDB(){
......
}
string CFKeyValueDB::get(string key){
redisReply *reply = (redisReply *)redisCommand(c,"GET %s",(char *)key.c_str());
try{
if(reply !=NULL){
string ret = reply->str;
freeReplyObject(reply) ;
LOG("get %s %s",(char *)key.c_str(),(char *)ret.c_str());
return ret;
}
}
catch(...){
LOG("get %s catch exception",(char *)key.c_str());
}
LOG("get %s fail",(char *)key.c_str());
return "",
}
this is the using code:
while(true){
string account = "test0001";
string key = "account@" + account;
ptclient->get(key);
}
In another thread i also call redisCommand(c,"ping")
exception:
the correct output is " get account@test0001 1"
but sometimes the output is " get account@test0001 PONG "
sometimes the output is "get account@test0001 get exception"
when i debug the client i found something:
at the file hiredis.c
function:redisReaderGetReply(redisReader r,void *_reply)
at the last of the function:
/ Emit a reply when there is one. */
if(r->ridx == -1){
if(reply != NULL)
*reply = r->reply;
r->reply = NULL;
}
"_reply = r->reply;" was not called,
r->reply = NULL; called.
My client package is antriez-hiredis-7bc9f54. redis-server version:2.4.1.
The text was updated successfully, but these errors were encountered: