summaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-12-27 22:50:46 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-12-27 23:46:28 +0100
commitb63443718a4a3a50304610e6ccda93bbfa06a1e6 (patch)
tree39c9e73604cc871244435b98dca7cbe0570d305c /src/interfaces
parentec0da9b89377960553a3d9054ec79c0512742275 (diff)
Remove MsgType type
Presumably, the C type MsgType was meant to hold the protocol message type in the pre-version-3 era, but this was never fully developed even then, and the name is pretty confusing nowadays. It has only one vestigial use for cancel requests that we can get rid of. Since a cancel request is indicated by a special protocol version number, we can use the ProtocolVersion type, which MsgType was based on. Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/505e76cb-0ca2-4e22-ba0f-772b5dc3f230%40eisentraut.org
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/libpq/fe-cancel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-cancel.c b/src/interfaces/libpq/fe-cancel.c
index c872a0267f0..f23caf8349d 100644
--- a/src/interfaces/libpq/fe-cancel.c
+++ b/src/interfaces/libpq/fe-cancel.c
@@ -448,7 +448,7 @@ PQgetCancel(PGconn *conn)
}
req = (CancelRequestPacket *) &cancel->cancel_req;
- req->cancelRequestCode = (MsgType) pg_hton32(CANCEL_REQUEST_CODE);
+ req->cancelRequestCode = pg_hton32(CANCEL_REQUEST_CODE);
req->backendPID = pg_hton32(conn->be_pid);
memcpy(req->cancelAuthCode, conn->be_cancel_key, conn->be_cancel_key_len);
/* include the length field itself in the length */
@@ -479,7 +479,7 @@ PQsendCancelRequest(PGconn *cancelConn)
/* Send the message body. */
memset(&req, 0, offsetof(CancelRequestPacket, cancelAuthCode));
- req.cancelRequestCode = (MsgType) pg_hton32(CANCEL_REQUEST_CODE);
+ req.cancelRequestCode = pg_hton32(CANCEL_REQUEST_CODE);
req.backendPID = pg_hton32(cancelConn->be_pid);
if (pqPutnchar(&req, offsetof(CancelRequestPacket, cancelAuthCode), cancelConn))
return STATUS_ERROR;