Skip to content

Commit 8720ed3

Browse files
authored
Buffer copy data messages (#265)
* Buffer copy data messages * Update comment
1 parent de7d7d7 commit 8720ed3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/server.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,13 @@ impl Server {
510510
break;
511511
}
512512

513-
// CopyData: we are not buffering this one because there will be many more
514-
// and we don't know how big this packet could be, best not to take a risk.
515-
'd' => break,
513+
// CopyData
514+
'd' => {
515+
// Don't flush yet, buffer until we reach limit
516+
if self.buffer.len() >= 8196 {
517+
break;
518+
}
519+
}
516520

517521
// CopyDone
518522
// Buffer until ReadyForQuery shows up, so don't exit the loop yet.

0 commit comments

Comments
 (0)