diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2025-05-08 22:01:20 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2025-05-08 22:01:20 +0300 |
commit | 965213d9c56a671086525a65f5427653b4a66350 (patch) | |
tree | 224e46befccd3fe88356e87ae27460014642bf67 | |
parent | 9d710a1ac0912244934277a99fe4666df3d2b825 (diff) | |
download | postgresql-965213d9c56a671086525a65f5427653b4a66350.tar.gz postgresql-965213d9c56a671086525a65f5427653b4a66350.zip |
Use more mundane 'int' type for cancel key lengths in libpq
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
-rw-r--r-- | src/interfaces/libpq/fe-protocol3.c | 2 | ||||
-rw-r--r-- | src/interfaces/libpq/libpq-int.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c index ca19e654a1c..3a1ac398fd0 100644 --- a/src/interfaces/libpq/fe-protocol3.c +++ b/src/interfaces/libpq/fe-protocol3.c @@ -1532,7 +1532,7 @@ getParameterStatus(PGconn *conn) static int getBackendKeyData(PGconn *conn, int msgLength) { - uint8 cancel_key_len; + int cancel_key_len; if (conn->be_cancel_key) { diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index 9369c217fb5..3d8a5045b98 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -547,8 +547,8 @@ struct pg_conn /* 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 */ |