mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-23 01:16:30 +00:00
buffer up to a limit
This commit is contained in:
@@ -247,9 +247,21 @@ impl Server {
|
||||
}
|
||||
};
|
||||
|
||||
self.data_available = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
'D' => {
|
||||
self.data_available = true;
|
||||
|
||||
// Don't flush yet, the more we buffer, the faster this goes.
|
||||
// Up to a limit of course.
|
||||
if self.buffer.len() >= 8196 {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// CopyInResponse: copy is starting from client to server
|
||||
'G' => break,
|
||||
|
||||
@@ -340,7 +352,12 @@ impl Server {
|
||||
msg.put_slice(&query[..]);
|
||||
|
||||
self.send(msg).await?;
|
||||
let _ = self.recv().await?;
|
||||
loop {
|
||||
let _ = self.recv().await?;
|
||||
if !self.data_available {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user