Author: markt
Date: Thu Sep 15 14:12:19 2016
New Revision: 1760936

URL: http://svn.apache.org/viewvc?rev=1760936&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58608
Add a new option for IIS called "flush_packets" that enables control of the 
buffering added in IIS7+

Modified:
    tomcat/jk/trunk/native/iis/jk_isapi_plugin.c
    tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml
    tomcat/jk/trunk/xdocs/reference/iis.xml

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=1760936&r1=1760935&r2=1760936&view=diff
==============================================================================
--- tomcat/jk/trunk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/jk/trunk/native/iis/jk_isapi_plugin.c Thu Sep 15 14:12:19 2016
@@ -51,6 +51,10 @@
 #define POSIX_MALLOC_THRESHOLD 10
 #endif
 
+#ifndef HSE_REQ_SET_FLUSH_FLAG
+#define HSE_REQ_SET_FLUSH_FLAG (HSE_REQ_END_RESERVED + 43)
+#endif
+
 #include <strsafe.h>
 
 #define VERSION_STRING "Tomcat/ISAPI/" JK_EXPOSED_VERSION
@@ -135,6 +139,7 @@ static char HTTP_WORKER_HEADER_INDEX[RES
 #define WATCHDOG_INTERVAL_TAG         "watchdog_interval"
 #define ENABLE_CHUNKED_ENCODING_TAG   "enable_chunked_encoding"
 #define ERROR_PAGE_TAG                "error_page"
+#define FLUSH_PACKETS_TAG             "flush_packets"
 
 #define LOG_ROTATION_TIME_TAG         "log_rotationtime"
 #define LOG_FILESIZE_TAG              "log_filesize"
@@ -510,6 +515,7 @@ static volatile int  watchdog_interval =
 static HANDLE watchdog_handle = NULL;
 static char error_page_buf[INTERNET_MAX_URL_LENGTH] = {0};
 static char *error_page = NULL;
+static int flush_packets = JK_FALSE;
 
 #define URI_SELECT_OPT_PARSED       0
 #define URI_SELECT_OPT_UNPARSED     1
@@ -2183,6 +2189,11 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSI
     s.ws_private = &private_data;
     s.pool = &private_data.p;
 
+    if (flush_packets) {
+        lpEcb->ServerSupportFunction(lpEcb->ConnID, HSE_REQ_SET_FLUSH_FLAG,
+                (LPVOID) TRUE, NULL, NULL);
+    }
+    
     if (init_ws_service(&private_data, &s, &worker_name)) {
         jk_endpoint_t *e = NULL;
         jk_worker_t *worker = wc_get_worker_for_name(worker_name, logger);
@@ -2964,6 +2975,7 @@ static int read_registry_init_data(void)
     if (watchdog_interval < 0)
         watchdog_interval = 0;
     chunked_encoding_enabled = get_config_bool(src, 
ENABLE_CHUNKED_ENCODING_TAG, JK_FALSE);
+    flush_packets = get_config_bool(src, FLUSH_PACKETS_TAG, JK_FALSE);
     if (get_config_parameter(src, ERROR_PAGE_TAG, error_page_buf, 
sizeof(error_page_buf))) {
         error_page = error_page_buf;
     }

Modified: tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml?rev=1760936&r1=1760935&r2=1760936&view=diff
==============================================================================
--- tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Thu Sep 15 14:12:19 2016
@@ -75,6 +75,12 @@
         (rjung)
       </fix>
       <fix>
+        <bug>58608</bug>: ISAPI: Add a new registry option "flush_packets"
+        that allows the flushing behaviour of IIS7+ to be controlled. The
+        default is not to flush. Setting the option to "true" with cause IIS to
+        write data to the client as each AJP packet is received. (markt)
+      </fix>
+      <fix>
         <bug>58813</bug>: ISAPI: Correctly release a mutex allowing the plugin
         to complete initialization. Prior to this fix, the incomplete
         initialization was causing a hang on shutdown. Patch provided by 
Matthew

Modified: tomcat/jk/trunk/xdocs/reference/iis.xml
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/reference/iis.xml?rev=1760936&r1=1760935&r2=1760936&view=diff
==============================================================================
--- tomcat/jk/trunk/xdocs/reference/iis.xml (original)
+++ tomcat/jk/trunk/xdocs/reference/iis.xml Thu Sep 15 14:12:19 2016
@@ -269,6 +269,16 @@ was considered experimental and only ava
 chunking support was used. Starting with 1.2.30 it is no longer considered
 experimental.</p>
 </attribute>
+<attribute name="flush_packets" required="false"><p>
+A string value representing a boolean. If it is set to <b>true</b>,
+data is flushed immediately to the client as each AJP packet is received.
+Otherwise, IIS buffers the data and only writes to the client when the buffer
+is full or the response is complete.</p>
+<p>
+The default value is false.
+</p>
+<p>This directive has been added in version 1.2.42</p>
+</attribute>
 </attributes>
 </section> 
 <section name="Using a properties file for configuration">



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

Reply via email to