PgSocket *client = server->link;
static const uint8 pkt_term[] = {'X', 0,0,0,4};
int send_term = 1;
+ usec_t now = get_cached_time();
if (cf_log_disconnections)
- slog_info(server, "closing because: %s", reason);
+ slog_info(server, "closing because: %s (age=%llu)", reason,
+ (now - server->connect_time) / USEC);
switch (server->state) {
case SV_ACTIVE:
/* drop client connection */
void disconnect_client(PgSocket *client, bool notify, const char *reason)
{
+ usec_t now = get_cached_time();
+
if (cf_log_disconnections)
- slog_info(client, "closing because: %s", reason);
+ slog_info(client, "closing because: %s (age=%llu)", reason,
+ (now - client->connect_time) / USEC);
switch (client->state) {
case CL_ACTIVE: