Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int redisReaderGetReply(redisReader *r, void **reply) error #1263

Open
yanrbts opened this issue Jun 3, 2024 · 4 comments
Open

int redisReaderGetReply(redisReader *r, void **reply) error #1263

yanrbts opened this issue Jun 3, 2024 · 4 comments

Comments

@yanrbts
Copy link

yanrbts commented Jun 3, 2024

int redisReaderGetReply(redisReader *r, void **reply) if (sdsrange(r->buf,r->pos,-1) < 0) {} after judging that the link is successful, execute hscan and return null

@michael-grunder
Copy link
Collaborator

I don't follow. What is the issue?

@yanrbts
Copy link
Author

yanrbts commented Jun 4, 2024

My program restarts the redis connection and executes a command similar to HSCAN filekey:fileuuis 0 match trace:* count 10. The data is successfully traversed for the first time. When the program exits and restarts the second traversal, reply=NULL is returned. The problem lies in the code I mentioned above.

@yanrbts
Copy link
Author

yanrbts commented Jun 4, 2024

My program restarts the redis connection and executes a command similar to HSCAN filekey:fileuuis 0 match trace:* count 10. The data is successfully traversed for the first time. When the program exits and restarts the second traversal, reply=NULL is returned. The problem lies in the code I mentioned above.

@yanrbts
Copy link
Author

yanrbts commented Jun 4, 2024

/* Discard part of the buffer when we've consumed at least 1k, to avoid
 * doing unnecessary calls to memmove() in sds.c. */
// if (r->pos >= 1024) {
//     if (sdsrange(r->buf,r->pos,-1) < 0) {
//         printf("get reply sdsrange < 0\n");
//         return REDIS_ERR;
//     }
//     r->pos = 0;
//     r->len = sdslen(r->buf);
// }  Comment out this code and it will be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants