httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Wed, 13 Jun 2001 20:11:47 GMT
gstein      01/06/13 13:11:46

  Modified:    include  http_core.h
               server   core.c
  Log:
  Define a hook for fetching management/status items.
  
  This patch was submitted by Ian Holsman. Greg revised some names, applied
  the Apache style, and namespace-prefixed the public symbols. Minor bugfix in
  the use of the hook implementation macro.
  
  Submitted by: Ian Holsman <IanH@cnet.com>
  Reviewed by: Greg Stein
  
  Revision  Changes    Path
  1.44      +44 -0     httpd-2.0/include/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_core.h,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -u -r1.43 -r1.44
  --- http_core.h	2001/04/13 05:19:25	1.43
  +++ http_core.h	2001/06/13 20:11:43	1.44
  @@ -60,6 +60,7 @@
   #define APACHE_HTTP_CORE_H
   
   #include "apr.h"
  +#include "apr_hash.h"
   
   #if APR_HAVE_STRUCT_RLIMIT
   #include <sys/time.h>
  @@ -497,6 +498,49 @@
   AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const
char *arg);
   
   #endif
  +
  +
  +/* ----------------------------------------------------------------------
  + *
  + * Runtime status/management
  + */
  +
  +typedef enum {
  +    ap_mgmt_type_string,
  +    ap_mgmt_type_long,
  +    ap_mgmt_type_hash
  +} ap_mgmt_type_e;
  +
  +typedef union {
  +    const char *s_value;
  +    long i_value;
  +    apr_hash_t *h_value;
  +} ap_mgmt_value;
  +
  +typedef struct {
  +    const char *description;
  +    const char *name;
  +    ap_mgmt_type_e vtype;
  +    ap_mgmt_value v;
  +} ap_mgmt_item_t;
  +
  +/**
  + * This hook provdes a way for modules to provide metrics/statistics about
  + * their operational status.
  + *
  + * @param p A pool to use to create entries in the hash table
  + * @param val The name of the parameter(s) that is wanted. This is
  + *            tree-structured would be in the form ('*' is all the tree,
  + *            'module.*' all of the module , 'module.foo.*', or
  + *            'module.foo.bar' )
  + * @param ht The hash table to store the results. Keys are item names, and
  + *           the values point to ap_mgmt_item_t structures.
  + * @ingroup hooks
  + */
  +AP_DECLARE_HOOK(int, get_mgmt_items,
  +                (apr_pool_t *p, const char * val, apr_hash_t *ht))
  +
  +/* ---------------------------------------------------------------------- */
   
   #ifdef __cplusplus
   }
  
  
  
  1.20      +10 -0     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -u -r1.19 -r1.20
  --- core.c	2001/06/13 13:44:39	1.19
  +++ core.c	2001/06/13 20:11:45	1.20
  @@ -60,6 +60,7 @@
   #include "apr_strings.h"
   #include "apr_lib.h"
   #include "apr_fnmatch.h"
  +#include "apr_hash.h"
   #include "apr_thread_proc.h"    /* for RLIMIT stuff */
   
   #define APR_WANT_IOVEC
  @@ -93,6 +94,15 @@
   #define AP_DEFAULT_LIMIT_XML_BODY       ((size_t)1000000)
   
   #define AP_MIN_SENDFILE_BYTES           (256)
  +
  +APR_HOOK_STRUCT(
  +    APR_HOOK_LINK(get_mgmt_items)
  +)
  +
  +AP_IMPLEMENT_HOOK_RUN_ALL(int, get_mgmt_items,
  +                          (apr_pool_t *p, const char *val, apr_hash_t *ht),
  +                          (p, val, ht), OK, DECLINED)
  +
   
   /* Server core module... This module provides support for really basic
    * server operations, including options and commands which control the
  
  
  

Mime
View raw message