tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/netscape nsapi.dsp
Date Sun, 06 Feb 2005 17:43:10 GMT
mturk       2005/02/06 09:43:10

  Modified:    jk/native/apache-1.3 Makefile.netware Makefile.vc mod_jk.dsp
               jk/native/apache-2.0 Makefile.vc NWGNUmakefile mod_jk.dsp
               jk/native/common jk_util.c jk_worker_list.h list.mk.in
               jk/native/iis isapi.dsp
               jk/native/netscape nsapi.dsp
  Added:       jk/native/common jk_status.c jk_status.h
  Log:
  Add jk_status worker for displaying and managing worker runtime data.
  
  Revision  Changes    Path
  1.5       +2 -0      jakarta-tomcat-connectors/jk/native/apache-1.3/Makefile.netware
  
  Index: Makefile.netware
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/Makefile.netware,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Makefile.netware	28 Jul 2004 14:35:46 -0000	1.4
  +++ Makefile.netware	6 Feb 2005 17:43:09 -0000	1.5
  @@ -140,7 +140,9 @@
   	$(OBJDIR)/jk_md5.o \
   	$(OBJDIR)/jk_msg_buff.o \
   	$(OBJDIR)/jk_pool.o \
  +	$(OBJDIR)/jk_shm.o \
   	$(OBJDIR)/jk_sockbuf.o \
  +	$(OBJDIR)/jk_status.o \
   	$(OBJDIR)/jk_uri_worker_map.o \
   	$(OBJDIR)/jk_util.o \
   	$(OBJDIR)/jk_worker.o \
  
  
  
  1.4       +8 -0      jakarta-tomcat-connectors/jk/native/apache-1.3/Makefile.vc
  
  Index: Makefile.vc
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/Makefile.vc,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Makefile.vc	5 Feb 2005 19:40:19 -0000	1.3
  +++ Makefile.vc	6 Feb 2005 17:43:09 -0000	1.4
  @@ -53,6 +53,7 @@
   	-@erase "$(INTDIR)\jk_pool.obj"
   	-@erase "$(INTDIR)\jk_shm.obj"
   	-@erase "$(INTDIR)\jk_sockbuf.obj"
  +	-@erase "$(INTDIR)\jk_status.obj"
   	-@erase "$(INTDIR)\jk_uri_worker_map.obj"
   	-@erase "$(INTDIR)\jk_util.obj"
   	-@erase "$(INTDIR)\jk_worker.obj"
  @@ -90,6 +91,7 @@
   	"$(INTDIR)\jk_pool.obj" \
   	"$(INTDIR)\jk_shm.obj" \
   	"$(INTDIR)\jk_sockbuf.obj" \
  +	"$(INTDIR)\jk_status.obj" \
   	"$(INTDIR)\jk_uri_worker_map.obj" \
   	"$(INTDIR)\jk_util.obj" \
   	"$(INTDIR)\jk_worker.obj" \
  @@ -240,6 +242,12 @@
   	$(CPP) $(CPP_PROJ) $(SOURCE)
   
   
  +SOURCE=..\common\jk_status.c
  +
  +"$(INTDIR)\jk_status.obj" : $(SOURCE) "$(INTDIR)"
  +	$(CPP) $(CPP_PROJ) $(SOURCE)
  +
  +
   SOURCE=..\common\jk_uri_worker_map.c
   
   "$(INTDIR)\jk_uri_worker_map.obj" : $(SOURCE) "$(INTDIR)"
  
  
  
  1.9       +8 -0      jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.dsp
  
  Index: mod_jk.dsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.dsp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_jk.dsp	5 Feb 2005 19:40:19 -0000	1.8
  +++ mod_jk.dsp	6 Feb 2005 17:43:09 -0000	1.9
  @@ -156,6 +156,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\common\jk_status.c
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\common\jk_uri_worker_map.c
   # End Source File
   # Begin Source File
  @@ -256,6 +260,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\common\jk_status.h
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\common\jk_uri_worker_map.h
   # End Source File
   # Begin Source File
  
  
  
  1.4       +8 -0      jakarta-tomcat-connectors/jk/native/apache-2.0/Makefile.vc
  
  Index: Makefile.vc
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/Makefile.vc,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Makefile.vc	5 Feb 2005 19:40:19 -0000	1.3
  +++ Makefile.vc	6 Feb 2005 17:43:09 -0000	1.4
  @@ -53,6 +53,7 @@
   	-@erase "$(INTDIR)\jk_pool.obj"
   	-@erase "$(INTDIR)\jk_shm.obj"
   	-@erase "$(INTDIR)\jk_sockbuf.obj"
  +	-@erase "$(INTDIR)\jk_status.obj"
   	-@erase "$(INTDIR)\jk_uri_worker_map.obj"
   	-@erase "$(INTDIR)\jk_util.obj"
   	-@erase "$(INTDIR)\jk_worker.obj"
  @@ -90,6 +91,7 @@
   	"$(INTDIR)\jk_pool.obj" \
   	"$(INTDIR)\jk_shm.obj" \
   	"$(INTDIR)\jk_sockbuf.obj" \
  +	"$(INTDIR)\jk_status.obj" \
   	"$(INTDIR)\jk_uri_worker_map.obj" \
   	"$(INTDIR)\jk_util.obj" \
   	"$(INTDIR)\jk_worker.obj" \
  @@ -240,6 +242,12 @@
   	$(CPP) $(CPP_PROJ) $(SOURCE)
   
   
  +SOURCE=..\common\jk_status.c
  +
  +"$(INTDIR)\jk_status.obj" : $(SOURCE) "$(INTDIR)"
  +	$(CPP) $(CPP_PROJ) $(SOURCE)
  +
  +
   SOURCE=..\common\jk_uri_worker_map.c
   
   "$(INTDIR)\jk_uri_worker_map.obj" : $(SOURCE) "$(INTDIR)"
  
  
  
  1.6       +1 -0      jakarta-tomcat-connectors/jk/native/apache-2.0/NWGNUmakefile
  
  Index: NWGNUmakefile
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/NWGNUmakefile,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NWGNUmakefile	5 Feb 2005 19:40:19 -0000	1.5
  +++ NWGNUmakefile	6 Feb 2005 17:43:09 -0000	1.6
  @@ -210,6 +210,7 @@
   	$(OBJDIR)/jk_pool.o \
   	$(OBJDIR)/jk_shm.o \
   	$(OBJDIR)/jk_sockbuf.o \
  +	$(OBJDIR)/jk_status.o \
   	$(OBJDIR)/jk_uri_worker_map.o \
   	$(OBJDIR)/jk_util.o \
   	$(OBJDIR)/jk_worker.o \
  
  
  
  1.10      +8 -0      jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.dsp
  
  Index: mod_jk.dsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.dsp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- mod_jk.dsp	5 Feb 2005 19:40:19 -0000	1.9
  +++ mod_jk.dsp	6 Feb 2005 17:43:09 -0000	1.10
  @@ -156,6 +156,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\common\jk_status.c
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\common\jk_uri_worker_map.c
   # End Source File
   # Begin Source File
  @@ -260,6 +264,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\common\jk_status.h
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\common\jk_uri_worker_map.h
   # End Source File
   # Begin Source File
  
  
  
  1.53      +3 -3      jakarta-tomcat-connectors/jk/native/common/jk_util.c
  
  Index: jk_util.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_util.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- jk_util.c	6 Feb 2005 13:30:34 -0000	1.52
  +++ jk_util.c	6 Feb 2005 17:43:09 -0000	1.53
  @@ -121,7 +121,7 @@
    */
   #if !defined(HAVE_VSNPRINTF) && !defined(HAVE_APR)
   static FILE *f = NULL;
  -int vsnprintf(char *str, size_t n, const char *fmt, va_list ap)
  +static int vsnprintf(char *str, size_t n, const char *fmt, va_list ap)
   {
       int res;
   
  @@ -141,7 +141,7 @@
   }
   #endif
   #if !defined(HAVE_SNPRINTF) && !defined(HAVE_APR)
  -int snprintf(char *str, size_t n, const char *fmt, ...)
  +static int snprintf(char *str, size_t n, const char *fmt, ...)
   {
       va_list ap;
       int res;
  
  
  
  1.12      +8 -1      jakarta-tomcat-connectors/jk/native/common/jk_worker_list.h
  
  Index: jk_worker_list.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_worker_list.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_worker_list.h	16 Dec 2004 08:42:19 -0000	1.11
  +++ jk_worker_list.h	6 Feb 2005 17:43:09 -0000	1.12
  @@ -46,6 +46,7 @@
   #include "jk_jni_worker.h"
   #endif
   #include "jk_lb_worker.h"
  +#include "jk_status.h"
   
   struct worker_factory_record
   {
  @@ -81,6 +82,12 @@
       {JK_LB_WORKER_NAME, lb_worker_factory},
   
       /*
  +     * Status worker. Performs display display and
  +     * worker management.
  +     */
  +    {JK_STATUS_WORKER_NAME, status_worker_factory},
  +
  +    /*
        * Marks the end of the worker factory list.
        */
       {NULL, NULL}
  
  
  
  1.9       +2 -1      jakarta-tomcat-connectors/jk/native/common/list.mk.in
  
  Index: list.mk.in
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/list.mk.in,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- list.mk.in	5 Feb 2005 19:40:19 -0000	1.8
  +++ list.mk.in	6 Feb 2005 17:43:09 -0000	1.9
  @@ -7,4 +7,5 @@
                   ${JK}jk_map${OEXT} ${JK}jk_uri_worker_map${OEXT} \
                   ${JK}jk_ajp14${OEXT} ${JK}jk_ajp14_worker${OEXT} \
                   ${JK}jk_md5${OEXT} ${JK}jk_shm${OEXT} @JK_JNI_WORKER@ \
  -                ${JK}jk_ajp_common${OEXT} ${JK}jk_context${OEXT}
  +                ${JK}jk_ajp_common${OEXT} ${JK}jk_context${OEXT} \
  +                ${JK}jk_status${OEXT}
  
  
  
  1.1                  jakarta-tomcat-connectors/jk/native/common/jk_status.c
  
  Index: jk_status.c
  ===================================================================
  /*
   *  Copyright 1999-2004 The Apache Software Foundation
   *
   *  Licensed under the Apache License, Version 2.0 (the "License");
   *  you may not use this file except in compliance with the License.
   *  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   *  Unless required by applicable law or agreed to in writing, software
   *  distributed under the License is distributed on an "AS IS" BASIS,
   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *  See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  
  /***************************************************************************
   * Description: Status worker, dispay and manages JK workers               *
   * Author:      Mladen Turk <mturk@jboss.com>                              *
   * Version:     $Revision: 1.1 $                                           *
   ***************************************************************************/
  
  #include "jk_pool.h"
  #include "jk_service.h"
  #include "jk_util.h"
  #include "jk_worker.h"
  #include "jk_status.h"
  #include "jk_mt.h"
  
  #define HUGE_BUFFER_SIZE (8*1024)
  
  typedef struct status_worker status_worker_t;
  
  struct status_endpoint
  {
      jk_endpoint_t   *e;
      status_worker_t *s_worker;
      jk_endpoint_t   endpoint;
  };
  
  typedef struct status_endpoint status_endpoint_t;
  
  struct status_worker
  {
      jk_pool_t         p;
      jk_pool_atom_t    buf[TINY_POOL_SIZE];
      const char        *name;
      jk_worker_t       worker;
      status_endpoint_t ep;
  };
  
  static const char *headers_names[] = {
      "Content-Type",
      "Cache-Control",
      "Pragma",
      NULL
  };
  
  static const char *headers_vals[] = {
      "text/html",
      "no-cache",
      "no-cache",
      NULL
  };
  
  #if !defined(HAVE_VSNPRINTF) && !defined(HAVE_APR)
  static FILE *f = NULL;
  static int vsnprintf(char *str, size_t n, const char *fmt, va_list ap)
  {
      int res;
  
      if (f == NULL)
          f = fopen("/dev/null", "w");
      if (f == NULL)
          return -1;
  
      setvbuf(f, str, _IOFBF, n);
  
      res = vfprintf(f, fmt, ap);
  
      if (res > 0 && res < n) {
          res = vsprintf(str, fmt, ap);
      }
      return res;
  }
  #endif
  
  int jk_printf(jk_ws_service_t *s, const char *fmt, ...)
  {
      int rc = 0;
      va_list args;
  #ifdef NETWARE
  /* On NetWare, this can get called on a thread that has a limited stack so */
  /* we will allocate and free the temporary buffer in this function         */
          char *buf;
  #else
          char buf[HUGE_BUFFER_SIZE];
  #endif
  
      if (!s || !fmt) {
          return -1;
      }
      va_start(args, fmt);
  
  #ifdef NETWARE
          buf = (char *)malloc(HUGE_BUFFER_SIZE);
          if (NULL == buf)
              return -1;
  #endif
  #ifdef USE_VSPRINTF             /* until we get a vsnprintf function */
      rc = vsprintf(buf, fmt, args);
  #else
      rc = vsnprintf(buf, HUGE_BUFFER_SIZE, fmt, args);
  #endif
      va_end(args);
      if (rc > 0)
          s->write(s, buf, rc);
  #ifdef NETWARE
          free(buf);
  #endif
      return rc;
  }
  
  static int JK_METHOD service(jk_endpoint_t *e,
                               jk_ws_service_t *s,
                               jk_logger_t *l, int *is_recoverable_error)
  {
      JK_TRACE_ENTER(l);
  
      if (e && e->endpoint_private && s) {
          status_endpoint_t *p = e->endpoint_private;
  
  
          JK_TRACE_EXIT(l);
          return JK_TRUE;
      }
  
      jk_log(l, JK_LOG_ERROR, "status: end of service with error");
      JK_TRACE_EXIT(l);
      return JK_FALSE;
  }
  
  static int JK_METHOD done(jk_endpoint_t **e, jk_logger_t *l)
  {
      JK_TRACE_ENTER(l);
  
      if (e && *e && (*e)->endpoint_private) {
          *e = NULL;
          JK_TRACE_EXIT(l);
          return JK_TRUE;
      }
  
      JK_LOG_NULL_PARAMS(l);
      JK_TRACE_EXIT(l);
      return JK_FALSE;
  }
  
  static int JK_METHOD validate(jk_worker_t *pThis,
                                jk_map_t *props,
                                jk_worker_env_t *we, jk_logger_t *l)
  {
      JK_TRACE_ENTER(l);
  
      if (pThis && pThis->worker_private) {
          status_worker_t *p = pThis->worker_private;
      }
  
      JK_LOG_NULL_PARAMS(l);
      JK_TRACE_EXIT(l);
      return JK_FALSE;
  }
  
  static int JK_METHOD init(jk_worker_t *pThis,
                            jk_map_t *props,
                            jk_worker_env_t *we, jk_logger_t *log)
  {
      status_worker_t *p = (status_worker_t *)pThis->worker_private;
      JK_TRACE_ENTER(log);
  
      JK_TRACE_EXIT(log);
      return JK_TRUE;
  }
  
  static int JK_METHOD get_endpoint(jk_worker_t *pThis,
                                    jk_endpoint_t **pend, jk_logger_t *l)
  {
      JK_TRACE_ENTER(l);
  
      if (pThis && pThis->worker_private && pend) {
          status_worker_t *p = (status_worker_t *)pThis->worker_private;
          *pend = p->ep.e;
          JK_TRACE_EXIT(l);
          return JK_TRUE;
      }
      else {
          JK_LOG_NULL_PARAMS(l);
      }
  
      JK_TRACE_EXIT(l);
      return JK_FALSE;
  }
  
  static int JK_METHOD destroy(jk_worker_t **pThis, jk_logger_t *l)
  {
      JK_TRACE_ENTER(l);
  
      if (pThis && *pThis && (*pThis)->worker_private) {
          status_worker_t *private_data = (*pThis)->worker_private;
  
          jk_close_pool(&private_data->p);
          free(private_data);
  
          JK_TRACE_EXIT(l);
          return JK_TRUE;
      }
  
      JK_LOG_NULL_PARAMS(l);
      JK_TRACE_EXIT(l);
      return JK_FALSE;
  }
  
  int JK_METHOD status_worker_factory(jk_worker_t **w,
                                      const char *name, jk_logger_t *l)
  {
      JK_TRACE_ENTER(l);
  
      if (NULL != name && NULL != w) {
          status_worker_t *private_data =
              (status_worker_t *) calloc(1, sizeof(status_worker_t));
  
          jk_open_pool(&private_data->p,
                          private_data->buf,
                          sizeof(jk_pool_atom_t) * TINY_POOL_SIZE);
  
          private_data->name = name;
  
          private_data->worker.worker_private = private_data;
          private_data->worker.validate = validate;
          private_data->worker.init = init;
          private_data->worker.get_endpoint = get_endpoint;
          private_data->worker.destroy = destroy;
          private_data->worker.retries = JK_RETRIES;
  
          /* Status worker has single static endpoint. */
          private_data->ep.endpoint.done = done;
          private_data->ep.endpoint.service = service;
          private_data->ep.endpoint.endpoint_private = &private_data->ep;
          private_data->ep.e = &(private_data->ep.endpoint);
          private_data->ep.s_worker = private_data;
          *w = &private_data->worker;
          JK_TRACE_EXIT(l);
          return JK_TRUE;
      }
      else {
          JK_LOG_NULL_PARAMS(l);
      }
  
      JK_TRACE_EXIT(l);
      return JK_FALSE;
  }
  
  
  
  1.1                  jakarta-tomcat-connectors/jk/native/common/jk_status.h
  
  Index: jk_status.h
  ===================================================================
  /*
   *  Copyright 1999-2004 The Apache Software Foundation
   *
   *  Licensed under the Apache License, Version 2.0 (the "License");
   *  you may not use this file except in compliance with the License.
   *  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   *  Unless required by applicable law or agreed to in writing, software
   *  distributed under the License is distributed on an "AS IS" BASIS,
   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *  See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  
  /***************************************************************************
   * Description: Status worker header file                                  *
   * Author:      Mladen Turk <mturk@jboss.com>                              * 
   * Version:     $Revision: 1.1 $                                           *
   ***************************************************************************/
  
  #ifndef JK_STATUS_H
  #define JK_STATUS_H
  
  #include "jk_logger.h"
  #include "jk_service.h"
  
  #ifdef __cplusplus
  extern "C"
  {
  #endif                          /* __cplusplus */
  
  #define JK_STATUS_WORKER_NAME     ("status")
  #define JK_STATUS_DEF_DOMAIN_NAME ("unknown")
  
  int JK_METHOD status_worker_factory(jk_worker_t **w,
                                      const char *name, jk_logger_t *l);
  
  #ifdef __cplusplus
  }
  #endif                          /* __cplusplus */
  #endif                          /* JK_STATUS_H */
  
  
  
  1.12      +8 -0      jakarta-tomcat-connectors/jk/native/iis/isapi.dsp
  
  Index: isapi.dsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/isapi.dsp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- isapi.dsp	5 Feb 2005 19:40:19 -0000	1.11
  +++ isapi.dsp	6 Feb 2005 17:43:09 -0000	1.12
  @@ -164,6 +164,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\common\jk_status.c
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\common\jk_uri_worker_map.c
   # End Source File
   # Begin Source File
  @@ -260,6 +264,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\common\jk_status.h
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\common\jk_uri_worker_map.h
   # End Source File
   # Begin Source File
  
  
  
  1.11      +8 -0      jakarta-tomcat-connectors/jk/native/netscape/nsapi.dsp
  
  Index: nsapi.dsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/netscape/nsapi.dsp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- nsapi.dsp	5 Feb 2005 19:40:19 -0000	1.10
  +++ nsapi.dsp	6 Feb 2005 17:43:09 -0000	1.11
  @@ -162,6 +162,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\common\jk_status.c
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\common\jk_uri_worker_map.c
   # End Source File
   # Begin Source File
  @@ -250,6 +254,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\common\jk_status.h
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\common\jk_uri_worker_map.h
   # End Source File
   # Begin Source File
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message