summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/postmaster.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-02-17 03:54:57 +0000
committerBruce Momjian <bruce@momjian.us>2004-02-17 03:54:57 +0000
commitc53611e3e7dc74c0c7dd79c78873fda1887f5b7f (patch)
treed1677458e6d70c3a2815a76d2cfeaeb9c47ed069 /src/backend/postmaster/postmaster.c
parent1f17316a3d472156ec8086c1760a7097c671eaa2 (diff)
This patch brings up to date what I did last year (now unfortunately
bitrotted) to allow the logging of the end of a session, enabled by the config setting "log_disconnections". Andrew Dunstan
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r--src/backend/postmaster/postmaster.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 2809cd9f5ed..ab9af54bac3 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.366 2004/02/11 22:25:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.367 2004/02/17 03:54:56 momjian Exp $
*
* NOTES
*
@@ -2428,6 +2428,13 @@ BackendInit(Port *port)
* Signal handlers setting is moved to tcop/postgres...
*/
+ /* save start time for end of session reporting */
+ gettimeofday(&(port->session_start),NULL);
+
+ /* set these to empty in case they are needed before we set them up */
+ port->remote_host = "";
+ port->remote_port = "";
+
/* Save port etc. for ps status */
MyProcPort = port;
@@ -2484,6 +2491,12 @@ BackendInit(Port *port)
}
/*
+ * save remote_host and remote_port in port stucture
+ */
+ port->remote_host = strdup(remote_host);
+ port->remote_port = strdup(remote_port);
+
+ /*
* Ready to begin client interaction. We will give up and exit(0)
* after a time delay, so that a broken client can't hog a connection
* indefinitely. PreAuthDelay doesn't count against the time limit.