]> granicus.if.org Git - apache/blobdiff - include/scoreboard.h
followup to r1864733
[apache] / include / scoreboard.h
index d2be9c87a7d60c4c82fc2c60110f3ac5d1bf203c..47d036d014806a2082cfd44641861e0f51b40fc7 100644 (file)
@@ -26,7 +26,7 @@
 extern "C" {
 #endif
 
-#ifdef HAVE_SYS_TIMES_H
+#if APR_HAVE_SYS_TIME_H
 #include <sys/time.h>
 #include <sys/times.h>
 #endif
@@ -112,9 +112,12 @@ struct worker_score {
 #ifdef HAVE_TIMES
     struct tms times;
 #endif
-    char client[40];            /* Keep 'em small... but large enough to hold an IPv6 address */
+    char client[32];            /* DEPRECATED: Keep 'em small... */
     char request[64];           /* We just want an idea... */
     char vhost[32];             /* What virtual host is being accessed? */
+    char protocol[16];          /* What protocol is used on the connection? */
+    char client64[64];
+    apr_time_t duration;
 };
 
 typedef struct {
@@ -124,6 +127,9 @@ typedef struct {
                                          * should still be serving requests.
                                          */
     apr_time_t restart_time;
+#ifdef HAVE_TIMES
+    struct tms times;
+#endif
 } global_score;
 
 /* stuff which the parent generally writes and the children rarely read */
@@ -167,6 +173,7 @@ apr_status_t ap_cleanup_scoreboard(void *d);
  */
 AP_DECLARE(int) ap_exists_scoreboard_image(void);
 AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sbh, request_rec *r);
+AP_DECLARE(void) ap_set_conn_count(ap_sb_handle_t *sb, request_rec *r, unsigned short conn_count);
 
 AP_DECLARE(apr_status_t) ap_reopen_scoreboard(apr_pool_t *p, apr_shm_t **shm, int detached);
 AP_DECLARE(void) ap_init_scoreboard(void *shared_score);
@@ -174,17 +181,42 @@ AP_DECLARE(int) ap_calc_scoreboard_size(void);
 
 AP_DECLARE(void) ap_create_sb_handle(ap_sb_handle_t **new_sbh, apr_pool_t *p,
                                      int child_num, int thread_num);
+AP_DECLARE(void) ap_update_sb_handle(ap_sb_handle_t *sbh,
+                                     int child_num, int thread_num);
 
 AP_DECLARE(int) ap_find_child_by_pid(apr_proc_t *pid);
 AP_DECLARE(int) ap_update_child_status(ap_sb_handle_t *sbh, int status, request_rec *r);
 AP_DECLARE(int) ap_update_child_status_from_indexes(int child_num, int thread_num,
                                                     int status, request_rec *r);
 AP_DECLARE(int) ap_update_child_status_from_conn(ap_sb_handle_t *sbh, int status, conn_rec *c);
+AP_DECLARE(int) ap_update_child_status_from_server(ap_sb_handle_t *sbh, int status, 
+                                                   conn_rec *c, server_rec *s);
+AP_DECLARE(int) ap_update_child_status_descr(ap_sb_handle_t *sbh, int status, const char *descr);
+
 AP_DECLARE(void) ap_time_process_request(ap_sb_handle_t *sbh, int status);
 
+AP_DECLARE(int) ap_update_global_status(void);
+
 AP_DECLARE(worker_score *) ap_get_scoreboard_worker(ap_sb_handle_t *sbh);
+
+/** Return a pointer to the worker_score for a given child, thread pair.
+ * @param child_num The child number.
+ * @param thread_num The thread number.
+ * @return A pointer to the worker_score structure.
+ * @deprecated This function is deprecated, use ap_copy_scoreboard_worker instead. */
 AP_DECLARE(worker_score *) ap_get_scoreboard_worker_from_indexes(int child_num,
                                                                 int thread_num);
+
+/** Copy the contents of a worker scoreboard entry.  The contents of
+ * the worker_score structure are copied verbatim into the dest
+ * structure.
+ * @param dest Output parameter.
+ * @param child_num The child number.
+ * @param thread_num The thread number.
+ */
+AP_DECLARE(void) ap_copy_scoreboard_worker(worker_score *dest,
+                                           int child_num, int thread_num);
+
 AP_DECLARE(process_score *) ap_get_scoreboard_process(int x);
 AP_DECLARE(global_score *) ap_get_scoreboard_global(void);