Browse Source

Add an uptime field to conf context

Yann Weber 4 years ago
parent
commit
2953f2feee
2 changed files with 8 additions and 3 deletions
  1. 3
    0
      include/conf.h
  2. 5
    3
      src/conf.c

+ 3
- 0
include/conf.h View File

@@ -152,6 +152,9 @@ struct pyfcgi_semdata_s {
152 152
 /**@brief Stores contextual informations about current process */
153 153
 struct pyfcgi_context_s {
154 154
 
155
+	/**@brief Timestamp of master process starts */
156
+	time_t uptime;
157
+
155 158
 	/**@brief Stores current process PID */
156 159
 	pid_t pid;
157 160
 	/**@brief Stores parent process PID */

+ 5
- 3
src/conf.c View File

@@ -32,9 +32,9 @@ void usage()
32 32
 
33 33
 void print_version(int fd)
34 34
 {
35
-	char version[16];
36
-	pyfcgi_python_version(version);
37
-	dprintf(fd, "%s\nPython %s\n", PACKAGE_STRING, version);
35
+	char pyversion[16];
36
+	pyfcgi_python_version(pyversion);
37
+	dprintf(fd, "%s\nPython %s\n", PACKAGE_STRING, pyversion);
38 38
 }
39 39
 
40 40
 void default_conf()
@@ -49,6 +49,8 @@ void default_conf()
49 49
 	PyFCGI_conf.pool_timeout = 5;
50 50
 	PyFCGI_conf.worker_timeout = 3;
51 51
 	PyFCGI_conf.worker_gc_timeout = 7;
52
+
53
+	PyFCGI_conf.context.uptime = time(NULL);
52 54
 }
53 55
 
54 56
 int parse_args(int argc, char *argv[])

Loading…
Cancel
Save