We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
读取服务端响应没有对tcp数据流进行粘包和拆包,这个应该有问题吧
调用read返回的nread长度不一定等于一条完整消息的长度吧,有可能会小于。 int redisBufferRead(redisContext c) { char buf[102416]; int nread;
/* Return early when the context has seen an error. */ if (c->err) return REDIS_ERR; nread = read(c->fd,buf,sizeof(buf)); if (nread == -1) { if (errno == EAGAIN && !(c->flags & REDIS_BLOCK)) { /* Try again later */ } else { __redisSetError(c,REDIS_ERR_IO,NULL); return REDIS_ERR; } } else if (nread == 0) { __redisSetError(c,REDIS_ERR_EOF,"Server closed the connection"); return REDIS_ERR; } else { if (redisReaderFeed(c->reader,buf,nread) != REDIS_OK) { __redisSetError(c,c->reader->err,c->reader->errstr); return REDIS_ERR; } } return REDIS_OK;
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
读取服务端响应没有对tcp数据流进行粘包和拆包,这个应该有问题吧
调用read返回的nread长度不一定等于一条完整消息的长度吧,有可能会小于。
int redisBufferRead(redisContext c) {
char buf[102416];
int nread;
}
The text was updated successfully, but these errors were encountered: