MCPcopy Create free account
hub / github.com/erans/pgsqlite / read_until_ready

Function read_until_ready

tests/benchmark_batch_operations.rs:263–279  ·  view source on GitHub ↗
(stream: &mut TcpStream)

Source from the content-addressed store, hash-verified

261}
262
263async fn read_until_ready(stream: &mut TcpStream) {
264 loop {
265 let mut msg_type = [0u8; 1];
266 stream.read_exact(&mut msg_type).await.unwrap();
267
268 let mut len_buf = [0u8; 4];
269 stream.read_exact(&mut len_buf).await.unwrap();
270 let len = u32::from_be_bytes(len_buf) as usize - 4;
271
272 let mut data = vec![0u8; len];
273 stream.read_exact(&mut data).await.unwrap();
274
275 if msg_type[0] == b'Z' { // ReadyForQuery
276 break;
277 }
278 }
279}

Callers 2

perform_startupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected