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/xdocs/config apache.xml
Date Wed, 18 May 2005 18:04:53 GMT
mturk       2005/05/18 11:04:53

  Modified:    jk/native/apache-1.3 mod_jk.c
               jk/native/apache-2.0 mod_jk.c
               jk/native/common jk_ajp_common.c jk_global.h jk_service.h
               jk/native/iis jk_isapi_plugin.c
               jk/native/netscape jk_nsapi_plugin.c
               jk/xdocs changelog.xml
               jk/xdocs/config apache.xml
  Log:
  Adde FlushPackets option.
  
  Revision  Changes    Path
  1.83      +19 -7     jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- mod_jk.c	15 May 2005 11:10:11 -0000	1.82
  +++ mod_jk.c	18 May 2005 18:04:52 -0000	1.83
  @@ -300,6 +300,15 @@
       return JK_FALSE;
   }
   
  +static void JK_METHOD ws_flush(jk_ws_service_t *s)
  +{
  +    if (s && s->ws_private) {
  +        apache_private_data_t *p = s->ws_private;
  +        BUFF *bf = p->r->connection->client;
  +        ap_bflush(bf);
  +    }
  +}
  +
   /*
    * Write a chunk of response data back to the browser.  If the headers
    * haven't yet been sent over, send over default header values (Status =
  @@ -317,7 +326,6 @@
           apache_private_data_t *p = s->ws_private;
   
           if (len) {
  -            BUFF *bf = p->r->connection->client;
               char *buf = (char *)b;
               int w = (int)len;
               int r = 0;
  @@ -329,6 +337,7 @@
               }
   
               if (p->r->header_only) {
  +                BUFF *bf = p->r->connection->client;
                   ap_bflush(bf);
                   return JK_TRUE;
               }
  @@ -351,11 +360,6 @@
                   }
   
               }
  -
  -            /*
  -             * To allow server push.
  -             */
  -            ap_bflush(bf);
           }
   
           return JK_TRUE;
  @@ -436,6 +440,7 @@
       s->start_response = ws_start_response;
       s->read = ws_read;
       s->write = ws_write;
  +    s->flush = ws_flush;
   
       /* Clear RECO status */
       s->reco_status = RECO_NONE;
  @@ -454,6 +459,10 @@
       else
           s->remote_addr = NULL_FOR_EMPTY(r->connection->remote_ip);
   
  +    if (conf->options & JK_OPT_FLUSHPACKETS)
  +        s->flush_packets = 1;
  +    else
  +        s->flush_packets = 0;
       /* get server name */
       /* s->server_name  = (char *)(r->hostname ? r->hostname : r->server->server_hostname);
*/
       /* XXX :  la jk2 */
  @@ -1503,6 +1512,9 @@
           else if (!strcasecmp(w, "ForwardLocalAddress")) {
               opt = JK_OPT_FWDLOCAL;
           }
  +        else if (!strcasecmp(w, "FlushPackets")) {
  +            opt = JK_OPT_FLUSHPACKETS;
  +        }
           else
               return ap_pstrcat(cmd->pool, "JkOptions: Illegal option '", w,
                                 "'", NULL);
  
  
  
  1.146     +14 -14    jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
  retrieving revision 1.145
  retrieving revision 1.146
  diff -u -r1.145 -r1.146
  --- mod_jk.c	15 May 2005 11:10:11 -0000	1.145
  +++ mod_jk.c	18 May 2005 18:04:52 -0000	1.146
  @@ -317,6 +317,14 @@
       return JK_FALSE;
   }
   
  +static void JK_METHOD ws_flush(jk_ws_service_t *s)
  +{
  +    if (s && s->ws_private) {
  +        apache_private_data_t *p = s->ws_private;
  +        ap_rflush(p->r);
  +    }
  +}
  +
   /*
    * Write a chunk of response data back to the browser.  If the headers
    * haven't yet been sent over, send over default header values (Status =
  @@ -387,18 +395,6 @@
                   }
   
               }
  -
  -            /*
  -             * To allow server push. After writing full buffers
  -             */
  -#ifndef AS400
  -            if (ap_rflush(p->r) != APR_SUCCESS) {
  -                ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_CRIT, 0,
  -                             NULL, "mod_jk: Error flushing");
  -                return JK_FALSE;
  -            }
  -#endif
  -
           }
   
           return JK_TRUE;
  @@ -462,6 +458,7 @@
       s->start_response = ws_start_response;
       s->read = ws_read;
       s->write = ws_write;
  +    s->flush = ws_flush;
   
       /* Clear RECO status */
       s->reco_status = RECO_NONE;
  @@ -478,7 +475,10 @@
           s->remote_addr = NULL_FOR_EMPTY(r->connection->local_ip);
       else
           s->remote_addr = NULL_FOR_EMPTY(r->connection->remote_ip);
  -
  +    if (conf->options & JK_OPT_FLUSHPACKETS)
  +        s->flush_packets = 1;
  +    else
  +        s->flush_packets = 0;
       /* get server name */
       s->server_name = (char *)ap_get_server_name(r);
   
  
  
  
  1.117     +15 -12    jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- jk_ajp_common.c	15 May 2005 17:06:05 -0000	1.116
  +++ jk_ajp_common.c	18 May 2005 18:04:53 -0000	1.117
  @@ -1377,6 +1377,8 @@
                   JK_TRACE_EXIT(l);
                   return JK_CLIENT_ERROR;
               }
  +            if (r->flush && r->flush_packets)
  +                r->flush(r);
           }
           break;
   
  @@ -1410,18 +1412,19 @@
           break;
   
       case JK_AJP13_END_RESPONSE:
  -        {
  -            ae->reuse = (int)jk_b_get_byte(msg);
  +        ae->reuse = (int)jk_b_get_byte(msg);
  +        if (!ae->reuse) {
  +            /*
  +                * Strange protocol error.
  +                */
  +            jk_log(l, JK_LOG_INFO, " Protocol error: Reuse is set to false");
  +        }
  +        /* Flush after the last write */
  +        if (r->flush && !r->flush_packets)
  +            r->flush(r);
   
  -            if (!ae->reuse) {
  -                /*
  -                 * Strange protocol error.
  -                 */
  -                jk_log(l, JK_LOG_INFO, " Protocol error: Reuse is set to false");
  -            }
  -            /* Reuse in all cases */
  -            ae->reuse = JK_TRUE;
  -        }
  +        /* Reuse in all cases */
  +        ae->reuse = JK_TRUE;
           JK_TRACE_EXIT(l);
           return JK_AJP13_END_RESPONSE;
           break;
  
  
  
  1.49      +2 -1      jakarta-tomcat-connectors/jk/native/common/jk_global.h
  
  Index: jk_global.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_global.h,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- jk_global.h	7 May 2005 08:15:47 -0000	1.48
  +++ jk_global.h	18 May 2005 18:04:53 -0000	1.49
  @@ -209,6 +209,7 @@
   #define JK_OPT_FWDDIRS              0x0008
   /* Forward local instead remote address */
   #define JK_OPT_FWDLOCAL             0x0010
  +#define JK_OPT_FLUSHPACKETS         0x0020
   
   /* Check for EBCDIC systems */
   
  
  
  
  1.32      +11 -1     jakarta-tomcat-connectors/jk/native/common/jk_service.h
  
  Index: jk_service.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_service.h,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- jk_service.h	24 Apr 2005 09:54:47 -0000	1.31
  +++ jk_service.h	18 May 2005 18:04:53 -0000	1.32
  @@ -216,6 +216,11 @@
        */
       int retries;
   
  +    /*
  +     * If set call flush after each write
  +     */
  +    int flush_packets;
  +
       /* Uri worker map. Added for virtual host support
        */
       jk_uri_worker_map_t *uw_map;
  @@ -244,6 +249,11 @@
        */
       int (JK_METHOD * write) (jk_ws_service_t *s,
                                const void *buffer, unsigned len);
  +
  +    /*
  +     * Flush a chunk of response data back to the browser.
  +     */
  +    void (JK_METHOD * flush) (jk_ws_service_t *s);
   };
   
   /*
  
  
  
  1.49      +2 -1      jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c
  
  Index: jk_isapi_plugin.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- jk_isapi_plugin.c	15 May 2005 11:10:11 -0000	1.48
  +++ jk_isapi_plugin.c	18 May 2005 18:04:53 -0000	1.49
  @@ -1356,6 +1356,7 @@
       s->start_response = start_response;
       s->read = read;
       s->write = write;
  +    s->flush = NULL;
   
       /* Clear RECO status */
       s->reco_status = RECO_NONE;
  
  
  
  1.25      +2 -1      jakarta-tomcat-connectors/jk/native/netscape/jk_nsapi_plugin.c
  
  Index: jk_nsapi_plugin.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/netscape/jk_nsapi_plugin.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- jk_nsapi_plugin.c	15 May 2005 11:10:11 -0000	1.24
  +++ jk_nsapi_plugin.c	18 May 2005 18:04:53 -0000	1.25
  @@ -349,6 +349,7 @@
       s->start_response = start_response;
       s->read = ws_read;
       s->write = ws_write;
  +    s->flush = NULL;
   
       /* Clear RECO status */
       s->reco_status = RECO_NONE;
  
  
  
  1.33      +4 -0      jakarta-tomcat-connectors/jk/xdocs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/xdocs/changelog.xml,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- changelog.xml	16 May 2005 06:40:31 -0000	1.32
  +++ changelog.xml	18 May 2005 18:04:53 -0000	1.33
  @@ -26,6 +26,10 @@
     <subsection name="Native">
       <changelog>
         <update>
  +      Added JkOptions +FlushPackets used to optimize memory
  +      usage when sending large data. (mturk)
  +      </update>
  +      <update>
         Added lock directive for load balancer that allows more acurate
         load balancing in case of burst load. (mturk)
         </update>      
  
  
  
  1.13      +12 -0     jakarta-tomcat-connectors/jk/xdocs/config/apache.xml
  
  Index: apache.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/xdocs/config/apache.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- apache.xml	7 May 2005 08:15:47 -0000	1.12
  +++ apache.xml	18 May 2005 18:04:53 -0000	1.13
  @@ -324,6 +324,18 @@
   </p>
   
   <p>
  +JkOptions <b>FlushPackets</b>, you told mod_jk to make a flush after each AJP
  +packet received from Tomcat.
  +
  +<source>  
  +  JkOptions     +FlushPackets
  +</source>
  +
  +<br/>
  +<br/>
  +</p>
  +
  +<p>
   The directive <b>JkEnvVar</b> allow you to forward an environment vars from
Apache server to Tomcat engine.
   
   <source>  
  
  
  

---------------------------------------------------------------------
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