mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-13 16:32:56 +00:00
Add struct for key data
This commit is contained in:
committed by
Dmitry Ivanov
parent
989371493b
commit
1e3ddd43bc
@@ -52,6 +52,12 @@ pub enum StartupRequestCode {
|
||||
Normal,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct CancelKeyData {
|
||||
pub backend_pid: i32,
|
||||
pub cancel_key: i32,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct FeQueryMessage {
|
||||
pub body: Bytes,
|
||||
@@ -336,7 +342,7 @@ pub enum BeMessage<'a> {
|
||||
AuthenticationOk,
|
||||
AuthenticationMD5Password(&'a [u8; 4]),
|
||||
AuthenticationCleartextPassword,
|
||||
BackendKeyData { backend_pid: i32, cancel_key: i32 },
|
||||
BackendKeyData(CancelKeyData),
|
||||
BindComplete,
|
||||
CommandComplete(&'a [u8]),
|
||||
CopyData(&'a [u8]),
|
||||
@@ -533,14 +539,11 @@ impl<'a> BeMessage<'a> {
|
||||
.unwrap(); // write into BytesMut can't fail
|
||||
}
|
||||
|
||||
BeMessage::BackendKeyData {
|
||||
backend_pid,
|
||||
cancel_key,
|
||||
} => {
|
||||
BeMessage::BackendKeyData(key_data) => {
|
||||
buf.put_u8(b'K');
|
||||
write_body(buf, |buf| {
|
||||
buf.put_i32(*backend_pid);
|
||||
buf.put_i32(*cancel_key);
|
||||
buf.put_i32(key_data.backend_pid);
|
||||
buf.put_i32(key_data.cancel_key);
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user