aboutsummaryrefslogtreecommitdiff
path: root/src/backend/libpq/auth.c
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2023-08-22 19:16:12 -0700
committerNathan Bossart <nathan@postgresql.org>2023-08-22 19:16:12 -0700
commitf4b54e1ed9853ab9aff524494866823f951b1e7f (patch)
treed828a0aceba5a1e74372170b58c97bae56eeefa3 /src/backend/libpq/auth.c
parent711479115836b2180f50c00bbf0773220848a7f5 (diff)
downloadpostgresql-f4b54e1ed9853ab9aff524494866823f951b1e7f.tar.gz
postgresql-f4b54e1ed9853ab9aff524494866823f951b1e7f.zip
Introduce macros for protocol characters.
This commit introduces descriptively-named macros for the identifiers used in wire protocol messages. These new macros are placed in a new header file so that they can be easily used by third-party code. Author: Dave Cramer Reviewed-by: Alvaro Herrera, Tatsuo Ishii, Peter Smith, Robert Haas, Tom Lane, Peter Eisentraut, Michael Paquier Discussion: https://postgr.es/m/CADK3HHKbBmK-PKf1bPNFoMC%2BoBt%2BpD9PH8h5nvmBQskEHm-Ehw%40mail.gmail.com
Diffstat (limited to 'src/backend/libpq/auth.c')
-rw-r--r--src/backend/libpq/auth.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 315a24bb3f9..0356fe3e454 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -665,7 +665,7 @@ sendAuthRequest(Port *port, AuthRequest areq, const char *extradata, int extrale
CHECK_FOR_INTERRUPTS();
- pq_beginmessage(&buf, 'R');
+ pq_beginmessage(&buf, PqMsg_AuthenticationRequest);
pq_sendint32(&buf, (int32) areq);
if (extralen > 0)
pq_sendbytes(&buf, extradata, extralen);
@@ -698,7 +698,7 @@ recv_password_packet(Port *port)
/* Expect 'p' message type */
mtype = pq_getbyte();
- if (mtype != 'p')
+ if (mtype != PqMsg_PasswordMessage)
{
/*
* If the client just disconnects without offering a password, don't
@@ -961,7 +961,7 @@ pg_GSS_recvauth(Port *port)
CHECK_FOR_INTERRUPTS();
mtype = pq_getbyte();
- if (mtype != 'p')
+ if (mtype != PqMsg_GSSResponse)
{
/* Only log error if client didn't disconnect. */
if (mtype != EOF)
@@ -1232,7 +1232,7 @@ pg_SSPI_recvauth(Port *port)
{
pq_startmsgread();
mtype = pq_getbyte();
- if (mtype != 'p')
+ if (mtype != PqMsg_GSSResponse)
{
if (sspictx != NULL)
{