Merge pull request #25314 from taosdata/fix/optReadBuf3

opt read buf mem buf
This commit is contained in:
Hongze Cheng 2024-04-10 15:41:31 +08:00 committed by GitHub
commit 083c07f6a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

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