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
 /**@brief Stores contextual informations about current process */
152
 /**@brief Stores contextual informations about current process */
153
 struct pyfcgi_context_s {
153
 struct pyfcgi_context_s {
154
 
154
 
155
+	/**@brief Timestamp of master process starts */
156
+	time_t uptime;
157
+
155
 	/**@brief Stores current process PID */
158
 	/**@brief Stores current process PID */
156
 	pid_t pid;
159
 	pid_t pid;
157
 	/**@brief Stores parent process PID */
160
 	/**@brief Stores parent process PID */

+ 5
- 3
src/conf.c View File

32
 
32
 
33
 void print_version(int fd)
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
 void default_conf()
40
 void default_conf()
49
 	PyFCGI_conf.pool_timeout = 5;
49
 	PyFCGI_conf.pool_timeout = 5;
50
 	PyFCGI_conf.worker_timeout = 3;
50
 	PyFCGI_conf.worker_timeout = 3;
51
 	PyFCGI_conf.worker_gc_timeout = 7;
51
 	PyFCGI_conf.worker_gc_timeout = 7;
52
+
53
+	PyFCGI_conf.context.uptime = time(NULL);
52
 }
54
 }
53
 
55
 
54
 int parse_args(int argc, char *argv[])
56
 int parse_args(int argc, char *argv[])

Loading…
Cancel
Save