httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r467257 - in /httpd/httpd/trunk/modules/proxy: ajp.h mod_proxy_ajp.c
Date Tue, 24 Oct 2006 06:33:14 GMT
Author: mturk
Date: Mon Oct 23 23:33:13 2006
New Revision: 467257

URL: http://svn.apache.org/viewvc?view=rev&rev=467257
Log:
Make sure the AJP message is between 8 and 64K.
Use the provided message size when using get_brigade.

Modified:
    httpd/httpd/trunk/modules/proxy/ajp.h
    httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c

Modified: httpd/httpd/trunk/modules/proxy/ajp.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/ajp.h?view=diff&rev=467257&r1=467256&r2=467257
==============================================================================
--- httpd/httpd/trunk/modules/proxy/ajp.h (original)
+++ httpd/httpd/trunk/modules/proxy/ajp.h Mon Oct 23 23:33:13 2006
@@ -130,8 +130,10 @@
 #define AJP13_WS_HEADER             0x1234
 #define AJP_HEADER_LEN              4
 #define AJP_HEADER_SZ_LEN           2
-#define AJP_MSG_BUFFER_SZ           (8*1024)
-#define AJP13_MAX_SEND_BODY_SZ      (AJP_MSG_BUFFER_SZ - 6)
+#define AJP_HEADER_SZ               6
+#define AJP_MSG_BUFFER_SZ           8192
+#define AJP_MAX_BUFFER_SZ           16384
+#define AJP13_MAX_SEND_BODY_SZ      (AJP_MAX_BUFFER_SZ - AJP_HEADER_SZ)
 
 /** Send a request from web server to container*/
 #define CMD_AJP13_FORWARD_REQUEST   (unsigned char)2

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?view=diff&rev=467257&r1=467256&r2=467257
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Mon Oct 23 23:33:13 2006
@@ -135,14 +135,15 @@
     apr_pollfd_t *conn_poll;
     proxy_server_conf *psf =
     ap_get_module_config(r->server->module_config, &proxy_module);
-    apr_size_t maxsize = AP_IOBUFSIZE;
+    apr_size_t maxsize = AJP_MSG_BUFFER_SZ;
 
     if (psf->io_buffer_size_set)
        maxsize = psf->io_buffer_size;
-    if (maxsize > 65536)
-       maxsize = 65536;
-    if (maxsize%1024)
-        maxsize = ((maxsize/1024) + 1 ) * 1024;
+    if (maxsize > AJP_MAX_BUFFER_SZ)
+       maxsize = AJP_MAX_BUFFER_SZ;
+    else if (maxsize < AJP_MSG_BUFFER_SZ)
+       maxsize = AJP_MSG_BUFFER_SZ;
+    maxsize = APR_ALIGN(maxsize, 1024);
 
     /*
      * Send the AJP request to the remote server
@@ -183,7 +184,7 @@
     } else {
         status = ap_get_brigade(r->input_filters, input_brigade,
                                 AP_MODE_READBYTES, APR_BLOCK_READ,
-                                AJP13_MAX_SEND_BODY_SZ);
+                                maxsize - AJP_HEADER_SZ);
 
         if (status != APR_SUCCESS) {
             /* We had a failure: Close connection to backend */
@@ -277,7 +278,7 @@
                         status = ap_get_brigade(r->input_filters, input_brigade,
                                                 AP_MODE_READBYTES,
                                                 APR_BLOCK_READ,
-                                                AJP13_MAX_SEND_BODY_SZ);
+                                                maxsize - AJP_HEADER_SZ);
                         if (status != APR_SUCCESS) {
                             ap_log_error(APLOG_MARK, APLOG_DEBUG, status,
                                          r->server,



Mime
View raw message