costin      2002/09/30 13:51:11

  Modified:    src/native/mod_jserv jserv.h jserv_ajpv11.c jserv_ajpv12.c
                        jserv_balance.c mod_jserv.c
  Log:
  Update the workspace with various fixes from java-jserv.
  
  Revision  Changes    Path
  1.2       +2 -2      jakarta-tomcat/src/native/mod_jserv/jserv.h
  
  Index: jserv.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jserv/jserv.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jserv.h   26 Aug 2000 01:21:50 -0000      1.1
  +++ jserv.h   30 Sep 2002 20:51:11 -0000      1.2
  @@ -238,7 +238,7 @@
    *                                                                           *
    *****************************************************************************/
   
  -#define NB_MAX_JSERVS  25
  +#define NB_MAX_JSERVS  256
   
   #define DOWN '-'
   #define SHUTDOWN_IMMEDIATE 'X'
  
  
  
  1.2       +2 -2      jakarta-tomcat/src/native/mod_jserv/jserv_ajpv11.c
  
  Index: jserv_ajpv11.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jserv/jserv_ajpv11.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jserv_ajpv11.c    26 Aug 2000 01:21:50 -0000      1.1
  +++ jserv_ajpv11.c    30 Sep 2002 20:51:11 -0000      1.2
  @@ -139,7 +139,7 @@
        i=send(sock,"\x30\x30\x30\x30",4,0);
   #endif
           if (i==4) return 0;
  -        else return 0;
  +        else return -1; /* Was return -1 in tomcat CVS */
       }
   
       /* Format message */
  
  
  
  1.2       +32 -3     jakarta-tomcat/src/native/mod_jserv/jserv_ajpv12.c
  
  Index: jserv_ajpv12.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jserv/jserv_ajpv12.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jserv_ajpv12.c    26 Aug 2000 01:21:50 -0000      1.1
  +++ jserv_ajpv12.c    30 Sep 2002 20:51:11 -0000      1.2
  @@ -65,6 +65,24 @@
    * Code for ajpv12 protocol                                                   *
    *****************************************************************************/
   
  +/* copy + paste from src/main/http_main.c" */
  +#ifdef _OSD_POSIX
  +#define MAX_SECS_TO_LINGER 30
  +static void sock_enable_linger(jserv_config *cfg, int s)
  +{
  +    struct linger li;
  +
  +    li.l_onoff = 1;
  +    li.l_linger = MAX_SECS_TO_LINGER;
  +
  +    if (setsockopt(s, SOL_SOCKET, SO_LINGER,
  +                   (char *) &li, sizeof(struct linger)) < 0) {
  +        jserv_error(JSERV_LOG_INFO,cfg,"ajp12:setsockopt: (SO_LINGER)");
  +        /* not a fatal error */
  +    }
  +}
  +#endif
  +
   /* ========================================================================= */
   /* Open a socket to JServ host */
   /* FIXME: short port gets overflowed - it's not unsigned */
  @@ -114,6 +132,8 @@
                       "can not connect to host",
                       inet_ntoa(addr.sin_addr),
                       port);
  +        if (sock != -1)
  +            ap_pclosesocket(p, sock);
           return -1;
       }
   #ifdef TCP_NODELAY
  @@ -124,6 +144,11 @@
       }
   #endif
   
  +#ifdef _OSD_POSIX
  +    /* otherwise the shutdown signal is not received */
  +    sock_enable_linger(cfg, sock);
  +#endif
  +
       /* Return the socket number */
       return sock;
   }
  @@ -662,7 +687,7 @@
   
   
       /* Flush buffers and kill our writing timeout */
  -    ap_kill_timeout(r);
  +    ap_kill_timeout(r); /* This isn't in jserv CVS */
   
   
       /* If there is a request entity, send it */
  @@ -770,8 +795,12 @@
       }
   
       /* Send the function request */
  +#ifdef WIN32
  +    ret = send( sock, signal, 2, 0 );
  +#else
       ret = write( sock, signal, 2);
  -
  +#endif
  +    
       if (ret!=2) {
           jserv_error(JSERV_LOG_EMERG,cfg,"ajp12: cannot send function");
           ap_destroy_pool(p);
  
  
  
  1.2       +19 -2     jakarta-tomcat/src/native/mod_jserv/jserv_balance.c
  
  Index: jserv_balance.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jserv/jserv_balance.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jserv_balance.c   26 Aug 2000 01:21:50 -0000      1.1
  +++ jserv_balance.c   30 Sep 2002 20:51:11 -0000      1.2
  @@ -126,6 +126,7 @@
   
     cname = ap_pstrcat(r->pool, cname, "=", NULL);
     if ((cookie = ap_table_get(r->headers_in, "Cookie")) != NULL)
  +      /* ap_log_rerror(APLOG_MARK, APLOG_ALERT, r, "COOKIE: %s", cookie );      */
       if ((value = strstr(cookie, cname)) != NULL) {
         char *cookiebuf, *cookieend;
         value += strlen(cname);
  @@ -396,7 +397,23 @@
       /* *** another process (watchdog process)                              */
       /* *** we just try to read in the mmap'ed file                         */
   
  -#ifndef WIN32
  +    /* In tomcat CVS was: ifndef WIN32. Aparently fixed in jserv. */
  +#if 0
  +    /*
  +     * We never want to do keep the current server because in the following
  +     * scenario balancing will completely fail, overloading the first machine
  +     * that is responding; we use simple round-robin instead like in the
  +     * Win32 case.
  +     *
  +     * We have 10 jserv machines js1-10, and js1-5 are marked down, js6-10
  +     * are ok. 50% of the requests will go to the down machines, and each
  +     * one will try to find a working jserv, and ending up using js6. So
  +     * we end up with a load distribution:
  +     *
  +     *  js6 js7 js8 js9 js10
  +     *  60% 10% 10% 10% 10%
  +     */
  +
       if (req->mount->curr != req->mount->hosturls) {
         if (jserv_isdead(cfg, req->mount->hosturls)) {
           /*keep the current target */
  
  
  
  1.2       +33 -2     jakarta-tomcat/src/native/mod_jserv/mod_jserv.c
  
  Index: mod_jserv.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jserv/mod_jserv.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_jserv.c       26 Aug 2000 01:21:51 -0000      1.1
  +++ mod_jserv.c       30 Sep 2002 20:51:11 -0000      1.2
  @@ -444,6 +444,33 @@
           }
   #endif
       }
  +    /*A&M changes made to export env vars defined in virtual host (like
  +https) */
  +    cfg->envvars = base->envvars;
  +
  +    if (!ap_is_empty_table(override->envvars)) {
  +        int i;
  +        array_header *hdr_arr;
  +        table_entry *elts;
  +
  +        hdr_arr = ap_table_elts(override->envvars);
  +        elts = (table_entry *) hdr_arr->elts;
  +
  +        for (i = 0; i < hdr_arr->nelts; ++i) {
  +            if (!elts[i].key) continue;
  +            if (!elts[i].val) continue;
  +
  +            ap_table_add(cfg->envvars, ap_pstrdup(p,elts[i].key),
  +ap_pstrdup(p,elts[i].val));
  +
  +            /* A&M
  +            jserv_error(JSERV_LOG_INFO,cfg,"ajp12: added env var %s %s
  +",elts[i].key, elts[i].val);
  +            */
  +        }
  +    }
  +
  +    /* end changes made by us */
   
       /* Fill mount defaults */
       jserv_mount_config_default(p, cfg);
  @@ -1033,7 +1060,11 @@
           const char *ret;
   
           /* Get the secret key file contents and length */
  -        ret=jserv_readfile(cmd->pool, value3, JSERV_TRUE, &mnt->secret,
  +       mnt->secretfile=ap_pstrdup(p,value3);
  +
  +        /* Get the secret key file contents and length */
  +        ret=jserv_readfile(cmd->pool, mnt->secretfile, JSERV_TRUE, 
  +                          &mnt->secret,
                              &mnt->secretsize);
   
           /* If ret is not null, an error occourred and ret points to message */
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to