pgsql: use generic name for TerminationMessage msg

Since this structure can be used for different messages with other
meanings.

Related to
Task #4854
pull/12948/head
Juliana Fajardini 5 months ago committed by Victor Julien
parent f06ec5336e
commit ef8b13c1ef

@ -102,7 +102,7 @@ fn log_request(req: &PgsqlFEMessage, flags: u32) -> Result<JsonBuilder, JsonErro
js.set_uint("process_id", *pid)?;
js.set_uint("secret_key", *backend_key)?;
}
PgsqlFEMessage::Terminate(TerminationMessage {
PgsqlFEMessage::Terminate(NoPayloadMessage {
identifier: _,
length: _,
}) => {

@ -278,7 +278,7 @@ pub struct CopyOutResponse {
}
#[derive(Debug, PartialEq, Eq)]
pub struct TerminationMessage {
pub struct NoPayloadMessage {
pub identifier: u8,
pub length: u32,
}
@ -300,7 +300,7 @@ pub enum PgsqlBEMessage {
CommandComplete(RegularPacket),
CopyOutResponse(CopyOutResponse),
ConsolidatedCopyDataOut(ConsolidatedDataRowPacket),
CopyDone(TerminationMessage),
CopyDone(NoPayloadMessage),
ReadyForQuery(ReadyForQueryMessage),
RowDescription(RowDescriptionMessage),
ConsolidatedDataRow(ConsolidatedDataRowPacket),
@ -384,7 +384,7 @@ pub enum PgsqlFEMessage {
SASLResponse(RegularPacket),
SimpleQuery(RegularPacket),
CancelRequest(CancelRequestMessage),
Terminate(TerminationMessage),
Terminate(NoPayloadMessage),
UnknownMessageType(RegularPacket),
}
@ -776,7 +776,7 @@ fn parse_terminate_message(i: &[u8]) -> IResult<&[u8], PgsqlFEMessage, PgsqlPars
let (i, length) = parse_exact_length(i, PGSQL_LENGTH_FIELD)?;
Ok((
i,
PgsqlFEMessage::Terminate(TerminationMessage { identifier, length }),
PgsqlFEMessage::Terminate(NoPayloadMessage { identifier, length }),
))
}
@ -1066,7 +1066,7 @@ fn parse_copy_done(i: &[u8]) -> IResult<&[u8], PgsqlBEMessage, PgsqlParseError<&
let (i, identifier) = verify(be_u8, |&x| x == b'c')(i)?;
let (i, length) = parse_exact_length(i, PGSQL_LENGTH_FIELD)?;
Ok((
i, PgsqlBEMessage::CopyDone(TerminationMessage {
i, PgsqlBEMessage::CopyDone(NoPayloadMessage {
identifier,
length
})

Loading…
Cancel
Save