redox icon indicating copy to clipboard operation
redox copied to clipboard

SCAN result not processed correctly

Open bveldhoen opened this issue 10 years ago • 3 comments

I've tried to get the SCAN command to work, but ran into a problem that the redis reply is not processed correctly.

According to the Redis documentation:

SCAN, SSCAN, HSCAN and ZSCAN return a two elements multi-bulk reply, where the first element is a string representing an unsigned 64 bit number (the cursor), and the second element is a multi-bulk with an array of elements.

When using redox, the only result I get back is the first element (cursor). While debugging, I noticed that the reader in the redis context does have the entire result (including the 2nd part), so this doesn't seem to be a hiredis issue.

bveldhoen avatar Jun 02 '15 12:06 bveldhoen

Show some code! Are you templating on redisReply*?

hmartiro avatar Jun 08 '15 07:06 hmartiro

No, I was using std::vectorstd::string for the result type. When it turns out that using redisReply for the result type works, I'll close this issue.

Thanks!

bveldhoen avatar Jun 08 '15 07:06 bveldhoen

Ok. I believe it should, since that is the direct hiredis reply. The SCAN reply doesn't fit the form of any others of the current templates On Jun 8, 2015 12:17 AM, "bveldhoen" [email protected] wrote:

No, I was using std::vectorstd::string for the result type. When it turns out that using redisReply for the result type works, I'll close this issue.

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/hmartiro/redox/issues/16#issuecomment-109889430.

hmartiro avatar Jun 08 '15 07:06 hmartiro