未验证 提交 c3f433b8 编写于 作者: K kukey 提交者: GitHub

fix parse eval on SW_ARG2 calculate r->rlen error (#654)

Update src/proto/nc_redis.c
Co-authored-by: NTyson Andre <tyson.andre@uwaterloo.ca>
上级 0cf49ad3
......@@ -1633,7 +1633,19 @@ redis_parse_req(struct msg *r)
m = p + r->rlen;
if (m >= b->last) {
r->rlen -= (uint32_t)(b->last - p);
/*
* For EVAL/EVALHASH, the r->token has been assigned a value. When
* m >= b->last happens will need to repair mbuf.
*
* At the end of redis_parse_req, r->token will be used to choose
* the start (p) for the next call to redis_parse_req and clear
* r->token when repairing this and adding more data.
*
* So, only when r->token == NULL we need to calculate r->rlen again.
*/
if (r->token == NULL) {
r->rlen -= (uint32_t)(b->last - p);
}
m = b->last - 1;
p = m;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册