tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/connectors/apache-1.3 mod_webapp.c
Date Thu, 10 May 2001 08:47:49 GMT
pier        01/05/10 01:47:49

  Modified:    connectors/apache-1.3 mod_webapp.c
  Log:
  Updated module to successfully start up providers.
  
  Revision  Changes    Path
  1.13      +14 -9     jakarta-tomcat-4.0/connectors/apache-1.3/mod_webapp.c
  
  Index: mod_webapp.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/connectors/apache-1.3/mod_webapp.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- mod_webapp.c	2001/05/10 06:21:25	1.12
  +++ mod_webapp.c	2001/05/10 08:47:47	1.13
  @@ -57,7 +57,7 @@
   
   /**
    * @author  Pier Fumagalli <mailto:pier.fumagalli@eng.sun.com>
  - * @version $Id: mod_webapp.c,v 1.12 2001/05/10 06:21:25 pier Exp $
  + * @version $Id: mod_webapp.c,v 1.13 2001/05/10 08:47:47 pier Exp $
    */
   
   #include <httpd.h>
  @@ -91,6 +91,12 @@
       wam_initialized=FALSE;
   }
   
  +/* Startup the module and the WebApp Library */
  +static void wam_startup(server_rec *s, pool *p) {
  +    if (!wam_initialized) return;
  +    wa_startup();
  +}
  +
   /* Initialize the module and the WebApp Library */
   static const char *wam_init(pool *p) {
       const char *ret=NULL;
  @@ -261,7 +267,6 @@
   /* Set the HTTP status of the response. */
   void wam_handler_setstatus(wa_request *r, int status) {
       request_rec *req=(request_rec *)r->data;
  -    server_rec *svr=req->server;
   
       req->status=status;
   }
  @@ -269,7 +274,6 @@
   /* Set the MIME Content-Type of the response. */
   void wam_handler_setctype(wa_request *r, char *type) {
       request_rec *req=(request_rec *)r->data;
  -    server_rec *svr=req->server;
   
       if (type==NULL) return;
   
  @@ -280,7 +284,6 @@
   /* Set a header in the HTTP response. */
   void wam_handler_setheader(wa_request *r, char *name, char *value) {
       request_rec *req=(request_rec *)r->data;
  -    server_rec *svr=req->server;
   
       if (name==NULL) return;
       if (value==NULL) value="";
  @@ -292,7 +295,6 @@
   /* Commit the first part of the response (status and headers) */
   void wam_handler_commit(wa_request *r) {
       request_rec *req=(request_rec *)r->data;
  -    server_rec *svr=req->server;
   
       ap_send_http_header(req);
       ap_rflush(req);
  @@ -301,7 +303,6 @@
   /* Flush all data in the response buffer */
   void wam_handler_flush(wa_request *r) {
       request_rec *req=(request_rec *)r->data;
  -    server_rec *svr=req->server;
   
       ap_rflush(req);
   }
  @@ -309,7 +310,6 @@
   /* Read a chunk of text from the request body */
   int wam_handler_read(wa_request *r, char *buf, int len) {
       request_rec *req=(request_rec *)r->data;
  -    server_rec *svr=req->server;
       long ret=0;
   
       /* Check if we have something to read. */
  @@ -339,7 +339,6 @@
   /* Write a chunk of text into the response body. */
   int wam_handler_write(wa_request *r, char *buf, int len) {
       request_rec *req=(request_rec *)r->data;
  -    server_rec *svr=req->server;
   
       return(ap_rwrite(buf, len, req));
   }
  @@ -366,6 +365,9 @@
       wa_application *appl=NULL;
       wa_chain *elem=NULL;
   
  +    /* Paranoid check */
  +    if (!wam_initialized) return;
  +
       /* Check if this host was recognized */
       host=ap_get_module_config(r->server->module_config,&webapp_module);
       if (host==NULL) return(DECLINED);
  @@ -401,6 +403,9 @@
       char *ctmp=NULL;
       int ret=0;
   
  +    /* Paranoid check */
  +    if (!wam_initialized) return;
  +
       /* Try to get a hold on the webapp request structure */
       appl=(wa_application *)ap_get_module_config(r->request_config,
                                                   &webapp_module);
  @@ -485,7 +490,7 @@
       NULL,                               /* [8] fixups */
       NULL,                               /* [10] logger */
       NULL,                               /* [3] header parser */
  -    NULL,                               /* child initializer */
  +    wam_startup,                        /* child initializer */
       NULL,                               /* child exit/cleanup */
       NULL                                /* [1] post read_request handling */
   };
  
  
  

Mime
View raw message