Anything else missing?
Functionally it's fine now, but I see few style problems:
- "if (port->ssl > 0)" is wrong, ->ssl is pointer. So use just
"if (port->ssl)".
- Deeper indentation would look nicer with braces.
- There are some duplicated message, could you restructure it so that
each message exists only once.
New version is attached. I could add braces before and after the
ereport()-calls too, but then I need two more #ifdefs to catch the
closing braces.
--
---------------------------------------------------------------------------
____ ______ ____
Dr. Andreas Kunert / __/ / / / __/
HU-Berlin, ZE Rechenzentrum (CMS) / /_ / / / / __\\
www.hu-berlin.de/~kunert /___/ /_/_/_/ /___/
---------------------------------------------------------------------------
--- postinit.c.orig 2013-12-06 14:42:14.827832432 +0100
+++ postinit.c 2013-12-06 14:42:25.171842695 +0100
@@ -221,13 +221,31 @@
if (Log_connections)
{
if (am_walsender)
- ereport(LOG,
- (errmsg("replication connection authorized: user=%s",
- port->user_name)));
+ {
+#ifdef USE_SSL
+ if (port->ssl)
+ ereport(LOG,
+ (errmsg("replication connection authorized: user=%s SSL(protocol: %s, cipher: %s)",
+ port->user_name, SSL_get_version(port->ssl), SSL_get_cipher(port->ssl))));
+ else
+#endif
+ ereport(LOG,
+ (errmsg("replication connection authorized: user=%s",
+ port->user_name)));
+ }
else
- ereport(LOG,
- (errmsg("connection authorized: user=%s database=%s",
- port->user_name, port->database_name)));
+ {
+#ifdef USE_SSL
+ if (port->ssl)
+ ereport(LOG,
+ (errmsg("connection authorized: user=%s database=%s SSL(protocol: %s, cipher: %s)",
+ port->user_name, port->database_name, SSL_get_version(port->ssl), SSL_get_cipher(port->ssl))));
+ else
+#endif
+ ereport(LOG,
+ (errmsg("connection authorized: user=%s database=%s",
+ port->user_name, port->database_name)));
+ }
}
set_ps_display("startup", false);
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers