Hi Ian,

I have put something together myself to get this
hook implemented. It works only in the prefork
the patch that is attached. maybe it is of help
to you.

Harrie

Ian Holsman wrote:
> 
> hi.
> 
> A while ago I mentioned a need for putting info into the global scorecard
> (a read-only state machine) which could be shared across processes, and
> ryan mentioned that he was planning to implement a hook to allow a module to
> do this.
> 
> Ryan, since you seem under the gun at the moment, can you give me a hint on
> how you wanted to do this, and I'll try to create a patch to do this.
> 
> ..Ian
> 
> --
> Ian Holsman
> Performance Measurement & Analysis
> 415-364-8608

-- 
phone: +39-3474932300
http://www.lisanza.net/
diff -ur ../httpd-2_0_16-orig/include/scoreboard.h ./include/scoreboard.h
--- ../httpd-2_0_16-orig/include/scoreboard.h   Sat Feb 24 04:40:48 2001
+++ ./include/scoreboard.h      Fri Apr 13 12:48:11 2001
@@ -79,6 +79,9 @@
 #define OPTIMIZE_TIMEOUTS
 #endif
 
+AP_DECLARE_HOOK(void,setup_shared_info,(apr_pool_t *pconf,apr_pool_t *plog,server_rec 
+*s));
+
+
 /* Scoreboard info on a process is, for now, kept very brief --- 
  * just status value and pid (the latter so that the caretaker process
  * can properly update the scoreboard when a process dies).  We may want
diff -ur ../httpd-2_0_16-orig/server/mpm/prefork/prefork.c 
./server/mpm/prefork/prefork.c
--- ../httpd-2_0_16-orig/server/mpm/prefork/prefork.c   Fri Mar  2 23:46:32 2001
+++ ./server/mpm/prefork/prefork.c      Fri Apr 13 13:12:01 2001
@@ -1082,6 +1107,7 @@
     SAFE_ACCEPT(accept_mutex_init(pconf));
     if (!is_graceful) {
         ap_create_scoreboard(pconf, SB_SHARED);
+        ap_run_setup_shared_info(pconf, plog, s);
     }
 #ifdef SCOREBOARD_FILE
     else {
diff -ur ../httpd-2_0_16-orig/server/scoreboard.c ./server/scoreboard.c
--- ../httpd-2_0_16-orig/server/scoreboard.c    Fri Mar  9 21:30:34 2001
+++ ./server/scoreboard.c       Fri Apr 13 12:47:45 2001
@@ -84,6 +84,14 @@
 AP_DECLARE_DATA int ap_extended_status = 0;
 AP_DECLARE_DATA apr_time_t ap_restart_time = 0;
 
+APR_HOOK_STRUCT(
+                   APR_HOOK_LINK(setup_shared_info)
+)
+
+AP_IMPLEMENT_HOOK_VOID(setup_shared_info,
+                       (apr_pool_t *pconf, apr_pool_t *plog, server_rec *s),
+                       (pconf,plog,s))
+
 #if APR_HAS_SHARED_MEMORY
 #include "apr_shmem.h"
 static apr_shmem_t *scoreboard_shm = NULL;

Reply via email to