Author: fhanik Date: Thu Oct 18 19:16:41 2007 New Revision: 586228 URL: http://svn.apache.org/viewvc?rev=586228&view=rev Log: Add in voted on fixes
Modified: tomcat/tc6.0.x/trunk/STATUS tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/mbeans-descriptors.xml tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/ConnectorCreateRule.java tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Compiler.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc6.0.x/trunk/STATUS URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/STATUS (original) +++ tomcat/tc6.0.x/trunk/STATUS Thu Oct 18 19:16:41 2007 @@ -31,16 +31,6 @@ http://people.apache.org/~fhanik/patches/digester-attribute-warnings.patch +1: fhanik, yoavs -1: - -* Add missing mbean descriptor - http://people.apache.org/~fhanik/patches/loader-mbean.patch - +1: fhanik,funkman,yoavs - -1: - -* Proposed solution to http://issues.apache.org/bugzilla/show_bug.cgi?id=42693 - Patch: http://issues.apache.org/bugzilla/attachment.cgi?id=20940 - +1: fhanik,funkman, yoavs - -1: * IcedTea support. Upcoming Linux distributions will package a (working) open source JRE, available in /usr. As a result, it could now be possible to use a "/usr/bin/java" binary @@ -70,21 +60,7 @@ -1: 0: yoavs -* Fix multicasting bind address on multihomed computers - http://issues.apache.org/bugzilla/show_bug.cgi?id=43641 - +1: fhanik, pero, yoavs, markt - -1: - -* Warn if connector can not use external executors - http://issues.apache.org/bugzilla/show_bug.cgi?id=43643 - +1: fhanik, pero, yoavs, markt - -1: - -* Fix SSL buffer bug - http://issues.apache.org/bugzilla/show_bug.cgi?id=43653 - +1: fhanik, yoavs, markt - -1: - + * Add a working ANT script that signs and publishes JARs to a maven repo http://people.apache.org/~fhanik/patches/maven-publish.patch +1: fhanik, yoavs Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/mbeans-descriptors.xml?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/mbeans-descriptors.xml (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/mbeans-descriptors.xml Thu Oct 18 19:16:41 2007 @@ -72,4 +72,9 @@ group="Loader" type="org.apache.catalina.loader.WebappClassLoader" /> + <mbean name="VirtualWebappLoader" + description="Extension of the webapp class loader with additional features" + domain="Catalina" + group="Loader" + type="org.apache.catalina.loader.VirtualWebappLoader" /> </mbeans-descriptors> Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/ConnectorCreateRule.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/ConnectorCreateRule.java?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/ConnectorCreateRule.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/ConnectorCreateRule.java Thu Oct 18 19:16:41 2007 @@ -27,6 +27,8 @@ import org.apache.catalina.Executor; import org.apache.tomcat.util.IntrospectionUtils; import java.lang.reflect.Method; +import org.apache.juli.logging.LogFactory; +import org.apache.juli.logging.Log; /** @@ -35,7 +37,7 @@ public class ConnectorCreateRule extends Rule { - + protected static Log log = LogFactory.getLog(ConnectorCreateRule.class); // --------------------------------------------------------- Public Methods @@ -58,7 +60,11 @@ public void _setExecutor(Connector con, Executor ex) throws Exception { Method m = IntrospectionUtils.findMethod(con.getProtocolHandler().getClass(),"setExecutor",new Class[] {java.util.concurrent.Executor.class}); - m.invoke(con.getProtocolHandler(),new Object[] {ex}); + if (m!=null) { + m.invoke(con.getProtocolHandler(), new Object[] {ex}); + }else { + log.warn("Connector ["+con+"] does not support external executors. Method setExecutor(java.util.concurrent.Executor) not found."); + } } Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java Thu Oct 18 19:16:41 2007 @@ -29,6 +29,7 @@ import org.apache.catalina.tribes.Channel; import org.apache.catalina.tribes.Member; import org.apache.catalina.tribes.MembershipListener; +import java.net.BindException; /** * A <b>membership</b> implementation using simple multicast. @@ -182,8 +183,22 @@ } protected void setupSocket() throws IOException { - if (mcastBindAddress != null) socket = new MulticastSocket(new InetSocketAddress(mcastBindAddress, port)); - else socket = new MulticastSocket(port); + if (mcastBindAddress != null) { + try { + log.info("Attempting to bind the multicast socket to "+address+":"+port); + socket = new MulticastSocket(new InetSocketAddress(address,port)); + } catch (BindException e) { + /* + * On some plattforms (e.g. Linux) it is not possible to bind + * to the multicast address. In this case only bind to the + * port. + */ + log.info("Binding to multicast address, failed. Binding to port only."); + socket = new MulticastSocket(port); + } + } else { + socket = new MulticastSocket(port); + } socket.setLoopbackMode(false); //hint that we don't need loop back messages if (mcastBindAddress != null) { if(log.isInfoEnabled()) Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Compiler.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Compiler.java?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Compiler.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Compiler.java Thu Oct 18 19:16:41 2007 @@ -141,23 +141,9 @@ ctxt.checkOutputDir(); String javaFileName = ctxt.getServletJavaFileName(); - ServletWriter writer = null; + ServletWriter writer = null; try { - // Setup the ServletWriter - String javaEncoding = ctxt.getOptions().getJavaEncoding(); - OutputStreamWriter osw = null; - - try { - osw = new OutputStreamWriter( - new FileOutputStream(javaFileName), javaEncoding); - } catch (UnsupportedEncodingException ex) { - errDispatcher.jspError("jsp.error.needAlternateJavaEncoding", - javaEncoding); - } - - writer = new ServletWriter(new PrintWriter(osw)); - ctxt.setWriter(writer); // Reset the temporary variable counter for the generator. JspUtil.resetTemporaryVariableName(); @@ -168,6 +154,7 @@ if (ctxt.isPrototypeMode()) { // generate prototype .java file for the tag file + writer = setupContextWriter(javaFileName); Generator.generate(writer, this, pageNodes); writer.close(); writer = null; @@ -207,6 +194,7 @@ ELFunctionMapper.map(this, pageNodes); // generate servlet .java file + writer = setupContextWriter(javaFileName); Generator.generate(writer, this, pageNodes); writer.close(); writer = null; @@ -258,6 +246,26 @@ return smapStr; } + + private ServletWriter setupContextWriter(String javaFileName) + throws FileNotFoundException, JasperException { + ServletWriter writer; + // Setup the ServletWriter + String javaEncoding = ctxt.getOptions().getJavaEncoding(); + OutputStreamWriter osw = null; + + try { + osw = new OutputStreamWriter( + new FileOutputStream(javaFileName), javaEncoding); + } catch (UnsupportedEncodingException ex) { + errDispatcher.jspError("jsp.error.needAlternateJavaEncoding", + javaEncoding); + } + + writer = new ServletWriter(new PrintWriter(osw)); + ctxt.setWriter(writer); + return writer; + } /** * Compile the servlet from .java file to .class file Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Thu Oct 18 19:16:41 2007 @@ -47,10 +47,6 @@ boolean timedout = false; int keycount = 1; //assume we can write long time = System.currentTimeMillis(); //start the timeout timer - if (socket.getBufHandler().getWriteBuffer() != buf) { - socket.getBufHandler().getWriteBuffer().put(buf); - buf = socket.getBufHandler().getWriteBuffer(); - } try { while ( (!timedout) && buf.hasRemaining()) { if (keycount > 0) { //only write if we were registered for a write Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Thu Oct 18 19:16:41 2007 @@ -139,10 +139,6 @@ boolean timedout = false; int keycount = 1; //assume we can write long time = System.currentTimeMillis(); //start the timeout timer - if ( socket.getBufHandler().getWriteBuffer()!= buf ) { - socket.getBufHandler().getWriteBuffer().put(buf); - buf = socket.getBufHandler().getWriteBuffer(); - } try { while ( (!timedout) && buf.hasRemaining() ) { int cnt = 0; Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java Thu Oct 18 19:16:41 2007 @@ -392,38 +392,44 @@ * @todo Implement this java.nio.channels.WritableByteChannel method */ public int write(ByteBuffer src) throws IOException { - //make sure we can handle expand, and that we only use on buffer - if ( src != bufHandler.getWriteBuffer() ) throw new IllegalArgumentException("You can only write using the application write buffer provided by the handler."); - //are we closing or closed? - if ( closing || closed) throw new IOException("Channel is in closing state."); - - //the number of bytes written - int written = 0; - - if (!flush(netOutBuffer)) { - //we haven't emptied out the buffer yet + if ( src == this.netOutBuffer ) { + //we can get here through a recursive call + //by using the NioBlockingSelector + int written = sc.write(src); return written; - } - - /* - * The data buffer is empty, we can reuse the entire buffer. - */ - netOutBuffer.clear(); - - SSLEngineResult result = sslEngine.wrap(src, netOutBuffer); - written = result.bytesConsumed(); - netOutBuffer.flip(); - - if (result.getStatus() == Status.OK) { - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) tasks(); } else { - throw new IOException("Unable to wrap data, invalid engine state: " +result.getStatus()); - } - - //force a flush - flush(netOutBuffer); - - return written; + //make sure we can handle expand, and that we only use on buffer + if ( src != bufHandler.getWriteBuffer() ) throw new IllegalArgumentException("You can only write using the application write buffer provided by the handler."); + //are we closing or closed? + if ( closing || closed) throw new IOException("Channel is in closing state."); + + //the number of bytes written + int written = 0; + + if (!flush(netOutBuffer)) { + //we haven't emptied out the buffer yet + return written; + } + + /* + * The data buffer is empty, we can reuse the entire buffer. + */ + netOutBuffer.clear(); + + SSLEngineResult result = sslEngine.wrap(src, netOutBuffer); + written = result.bytesConsumed(); + netOutBuffer.flip(); + + if (result.getStatus() == Status.OK) { + if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) tasks(); + } else { + throw new IOException("Unable to wrap data, invalid engine state: " +result.getStatus()); + } + + //force a flush + flush(netOutBuffer); + return written; + } } /** Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=586228&r1=586227&r2=586228&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Oct 18 19:16:41 2007 @@ -42,6 +42,11 @@ </subsection> <subsection name="Catalina"> <changelog> + <fix><bug>43653</bug>Fix SSL buffer mixup when response is unable to write more than socket buffer can handle</fix> + <fix><bug>43643</bug>If connector doesn't support external executor, display warning</fix> + <fix><bug>43641</bug>Property bind multicast address for cluster membership</fix> + <fix><bug>42693</bug> Fix JSP compiler bug</fix> + <update>Add mbean descriptor for virtual webapp loader</update> <fix><bug>43487</bug> Fix request processing stats </fix> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]