pier        01/07/09 15:02:13

  Modified:    webapp/lib pr_info.c wa_main.c wa_request.c
  Log:
  Minor fixes.
  
  Revision  Changes    Path
  1.2       +21 -21    jakarta-tomcat-connectors/webapp/lib/pr_info.c
  
  Index: pr_info.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_info.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pr_info.c 2001/05/10 15:53:49     1.1
  +++ pr_info.c 2001/07/09 22:02:08     1.2
  @@ -55,7 +55,7 @@
    *                                                                           *
    * ========================================================================= */
   
  -/* @version $Id: pr_info.c,v 1.1 2001/05/10 15:53:49 pier Exp $ */
  +/* @version $Id: pr_info.c,v 1.2 2001/07/09 22:02:08 pier Exp $ */
   #include <wa.h>
   
   /* Counter for requests */
  @@ -73,8 +73,8 @@
   }
   
   /* Cleans up all resources allocated by this provider. */
  -static void info_destroy(void) {
  -    wa_debug(WA_MARK,"INFO provider destroyed");
  +static void info_shutdown(void) {
  +    wa_debug(WA_MARK,"INFO provider shut down");
   }
   
   /* Configure a connection with the parameter from the web server
  @@ -219,7 +219,7 @@
   static int info_handle_hdrname(void *d, const char *n, const char *v) {
       wa_request *r=(wa_request *)d;
   
  -    wa_rprintf(r,"       %s<br>\n",n);
  +    wa_rprintf(r,"       <nobr>%s</nobr><br>\n",n);
       return(TRUE);
   }
   
  @@ -232,7 +232,7 @@
           b=apr_pstrndup(r->pool,b,64);
           b=apr_pstrcat(r->pool,b," ....",NULL);
       }
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",b);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",b);
       return(TRUE);
   }
   
  @@ -346,21 +346,21 @@
       wa_rprintf(r,"     </font>\n");
       wa_rprintf(r,"    </td>\n");
       wa_rprintf(r,"    <td width=\"90%%\" valign=\"top\" align=\"left\">\n");
  -    wa_rprintf(r,"     <font size=\"-1\">\n");
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->serv->host);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->serv->addr);
  -    wa_rprintf(r,"      <b>&quot;%d&quot;</b><br>\n",r->serv->port);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->clnt->host);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->clnt->addr);
  -    wa_rprintf(r,"      <b>&quot;%d&quot;</b><br>\n",r->clnt->port);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->meth);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->ruri);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->args);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->prot);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->schm);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->user);
  -    wa_rprintf(r,"      <b>&quot;%s&quot;</b><br>\n",r->auth);
  -    wa_rprintf(r,"      <b>&quot;%d&quot;</b>\n",r->clen);
  +    wa_rprintf(r,"     <font size=\"-1\"><nobr>\n");
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->serv->host);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->serv->addr);
  +    wa_rprintf(r,"      <b><nobr>&quot;%d&quot;</nobr></b><br>\n",r->serv->port);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->clnt->host);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->clnt->addr);
  +    wa_rprintf(r,"      <b><nobr>&quot;%d&quot;</nobr></b><br>\n",r->clnt->port);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->meth);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->ruri);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->args);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->prot);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->schm);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->user);
  +    wa_rprintf(r,"      <b><nobr>&quot;%s&quot;</nobr></b><br>\n",r->auth);
  +    wa_rprintf(r,"      <b><nobr>&quot;%d&quot;</nobr></b>\n",r->clen);
       wa_rprintf(r,"     </font>\n");
       wa_rprintf(r,"    </td>\n");
   
  @@ -439,7 +439,7 @@
       "info",
       info_init,
       info_startup,
  -    info_destroy,
  +    info_shutdown,
       info_connect,
       info_deploy,
       info_conninfo,
  
  
  
  1.7       +12 -23    jakarta-tomcat-connectors/webapp/lib/wa_main.c
  
  Index: wa_main.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_main.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- wa_main.c 2001/06/07 09:40:33     1.6
  +++ wa_main.c 2001/07/09 22:02:09     1.7
  @@ -55,9 +55,13 @@
    *                                                                           *
    * ========================================================================= */
   
  -/* @version $Id: wa_main.c,v 1.6 2001/06/07 09:40:33 jfclere Exp $ */
  +/* @version $Id: wa_main.c,v 1.7 2001/07/09 22:02:09 pier Exp $ */
   #include <wa.h>
   
  +#ifndef DEBUG
  +#define DEBUG
  +#endif
  +
   /* The current APR memory pool. */
   apr_pool_t *wa_pool=NULL;
   /* The list of all deployed applications. */
  @@ -88,7 +92,7 @@
       while(wa_providers[x]!=NULL) {
           const char *ret=wa_providers[x]->init();
           if (ret!=NULL) {
  -            wa_destroy();
  +            wa_shutdown();
               return(ret);
           }
           x++;
  @@ -109,14 +113,14 @@
   }
   
   /* Clean up the WebApp Library. */
  -void wa_destroy(void) {
  +void wa_shutdown(void) {
       int x=0;
   
       /* Initialization check */
       if (wa_pool==NULL) return;
   
  -    /* Destroy providers */
  -    while(wa_providers[x]!=NULL) wa_providers[x++]->destroy();
  +    /* Shutdown providers */
  +    while(wa_providers[x]!=NULL) wa_providers[x++]->shutdown();
   
       /* Clean up this library and APR */
       apr_pool_destroy(wa_pool);
  @@ -124,7 +128,7 @@
       wa_configuration=NULL;
       apr_terminate();
   
  -    wa_debug(WA_MARK,"WebApp Library destroyed");
  +    wa_debug(WA_MARK,"WebApp Library shut down");
   }
   
   /* Deploy a web-application. */
  @@ -188,23 +192,7 @@
   
   /* Dump some debugging information. */
   void wa_debug(const char *f, const int l, const char *fmt, ...) {
  -    apr_time_t at;
  -    char st[128];
  -    va_list ap;
  -
  -    at=apr_time_now();
  -    apr_ctime(st, at);
  -    va_start(ap,fmt);
  -    fprintf(stderr,"[%s] %d (%s:%d) ",st,getpid(),f,l);
  -    vfprintf(stderr,fmt,ap);
  -    fprintf(stderr,"\n");
  -    fflush(stderr);
  -    va_end(ap);
  -}
  -
  -
  -/* Log an error message. */
  -void wa_log(const char *f, const int l, const char *fmt, ...) {
  +#ifdef DEBUG
       apr_time_t at;
       char st[128];
       va_list ap;
  @@ -217,4 +205,5 @@
       fprintf(stderr,"\n");
       fflush(stderr);
       va_end(ap);
  +#endif /* ifdef DEBUG */
   }
  
  
  
  1.11      +8 -8      jakarta-tomcat-connectors/webapp/lib/wa_request.c
  
  Index: wa_request.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_request.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- wa_request.c      2001/06/07 09:40:33     1.10
  +++ wa_request.c      2001/07/09 22:02:10     1.11
  @@ -55,7 +55,7 @@
    *                                                                           *
    * ========================================================================= */
   
  -/* @version $Id: wa_request.c,v 1.10 2001/06/07 09:40:33 jfclere Exp $ */
  +/* @version $Id: wa_request.c,v 1.11 2001/07/09 22:02:10 pier Exp $ */
   #include <wa.h>
   
   /* Allocate a new request structure. */
  @@ -137,7 +137,7 @@
       char buf[1024];
   
       va_start(ap,fmt);
  -    vsnprintf(buf,1024,fmt,ap);
  +    apr_vsnprintf(buf,1024,fmt,ap);
       va_end(ap);
   
       r->hand->log(r,WA_MARK,buf);
  @@ -150,13 +150,13 @@
       wa_rprintf(r,"\n\n");
       wa_rprintf(r,"<html>\n");
       wa_rprintf(r," <head>\n");
  -    wa_rprintf(r,"  <title>WebApp: %d Error (File: %s Line: %d)</title>",s,
  +    wa_rprintf(r,"  <title>WebApp: Error %d (File: %s Line: %d)</title>",s,
                  file,line);
       wa_rprintf(r," </head>\n");
       wa_rprintf(r," <body>\n");
  -    wa_rprintf(r,"  <div align=\"center\">");
  -    wa_rprintf(r,"    <h1>WebApp: %d Error (File: %s Line: %d)</h1>",s,
  -               file,line);
  +    wa_rprintf(r,"  <div align=\"center\">\n");
  +    wa_rprintf(r,"    <h1>WebApp: Error %d</h1>\n",s);
  +    wa_rprintf(r,"    <i>(File: %s Line: %d)</i>\n",file,line);
       wa_rprintf(r,"  </div>\n");
       wa_rprintf(r,"  <hr>\n");
       wa_rprintf(r,"  %s\n",buf);
  @@ -199,7 +199,7 @@
       char buf[1024];
   
       va_start(ap,fmt);
  -    vsnprintf(buf,1024,fmt,ap);
  +    apr_vsnprintf(buf,1024,fmt,ap);
       va_end(ap);
   
       r->hand->log(r,f,l,buf);
  @@ -239,7 +239,7 @@
       int ret=0;
   
       va_start(ap,fmt);
  -    ret=vsnprintf(buf,1024,fmt,ap);
  +    ret=apr_vsnprintf(buf,1024,fmt,ap);
       va_end(ap);
   
       return(r->hand->write(r,buf,ret));
  
  
  

Reply via email to