mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-28 10:30:40 +00:00
Add BeMessage::BackendKeyData variant
This commit is contained in:
committed by
Dmitry Ivanov
parent
f64074c609
commit
989371493b
@@ -336,6 +336,7 @@ pub enum BeMessage<'a> {
|
||||
AuthenticationOk,
|
||||
AuthenticationMD5Password(&'a [u8; 4]),
|
||||
AuthenticationCleartextPassword,
|
||||
BackendKeyData { backend_pid: i32, cancel_key: i32 },
|
||||
BindComplete,
|
||||
CommandComplete(&'a [u8]),
|
||||
CopyData(&'a [u8]),
|
||||
@@ -532,6 +533,19 @@ impl<'a> BeMessage<'a> {
|
||||
.unwrap(); // write into BytesMut can't fail
|
||||
}
|
||||
|
||||
BeMessage::BackendKeyData {
|
||||
backend_pid,
|
||||
cancel_key,
|
||||
} => {
|
||||
buf.put_u8(b'K');
|
||||
write_body(buf, |buf| {
|
||||
buf.put_i32(*backend_pid);
|
||||
buf.put_i32(*cancel_key);
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
BeMessage::BindComplete => {
|
||||
buf.put_u8(b'2');
|
||||
write_body(buf, |_| Ok::<(), io::Error>(())).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user