Author: rjung Date: Thu Aug 24 02:02:09 2006 New Revision: 434345 URL: http://svn.apache.org/viewvc?rev=434345&view=rev Log: Workaround patch from Jim Jagielski to disable persistent connections in case of silent connection drops by firewalls. Stiil needs documentation with a couple of disclaimers (performance, resource usage, prefered solution TCP keep alive).
Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c tomcat/connectors/trunk/jk/native/common/jk_global.h tomcat/connectors/trunk/jk/native/common/jk_service.h Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=434345&r1=434344&r2=434345&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original) +++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Thu Aug 24 02:02:09 2006 @@ -500,6 +500,12 @@ s->flush_packets = 1; else s->flush_packets = 0; + + if (conf->options & JK_OPT_DISABLEREUSE) + s->disable_reuse = 1; + else + s->disable_reuse = 0; + /* get server name */ /* s->server_name = (char *)(r->hostname ? r->hostname : r->server->server_hostname); */ /* XXX : à la jk2 */ @@ -1538,6 +1544,9 @@ } else if (!strcasecmp(w, "FlushPackets")) { opt = JK_OPT_FLUSHPACKETS; + } + else if (!strcasecmp(w, "DisableReuse")) { + opt = JK_OPT_DISABLEREUSE; } else return ap_pstrcat(cmd->pool, "JkOptions: Illegal option '", w, Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=434345&r1=434344&r2=434345&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original) +++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Thu Aug 24 02:02:09 2006 @@ -523,6 +523,12 @@ s->flush_packets = 1; else s->flush_packets = 0; + + if (conf->options & JK_OPT_DISABLEREUSE) + s->disable_reuse = 1; + else + s->disable_reuse = 0; + /* get server name */ s->server_name = (char *)ap_get_server_name(r); @@ -1023,7 +1029,7 @@ */ static const char *jk_set_auto_alias(cmd_parms * cmd, - void *dummy, char *directory) + void *dummy, const char *directory) { server_rec *s = cmd->server; jk_server_conf_t *conf = @@ -1568,6 +1574,9 @@ } else if (!strcasecmp(w, "FlushPackets")) { opt = JK_OPT_FLUSHPACKETS; + } + else if (!strcasecmp(w, "DisableReuse")) { + opt = JK_OPT_DISABLEREUSE; } else return apr_pstrcat(cmd->pool, "JkOptions: Illegal option '", w, Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c?rev=434345&r1=434344&r2=434345&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Thu Aug 24 02:02:09 2006 @@ -1456,12 +1456,17 @@ */ jk_log(l, JK_LOG_INFO, " Protocol error: Reuse is set to false"); } + else if (r->disable_reuse) { + ae->reuse = JK_FALSE; + } + else { + /* Reuse in all cases */ + ae->reuse = JK_TRUE; + } /* Flush after the last write */ if (r->flush && !r->flush_packets) r->flush(r); - /* Reuse in all cases */ - ae->reuse = JK_TRUE; JK_TRACE_EXIT(l); return JK_AJP13_END_RESPONSE; break; Modified: tomcat/connectors/trunk/jk/native/common/jk_global.h URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_global.h?rev=434345&r1=434344&r2=434345&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_global.h (original) +++ tomcat/connectors/trunk/jk/native/common/jk_global.h Thu Aug 24 02:02:09 2006 @@ -240,6 +240,7 @@ /* Forward local instead remote address */ #define JK_OPT_FWDLOCAL 0x0010 #define JK_OPT_FLUSHPACKETS 0x0020 +#define JK_OPT_DISABLEREUSE 0x0040 /* Check for EBCDIC systems */ Modified: tomcat/connectors/trunk/jk/native/common/jk_service.h URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_service.h?rev=434345&r1=434344&r2=434345&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_service.h (original) +++ tomcat/connectors/trunk/jk/native/common/jk_service.h Thu Aug 24 02:02:09 2006 @@ -256,6 +256,11 @@ void (JK_METHOD * flush) (jk_ws_service_t *s); /* + * If set do not reuse socket after each full response + */ + int disable_reuse; + + /* * Add more data to log facilities. */ void (JK_METHOD * add_log_items) (jk_ws_service_t *s, --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]