opt read buf mem buf

This commit is contained in:
yihaoDeng 2024-04-09 11:01:52 +00:00
parent a3abc775ea
commit ee50d5a5ad
1 changed files with 5 additions and 1 deletions

View File

@ -158,6 +158,10 @@ int transResetBuffer(SConnBuffer* connBuf) {
p->left = -1;
p->total = 0;
p->len = 0;
if (p->cap > BUFFER_CAP) {
p->cap = BUFFER_CAP;
p->buf = taosMemoryRealloc(p->buf, p->cap);
}
} else {
ASSERTS(0, "invalid read from sock buf");
return -1;