Skip to content

Commit

Permalink
Buffer copy data messages (#265)
Browse files Browse the repository at this point in the history
* Buffer copy data messages

* Update comment
  • Loading branch information
zainkabani committed Dec 21, 2022
1 parent de7d7d7 commit 8720ed3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,13 @@ impl Server {
break;
}

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

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

0 comments on commit 8720ed3

Please sign in to comment.