From 83a0850c59c992c821401d368c5803483a626703 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Wed, 16 Mar 2005 15:13:29 +0000 Subject: [PATCH] improve debug messages --- pool_auth.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pool_auth.c b/pool_auth.c index 7ca499d..7c919f6 100644 --- a/pool_auth.c +++ b/pool_auth.c @@ -109,6 +109,8 @@ int pool_do_auth(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *cp) return -1; } + pid = ntohl(pid); + if (DUAL_MODE) { status = pool_read(SECONDARY(cp), &pid1, sizeof(pid1)); @@ -118,9 +120,15 @@ int pool_do_auth(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *cp) pool_error("pool_do_auth: read authentication kind from secondary failed"); return -1; } - } - pid = ntohl(pid); + pid1 = ntohl(pid1); + + if (pid != pid1) + { + pool_error("pool_do_auth: authentication kind does not match between master(%d) and secondary(%d)", pid, pid1); + return -1; + } + } /* trust? */ if (pid == 0) @@ -205,7 +213,7 @@ int pool_do_auth(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *cp) SimpleForwardToFrontend(kind, frontend, cp); return -1; } - else if (kind != 'K') + else if (kind != 'K') /* BackendKeyData? */ { if (protoMajor == PROTO_MAJOR_V3) { @@ -895,7 +903,7 @@ signed char pool_read_kind(POOL_CONNECTION_POOL *cp) status = pool_read(MASTER(cp), &kind, sizeof(kind)); if (status < 0) { - pool_error("read_message_kind: error while reading message kind"); + pool_error("read_kind: error while reading message kind"); return -1; } @@ -904,13 +912,13 @@ signed char pool_read_kind(POOL_CONNECTION_POOL *cp) status = pool_read(SECONDARY(cp), &kind1, sizeof(kind1)); if (status < 0) { - pool_error("read_message_kind: error while reading message kind from secondary backend"); + pool_error("read_kind: error while reading message kind from secondary backend"); return -1; } if (kind != kind1) { - pool_error("read_message_kind: kind does not match between backends master(%d) secondary(%d)", + pool_error("read_kind: kind does not match between backends master(%d) secondary(%d)", kind, kind1); return -1; } -- 2.39.5