The documented max length of a cancel key is 256 bytes, so it fits in
uint8. It nevertheless seems weird to not just use 'int', like in
commit
0f1433f053 for the backend.
Discussion: https://www.postgresql.org/message-id/
61be9e31-7b7d-49d5-bc11-
721800d89d64%40eisentraut.org
static int
getBackendKeyData(PGconn *conn, int msgLength)
{
- uint8 cancel_key_len;
+ int cancel_key_len;
if (conn->be_cancel_key)
{
/* Miscellaneous stuff */
int be_pid; /* PID of backend --- needed for cancels */
+ int be_cancel_key_len;
char *be_cancel_key; /* query cancellation key and its length */
- uint16 be_cancel_key_len;
pgParameterStatus *pstatus; /* ParameterStatus data */
int client_encoding; /* encoding id */
bool std_strings; /* standard_conforming_strings */