return -1;
}
+ pid = ntohl(pid);
+
if (DUAL_MODE)
{
status = pool_read(SECONDARY(cp), &pid1, sizeof(pid1));
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)
SimpleForwardToFrontend(kind, frontend, cp);
return -1;
}
- else if (kind != 'K')
+ else if (kind != 'K') /* BackendKeyData? */
{
if (protoMajor == PROTO_MAJOR_V3)
{
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;
}
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;
}