tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1555407 - in /tomcat/jk/trunk/native: common/jk_ajp13.h common/jk_ajp14_worker.c common/jk_lb_worker.c common/jk_msg_buff.h common/jk_status.c common/jk_util.c iis/jk_isapi_plugin.c
Date Sat, 04 Jan 2014 19:42:26 GMT
Author: rjung
Date: Sat Jan  4 19:42:25 2014
New Revision: 1555407

URL: http://svn.apache.org/r1555407
Log:
Introduce and use everywhere AJP packet size
constants.

Modified:
    tomcat/jk/trunk/native/common/jk_ajp13.h
    tomcat/jk/trunk/native/common/jk_ajp14_worker.c
    tomcat/jk/trunk/native/common/jk_lb_worker.c
    tomcat/jk/trunk/native/common/jk_msg_buff.h
    tomcat/jk/trunk/native/common/jk_status.c
    tomcat/jk/trunk/native/common/jk_util.c
    tomcat/jk/trunk/native/iis/jk_isapi_plugin.c

Modified: tomcat/jk/trunk/native/common/jk_ajp13.h
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp13.h?rev=1555407&r1=1555406&r2=1555407&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_ajp13.h (original)
+++ tomcat/jk/trunk/native/common/jk_ajp13.h Sat Jan  4 19:42:25 2014
@@ -36,7 +36,9 @@ extern "C"
 
 #define AJP13_DEF_HOST              ("localhost")
 #define AJP13_DEF_PORT              (8009)
-#define AJP13_READ_BUF_SIZE         (8*1024)
+#define AJP13_DEF_PACKET_SIZE       (8*1024)
+#define AJP13_MAX_PACKET_SIZE       (64*1024)
+#define AJP13_PACKET_SIZE_ALIGN     (1024)
 #define AJP13_DEF_CACHE_SZ          (1)
 #define JK_INTERNAL_ERROR           (-2)
 #define JK_FATAL_ERROR              (-3)
@@ -49,7 +51,7 @@ extern "C"
 #define JK_REPLY_TIMEOUT            (-10)
 #define JK_AJP_PROTOCOL_ERROR       (-11)
 
-#define AJP13_MAX_SEND_BODY_SZ      (DEF_BUFFER_SZ - 6)
+#define AJP13_MAX_SEND_BODY_SZ      (AJP13_DEF_PACKET_SIZE - 6)
 #define AJP13_DEF_TIMEOUT           (0) /* Idle timout for pooled connections */
 
 /*

Modified: tomcat/jk/trunk/native/common/jk_ajp14_worker.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp14_worker.c?rev=1555407&r1=1555406&r2=1555407&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_ajp14_worker.c (original)
+++ tomcat/jk/trunk/native/common/jk_ajp14_worker.c Sat Jan  4 19:42:25 2014
@@ -225,7 +225,7 @@ static int logon(ajp_endpoint_t * ae, jk
     JK_TRACE_ENTER(l);
 
     msg = jk_b_new(p);
-    jk_b_set_buffer_size(msg, DEF_BUFFER_SZ);
+    jk_b_set_buffer_size(msg, AJP13_DEF_PACKET_SIZE);
 
     if ((rc = handle_logon(ae, msg, l)) == JK_FALSE)
         ajp_close_endpoint(ae, l);
@@ -243,7 +243,7 @@ static int discovery(ajp_endpoint_t * ae
     JK_TRACE_ENTER(l);
 
     msg = jk_b_new(p);
-    jk_b_set_buffer_size(msg, DEF_BUFFER_SZ);
+    jk_b_set_buffer_size(msg, AJP13_DEF_PACKET_SIZE);
 
     if ((rc = handle_discovery(ae, we, msg, l)) == JK_FALSE)
         ajp_close_endpoint(ae, l);

Modified: tomcat/jk/trunk/native/common/jk_lb_worker.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_lb_worker.c?rev=1555407&r1=1555406&r2=1555407&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_lb_worker.c (original)
+++ tomcat/jk/trunk/native/common/jk_lb_worker.c Sat Jan  4 19:42:25 2014
@@ -30,7 +30,6 @@
 #include "jk_util.h"
 #include "jk_worker.h"
 #include "jk_lb_worker.h"
-#include "jk_ajp13.h"
 #include "jk_ajp13_worker.h"
 #include "jk_ajp14_worker.h"
 #include "jk_mt.h"
@@ -1944,7 +1943,7 @@ int JK_METHOD lb_worker_factory(jk_worke
         private_data->recover_wait_time = WAIT_BEFORE_RECOVER;
         private_data->error_escalation_time = private_data->recover_wait_time / 2;
         private_data->max_reply_timeouts = 0;
-        private_data->max_packet_size = DEF_BUFFER_SZ;
+        private_data->max_packet_size = AJP13_DEF_PACKET_SIZE;
         private_data->sequence = 0;
         private_data->next_offset = 0;
         *w = &private_data->worker;

Modified: tomcat/jk/trunk/native/common/jk_msg_buff.h
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_msg_buff.h?rev=1555407&r1=1555406&r2=1555407&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_msg_buff.h (original)
+++ tomcat/jk/trunk/native/common/jk_msg_buff.h Sat Jan  4 19:42:25 2014
@@ -31,8 +31,6 @@ extern "C"
 {
 #endif                          /* __cplusplus */
 
-#define DEF_BUFFER_SZ (8 * 1024)
-
 /* XXX replace all return values with error codes */
 #define ERR_BAD_PACKET -5
 

Modified: tomcat/jk/trunk/native/common/jk_status.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_status.c?rev=1555407&r1=1555406&r2=1555407&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_status.c (original)
+++ tomcat/jk/trunk/native/common/jk_status.c Sat Jan  4 19:42:25 2014
@@ -3229,7 +3229,7 @@ static int set_uint_if_changed(status_en
                                unsigned int max,
                                unsigned int *param,
                                const char *lb_name,
-                              jk_logger_t *l)
+                               jk_logger_t *l)
 {
     unsigned i;
     status_worker_t *w = p->worker;
@@ -3415,7 +3415,8 @@ static int commit_member(jk_ws_service_t
                            0, INT_MAX, &aw->recovery_opts, lb_name, l))
         *side_effect |= JK_STATUS_NEEDS_PUSH;
     if (set_uint_if_changed(p, aw->name, "max_packet_size", JK_STATUS_ARG_AJP_MAX_PK_SZ,
-                           8*1024, 64*1024, &aw->max_packet_size, lb_name, l)) {
+                           AJP13_DEF_PACKET_SIZE, AJP13_MAX_PACKET_SIZE,
+                           &aw->max_packet_size, lb_name, l)) {
         *side_effect |= JK_STATUS_NEEDS_PUSH;
         if (aw->max_packet_size > lb->max_packet_size) {
             lb->max_packet_size = aw->max_packet_size;
@@ -3582,7 +3583,8 @@ static void commit_all_members(jk_ws_ser
             }
             else if (!strcmp(attribute, JK_STATUS_ARG_AJP_MAX_PK_SZ)) {
                 if (set_uint_if_changed(p, aw->name, "max_packet_size", vname,
-                                       8*1024, 64*1024, &aw->max_packet_size, name,
l)) {
+                                       AJP13_DEF_PACKET_SIZE, AJP13_MAX_PACKET_SIZE,
+                                       &aw->max_packet_size, name, l)) {
                     sync_needed = JK_TRUE;
                     if (aw->max_packet_size > lb->max_packet_size) {
                         lb->max_packet_size = aw->max_packet_size;

Modified: tomcat/jk/trunk/native/common/jk_util.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_util.c?rev=1555407&r1=1555406&r2=1555407&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_util.c (original)
+++ tomcat/jk/trunk/native/common/jk_util.c Sat Jan  4 19:42:25 2014
@@ -1390,16 +1390,16 @@ int jk_get_max_packet_size(jk_map_t *m, 
     int sz;
 
     if (!m || !wname) {
-        return DEF_BUFFER_SZ;
+        return AJP13_DEF_PACKET_SIZE;
     }
 
     MAKE_WORKER_PARAM(WORKER_MAX_PACKET_SIZE);
-    sz = jk_map_get_int(m, buf, DEF_BUFFER_SZ);
-    sz = JK_ALIGN(sz, 1024);
-    if (sz < DEF_BUFFER_SZ)
-        sz = DEF_BUFFER_SZ;
-    else if (sz > 64*1024)
-        sz = 64*1024;
+    sz = jk_map_get_int(m, buf, AJP13_DEF_PACKET_SIZE);
+    sz = JK_ALIGN(sz, AJP13_PACKET_SIZE_ALIGN);
+    if (sz < AJP13_DEF_PACKET_SIZE)
+        sz = AJP13_DEF_PACKET_SIZE;
+    else if (sz > AJP13_MAX_PACKET_SIZE)
+        sz = AJP13_MAX_PACKET_SIZE;
 
     return sz;
 }

Modified: tomcat/jk/trunk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/iis/jk_isapi_plugin.c?rev=1555407&r1=1555406&r2=1555407&view=diff
==============================================================================
--- tomcat/jk/trunk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/jk/trunk/native/iis/jk_isapi_plugin.c Sat Jan  4 19:42:25 2014
@@ -167,7 +167,6 @@ static char HTTP_WORKER_HEADER_INDEX[RES
 #define BAD_PATH        -2
 #define MAX_SERVERNAME  1024
 #define MAX_INSTANCEID  32
-#define MAX_PACKET_SIZE 65536
 
 char HTML_ERROR_HEAD[] =        "<!--\n"
                                 "  Licensed to the Apache Software Foundation (ASF) under
one or more\n"
@@ -3306,13 +3305,13 @@ static int init_ws_service(isapi_private
             s->num_attributes = num_of_vars;
             if (ssl_env_values[4] && ssl_env_values[4][0] == '1') {
                 CERT_CONTEXT_EX cc;
-                BYTE *cb = jk_pool_alloc(&private_data->p, MAX_PACKET_SIZE);
+                BYTE *cb = jk_pool_alloc(&private_data->p, AJP13_MAX_PACKET_SIZE);
 
                 if (!cb) {
                     JK_TRACE_EXIT(logger);
                     return JK_FALSE;
                 }
-                cc.cbAllocated = MAX_PACKET_SIZE;
+                cc.cbAllocated = AJP13_MAX_PACKET_SIZE;
                 cc.CertContext.pbCertEncoded = cb;
                 cc.CertContext.cbCertEncoded = 0;
 



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


Mime
View raw message