Re: [VOTE] Release build 6.0.37
On 04/29/2013 12:17 PM, jean-frederic clere wrote: The candidates binaries are available here: http://people.apache.org/~jfclere/tomcat-6/v6.0.37/ According to the release process, the 6.0.37 build corresponding to the tag TOMCAT_6_0_37 is: [ ] Broken [ ] Alpha [ ] Beta [x] Stable Tested on vanilla Windows 8 install Install, service, native, apps works OK. Regards -- ^TM - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1905 - in /release/tomcat/tomcat-6: ./ v6.0.37/ v6.0.37/bin/ v6.0.37/bin/extras/ v6.0.37/src/
On 03/05/2013 10:08, jfcl...@apache.org wrote: > Author: jfclere > Date: Fri May 3 09:08:37 2013 > New Revision: 1905 > > Log: > Tomcat release 6.0.36 s/36/37/ > Added: > release/tomcat/tomcat-6/v6.0.37/ Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1905 - in /release/tomcat/tomcat-6: ./ v6.0.37/ v6.0.37/bin/ v6.0.37/bin/extras/ v6.0.37/src/
On 05/03/2013 11:10 AM, Mark Thomas wrote: On 03/05/2013 10:08, jfcl...@apache.org wrote: Author: jfclere Date: Fri May 3 09:08:37 2013 New Revision: 1905 Log: Tomcat release 6.0.36 s/36/37/ Oops I have fixed the svn log. Cheers Jean-Frederic - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1478704 - in /tomcat/site/trunk/docs/tomcat-6.0-doc: ./ api/ api/org/apache/ api/org/apache/catalina/ api/org/apache/catalina/ant/ api/org/apache/catalina/ant/jmx/ api/org/apache/catalina
Author: jfclere Date: Fri May 3 10:01:22 2013 New Revision: 1478704 URL: http://svn.apache.org/r1478704 Log: Release 6.0.37 [This commit notification would consist of 67 parts, which exceeds the limit of 50 ones, so it was shortened to the summary.] - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1478713 - /tomcat/trunk/java/org/apache/coyote/http11/
Author: markt Date: Fri May 3 10:15:06 2013 New Revision: 1478713 URL: http://svn.apache.org/r1478713 Log: Servlet 3.1 non-blocking refactoring Pull up InputBuffer to AbstractHttp11Processor Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1478713&r1=1478712&r2=1478713&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Fri May 3 10:15:06 2013 @@ -65,6 +65,12 @@ public abstract class AbstractHttp11Proc /** + * Input. + */ +protected AbstractInputBuffer inputBuffer ; + + +/** * Output. */ protected AbstractOutputBuffer outputBuffer; Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java?rev=1478713&r1=1478712&r2=1478713&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java Fri May 3 10:15:06 2013 @@ -238,9 +238,14 @@ public abstract class AbstractInputBuffe protected abstract void init(SocketWrapper socketWrapper, AbstractEndpoint endpoint) throws IOException; +/** + * Issues a non blocking read. + * @return int Number of bytes read + */ +protected abstract int nbRead() throws IOException; -// - Public Methods +// - Public Methods /** * Recycle the input buffer. This should be called when closing the Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1478713&r1=1478712&r2=1478713&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Fri May 3 10:15:06 2013 @@ -74,13 +74,6 @@ public class Http11AprProcessor extends // - Instance Variables - -/** - * Input. - */ -protected final InternalAprInputBuffer inputBuffer; - - /** * Sendfile data. */ Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1478713&r1=1478712&r2=1478713&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Fri May 3 10:15:06 2013 @@ -79,11 +79,6 @@ public class Http11NioProcessor extends // - Instance Variables -/** - * Input. - */ -protected final InternalNioInputBuffer inputBuffer; - /** * Sendfile data. @@ -283,7 +278,8 @@ public class Http11NioProcessor extends // open openSocket = true; // Check to see if we have read any of the request line yet -if (inputBuffer.getParsingRequestLinePhase() < 2) { +if (((InternalNioInputBuffer) +inputBuffer).getParsingRequestLinePhase() < 2) { if (socket.getLastAccess() > -1 || keptAlive) { // Haven't read the request line and have previously processed a // request. Must be keep-alive. Make sure poller uses keepAlive. Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1478713&r1=1478712&r2=1478713&view=diff == --- tomcat/trunk
svn commit: r1478714 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11NioProcessor.java
Author: markt Date: Fri May 3 10:18:20 2013 New Revision: 1478714 URL: http://svn.apache.org/r1478714 Log: Pull-up non-blocking code for asyncDispatch from NioHttp11Processor to AbstractHttp11Processor Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1478714&r1=1478713&r2=1478714&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Fri May 3 10:18:20 2013 @@ -23,6 +23,7 @@ import java.util.StringTokenizer; import java.util.concurrent.atomic.AtomicBoolean; import java.util.regex.Pattern; +import javax.servlet.RequestDispatcher; import javax.servlet.http.HttpUpgradeHandler; import org.apache.coyote.AbstractProcessor; @@ -1540,6 +1541,46 @@ public abstract class AbstractHttp11Proc @Override public SocketState asyncDispatch(SocketStatus status) { +if (status == SocketStatus.OPEN_WRITE) { +try { +asyncStateMachine.asyncOperation(); +try { +if (outputBuffer.hasDataToWrite()) { +//System.out.println("Attempting data flush!!"); +outputBuffer.flushBuffer(false); +} +//return if we have more data to write +if (registerForWrite()) { +return SocketState.LONG; +} +} catch (IOException x) { +if (getLog().isDebugEnabled()) { +getLog().debug("Unable to write async data.",x); +} +status = SocketStatus.ASYNC_WRITE_ERROR; +request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, x); +} +} catch (IllegalStateException x) { +registerForEvent(false, true); +} +} else if (status == SocketStatus.OPEN_READ) { +try { +try { +if (inputBuffer.nbRead()>0) { +asyncStateMachine.asyncOperation(); +} +} catch (IOException x) { +if (getLog().isDebugEnabled()) { +getLog().debug("Unable to read async data.",x); +} +status = SocketStatus.ASYNC_READ_ERROR; +request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, x); +} +} catch (IllegalStateException x) { +registerForEvent(false, true); +} +} + RequestInfo rp = request.getRequestProcessor(); try { rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE); @@ -1564,6 +1605,7 @@ public abstract class AbstractHttp11Proc if (error) { return SocketState.CLOSED; } else if (isAsync()) { +registerForWrite(); return SocketState.LONG; } else { if (!keepAlive) { Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1478714&r1=1478713&r2=1478714&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Fri May 3 10:18:20 2013 @@ -22,7 +22,6 @@ import java.net.InetAddress; import java.nio.channels.SelectionKey; import javax.net.ssl.SSLEngine; -import javax.servlet.RequestDispatcher; import org.apache.coyote.ActionCode; import org.apache.coyote.RequestInfo; @@ -160,57 +159,6 @@ public class Http11NioProcessor extends } - - -@Override -public SocketState asyncDispatch(SocketStatus status) { - - -if (status == SocketStatus.OPEN_WRITE) { -try { -asyncStateMachine.asyncOperation(); -try { -if (outputBuffer.hasDataToWrite()) { -//System.out.println("Attempting data flush!!"); -outputBuffer.flushBuffer(false); -} -//return if we have more data to write -if (registerForWrite()) { -return SocketState.LONG; -} -} catch (IOException x) { -if (log.isDebugEnabled()) log.debug("Unable to write async data.",x); -stat
svn commit: r1478727 - in /tomcat/site/trunk: docs/download-60.html docs/index.html docs/whichversion.html xdocs/download-60.xml xdocs/index.xml xdocs/whichversion.xml
Author: jfclere Date: Fri May 3 11:15:45 2013 New Revision: 1478727 URL: http://svn.apache.org/r1478727 Log: Release 6.0.37 Modified: tomcat/site/trunk/docs/download-60.html tomcat/site/trunk/docs/index.html tomcat/site/trunk/docs/whichversion.html tomcat/site/trunk/xdocs/download-60.xml tomcat/site/trunk/xdocs/index.xml tomcat/site/trunk/xdocs/whichversion.xml Modified: tomcat/site/trunk/docs/download-60.html URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/download-60.html?rev=1478727&r1=1478726&r2=1478727&view=diff == --- tomcat/site/trunk/docs/download-60.html (original) +++ tomcat/site/trunk/docs/download-60.html Fri May 3 11:15:45 2013 @@ -212,8 +212,8 @@ http://www.apache.org/dist/tomcat/tomcat-6/KEYS";>KEYS | -6.0.36 | -Browse | +6.0.37 | +Browse | http://archive.apache.org/dist/tomcat/tomcat-6";>Archives @@ -301,7 +301,7 @@ -6.0.36 +6.0.37 @@ -310,8 +310,8 @@ -Please see the - README +Please see the + README file for packaging information. It explains what every distribution contains. @@ -332,44 +332,44 @@ -zip -(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.zip.asc";>pgp, -http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.zip.md5";>md5) +zip +(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.zip.asc";>pgp, +http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.zip.md5";>md5) -tar.gz -(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz.asc";>pgp, -http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz.md5";>md5) +tar.gz +(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.tar.gz.asc";>pgp, +http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.tar.gz.md5";>md5) -32-bit Windows zip -(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36-windows-x86.zip.asc";>pgp, -http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36-windows-x86.zip.md5";>md5) +32-bit Windows zip +(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37-windows-x86.zip.asc";>pgp, +http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37-windows-x86.zip.md5";>md5) -64-bit Windows zip -(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36-windows-x64.zip.asc";>pgp, -http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36-windows-x64.zip.md5";>md5) +64-bit Windows zip +(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37-windows-x64.zip.asc";>pgp, +http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37-windows-x64.zip.md5";>md5) -64-bit Itanium Windows zip -(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36-windows-i64.zip.asc";>pgp, -http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36-windows-i64.zip.md5";>md5) +64-bit Itanium Windows zip +(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37-windows-i64.zip.asc";>pgp, +http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37-windows-i64.zip.md5";>md5) -32-bit/64-bit Windows Service Installer -(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.exe.asc";>pgp, -http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.exe.md5";>md5) +32-bit/64-bit Windows Service Installer +(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.exe.asc";>pgp, +http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.exe.md5";>md5) @@ -381,16 +381,16 @@ -zip -(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36-deployer.zip.asc";>pgp, -http://www.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36-deployer.zip.md5";>md5) +zip +(http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37-deployer.zip.asc";>pgp, +http://www.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37-deployer.zip.md5";>md5)
svn commit: r1478743 - in /tomcat/trunk: java/org/apache/catalina/connector/OutputBuffer.java test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
Author: markt Date: Fri May 3 12:03:33 2013 New Revision: 1478743 URL: http://svn.apache.org/r1478743 Log: Update non-blocking test so it passes with current code. Modified: tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java Modified: tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java?rev=1478743&r1=1478742&r2=1478743&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java Fri May 3 12:03:33 2013 @@ -650,7 +650,8 @@ public class OutputBuffer extends Writer if (coyoteResponse.getWriteListener() == null) { throw new IllegalStateException("not in non blocking mode."); } -AtomicBoolean isReady = new AtomicBoolean(true); +// Assume write is not possible +AtomicBoolean isReady = new AtomicBoolean(false); coyoteResponse.action(ActionCode.NB_WRITE_INTEREST, isReady); return isReady.get(); } Modified: tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java?rev=1478743&r1=1478742&r2=1478743&view=diff == --- tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java (original) +++ tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java Fri May 3 12:03:33 2013 @@ -45,7 +45,6 @@ import org.apache.catalina.startup.Bytes import org.apache.catalina.startup.TesterServlet; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; -import org.apache.coyote.http11.Http11NioProtocol; import org.apache.tomcat.util.buf.ByteChunk; import org.apache.tomcat.util.buf.ByteChunk.ByteOutputChannel; @@ -53,20 +52,23 @@ public class TestNonBlockingAPI extends public static final long bytesToDownload = 1024 * 1024 * 5; -@Override -protected String getProtocol() { -return Http11NioProtocol.class.getName(); -} - -@Override -public void setUp() throws Exception { -super.setUp(); -} @Test public void testNonBlockingRead() throws Exception { -// Configure a context with digest auth and a single protected resource Tomcat tomcat = getTomcatInstance(); + +// TODO Faking non-blocking reads is not yet implemented for BIO. +if (tomcat.getConnector().getProtocolHandlerClassName().equals( +"org.apache.coyote.http11.Http11Protocol")) { +return; +} + +// TODO Non-blocking reads are not yet implemented for APR. +if (tomcat.getConnector().getProtocolHandlerClassName().equals( +"org.apache.coyote.http11.Http11AprProtocol")) { +return; +} + // Must have a real docBase - just use temp StandardContext ctx = (StandardContext) tomcat.addContext("", System.getProperty("java.io.tmpdir")); @@ -83,10 +85,9 @@ public class TestNonBlockingAPI extends Assert.assertEquals(HttpServletResponse.SC_OK, rc); } + @Test public void testNonBlockingWrite() throws Exception { -String bind = "localhost"; -// Configure a context with digest auth and a single protected resource Tomcat tomcat = getTomcatInstance(); // Must have a real docBase - just use temp StandardContext ctx = (StandardContext) tomcat.addContext("", System.getProperty("java.io.tmpdir")); @@ -96,8 +97,6 @@ public class TestNonBlockingAPI extends Tomcat.addServlet(ctx, servletName, servlet); ctx.addServletMapping("/", servletName); tomcat.getConnector().setProperty("socket.txBufSize", "1024"); -tomcat.getConnector().setProperty("address", bind); -System.out.println(tomcat.getConnector().getProperty("address")); tomcat.start(); Map> resHeaders = new HashMap<>(); @@ -130,7 +129,7 @@ public class TestNonBlockingAPI extends } } }); -int rc = postUrl(true, new DataWriter(0), "http://"; + bind + ":" + getPort() + "/", slowReader, resHeaders, +int rc = postUrl(true, new DataWriter(0), "http://localhost:"; + getPort() + "/", slowReader, resHeaders, null); slowReader.flushBuffer(); Assert.assertEquals(HttpServletResponse.SC_OK, rc); @@ -139,9 +138,23 @@ public class TestNonBlockingAPI extends @Test public void testNonBlockingWriteError() throws Exception { -String bind = "localhost"; -// Configure a context with digest au
Re: Clarification of Juli - ClassLoaderLogManager
Hi Kolinko, On Thu, May 2, 2013 at 6:26 PM, Konstantin Kolinko wrote: > 2013/5/2 Lakmali Baminiwatta : > > Hi all, > > > > I am using Tomcat Juli. > > > > In org.apache.juli.ClassLoaderLogManager class, when reading the > > configuration from the specified classLoaders through below method, > > > > *readConfiguration(ClassLoader classLoader)* > > * > > * > > *It checks whether the current classLoader and System Class Loader is > same > > before reading the global logging configuration file. * > > * > > * > > if ((is == null) && *(classLoader == > ClassLoader.getSystemClassLoader()*)) > > { > > String configFileStr = > > System.getProperty("java.util.logging.config.file"); > > if (configFileStr != null) { > > try { > > is = new FileInputStream(replace(configFileStr)); > > } catch (IOException e) { > > // Ignore > > } > > } > > // Try the default JVM configuration > > if (is == null) { > > File defaultFile = new File(new > > File(System.getProperty("java.home"), "lib"), > > "logging.properties"); > > try { > > is = new FileInputStream(defaultFile); > > } catch (IOException e) { > > // Critical problem, do something ... > > } > > } > > } > > > > I am really greatful if the reason why such a check [*classLoader == > > ClassLoader.getSystemClassLoader()*] is required, can be clarified? > > > > I am asking this because, I have a scenario which this condition fails > due > > to unequality of the classLoaders. But removing that check fixed the > issue > > and logging happens as expected. > > > > Appreciate if you can point me out the possibility of an issue with my > > change or why that check is there. > > > > Thanks for your explanation. > > The code there tries > a) per-webapp configuration (aka per-classloader configuration) > which is given by classLoader.getResourceAsStream("logging.properties") > > b) global configuration, which is specified by > System.getProperty("java.util.logging.config.file") setting. > That is the fragment that you cited. > > c) asks parent classloader > > Note that c) also happens in different places like in getProperty(String). > > The condition in b) that you are asking about is needed for c) to > work. That is, the global configuration is read only by the top > classloader in the chain. If you change that, there will be several > copies of configuration, such as several Loggers writing to the same > file in parallel. > ok, understood the requirement of that condition. > > It seems that there is assumption that the root of classloaders chain > is the system classloader. Is that not true for you? > Yes, system classloader and webapp classloaders are in seperate hierachies. > > I should also note that "getClassLoaderInfo(current)" during c) > results in readConfiguration( ) call for that parent classloader, and > "getClassLoaderInfo(null)" would read the one for the system > classloader. So maybe one has to add such call to the loop in c) > instead of fixing the condition in b), but I cannot say without > looking how this configuration is used in other methods. > So what you suggest is to pass null to the , getClassLoaderInfo instead of current as below? It also gave the expected logging. if (is == null) { // Retrieve the root logger of the parent classloader instead ClassLoader current = classLoader.getParent(); ClassLoaderLogInfo info = null; while (current != null && info == null) { info = getClassLoaderInfo(null); current = current.getParent(); } if (info != null) { localRootLogger.setParent(info.rootNode.logger); } } Thanks, Lakmali > > Best regards, > Konstantin Kolinko > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > >
[Bug 54923] New: nsapi_redirect.so does not work with iPlanet on Solaris 11 when running as root
https://issues.apache.org/bugzilla/show_bug.cgi?id=54923 Bug ID: 54923 Summary: nsapi_redirect.so does not work with iPlanet on Solaris 11 when running as root Product: Tomcat Connectors Version: 1.2.37 Hardware: PC OS: Solaris Status: NEW Severity: normal Priority: P2 Component: nsapi Assignee: dev@tomcat.apache.org Reporter: do...@moonteeth.com Classification: Unclassified When starting iPlanet installed as root on Solaris 11, nsapi_redirect.so fails to init. [18/Feb/2013:22:37:24] failure (20669): CORE2254: Error running Init function jk_init Root cause is this line: s = systhread_start(SYSTHREAD_DEFAULT_PRIORITY, 0, init_workers_on_other_threads, init_map); fails to start the thread. Oracle claims that SYSTHREAD_DEFAULT_PRIORITY results in a native thread priority outside of the allowed range and claim that PR_PRIORITY_NORMAL or PR_PRIORITY_LOW should work. @ When running as root, the provided priority of SYSTHREAD_DEFAULT_PRIORITY @ gets cast to an NSPR value of PR_PRIORITY_URGENT, which is finally mapped to @ a native priority value of 85, which in turn happens to be outside the @ allowed priority ranges as per system configuration. The provided priority @ value is unused when running as non-root, and hence the issue is not seen. @ . @ In more detail: @ . @ This issue happens due to the specified thread priority falling outside the @ configured limits in the system. "priocntl -l" displays the priority ranges @ allowed: @ . @ ... @ TS (Time Sharing) @ Configured TS User Priority Range: -60 through 60 @ ... @ . @ The systhread_start() API internally calls NSPR's PR_CreateThread(). @ The value of SYSTHREAD_DEFAULT_PRIORITY is 16, and this is cast to the NSPR @ priority of PR_PRIORITY_URGENT. @ . @ PR_CreateThread() ultimately calls pthread_create(). Before doing so, @ PR_CreateThread() updates the new thread's attributes with the provided @ priority, and more importantly, this is done only if root privileges are @ available. In the case of a non-root user, the provided priority is not used. @ . @ Now the problem with PR_PRIORITY_URGENT is the following: NSPR maps the same @ to a native priority number (85) before using it to update the new thread's @ attributes. 85 is outside the allowed priority ranges as reported by @ "priocntl -l", and hence the pthread_create() ends up failing. @ . @ The customer has the following options: @ . @ 1. Use PR_PRIORITY_LOW instead of SYSTHREAD_DEFAULT_PRIORITY. @ PR_PRIORITY_NORMAL might work, too. @ 2. Check with Solaris team on how to change the system configuration to tweak @ the allowed range of thread priorities -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Problem with nsapi_redirect.so (1.2.37) on iPlanet 7.0.15 and Solaris 11
On 05/02/2013 01:30 PM, Rainer Jung wrote: Especially since the nsapi docs for systhread_start only tell us that the prio is an int depending on the platform and the only other source of information, nsapi.h only contains a single defined prio, which is SYSTHREAD_DEFAULT_PRIORITY. The other constants PR_PRIORITY_... are defined in nspr/prthread.h and are enum elements of type PRThreadPriority which formally don't qualify as arguments to systhread_start(int prio, int stksz, void (*fn)(void *), void *arg) which needs an int. Yeah, I didn't go as far as dealing with the type differences when complaining to them but I'll make that point as well when I update the call later today. I'm still not fully convinced, that PR_PRIORITY_* is correct and isn't just working because PR_PRIORITY_NORMAL=1 is such a low number. When you use PR_PRIORITY_NORMAL, can you see which priority the created thread actually has? Probably using truss, since I think the thread doesn't live long enough to be observable using "ps" with the "-L" flag for threads and adding "pri" to the output format. Nevertheless opening a bugzilla seems to be OK for tracking our progress on this and making the problem publicly available. We might later decide on resolving it as invalid though ;) Oh absolutely. I actually looked at the NSPR code and found the chunk that does the conversion and at initial glance it's basically the math used allows PR_PRIORITY_NORMAL and LOW to work. I went ahead and filed this in bugzilla: https://issues.apache.org/bugzilla/show_bug.cgi?id=54923 I'll push this with Oracle, but if they refuse to budge, does it seem like there'd be no choice but to include an ugly hack to use PR_PRIORITY_NORMAL or something else? Thanks, Andy
svn commit: r1478852 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11NioProcessor.java
Author: markt Date: Fri May 3 16:01:53 2013 New Revision: 1478852 URL: http://svn.apache.org/r1478852 Log: Pull up read event registration Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1478852&r1=1478851&r2=1478852&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Fri May 3 16:01:53 2013 @@ -813,6 +813,8 @@ public abstract class AbstractHttp11Proc } else if (actionCode == ActionCode.NB_WRITE_INTEREST) { AtomicBoolean isReady = (AtomicBoolean)param; isReady.set(getOutputBuffer().isReady()); +} else if (actionCode == ActionCode.NB_READ_INTEREST) { +registerForEvent(true, false); } else if (actionCode == ActionCode.UPGRADE) { httpUpgradeHandler = (HttpUpgradeHandler) param; // Stop further HTTP output Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1478852&r1=1478851&r2=1478852&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Fri May 3 16:01:53 2013 @@ -525,17 +525,6 @@ public class Http11NioProcessor extends } } else if (actionCode == ActionCode.SET_WRITE_LISTENER) { outputBuffer.setBlocking(false); -} else if (actionCode == ActionCode.NB_READ_INTEREST) { -if (socket==null || socket.getSocket().getAttachment(false)==null) { -return; -} -RequestInfo rp = request.getRequestProcessor(); -if (rp.getStage() == org.apache.coyote.Constants.STAGE_SERVICE) { -NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(false); -attach.interestOps(attach.interestOps() | SelectionKey.OP_READ); -} else { -throw new IllegalStateException("Calling isReady asynchronously is illegal."); -} } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1478857 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java LocalStrings.properties
Author: markt Date: Fri May 3 16:13:43 2013 New Revision: 1478857 URL: http://svn.apache.org/r1478857 Log: Fix a TODO in passing Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1478857&r1=1478856&r2=1478857&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Fri May 3 16:13:43 2013 @@ -1637,9 +1637,8 @@ public abstract class AbstractHttp11Proc @Override public SocketState upgradeDispatch(SocketStatus status) throws IOException { // Should never reach this code but in case we do... -// TODO -throw new IOException( -sm.getString("TODO")); +throw new IllegalStateException( +sm.getString("http11Processor.upgrade")); } Modified: tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties?rev=1478857&r1=1478856&r2=1478857&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Fri May 3 16:13:43 2013 @@ -24,6 +24,7 @@ http11processor.socket.ssl=Exception get http11processor.socket.sslreneg=Exception re-negotiating SSL connection http11processor.comet.notsupported=The Comet protocol is not supported by this connector http11processor.sendfile.error=Error sending data using sendfile. May be caused by invalid request attributes for start/end points +http11Processor.upgrade=An internal error has occurred as upgraded connections should only be processed by the dedicated upgrade processor implementations iib.eof.error=Unexpected EOF read on the socket iib.invalidheader=The HTTP header line [{0}] does not conform to RFC 2616 and has been ignored. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1478858 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractInputBuffer.java InternalAprInputBuffer.java InternalInputBuffer.java InternalNioInputBuffer.java
Author: markt Date: Fri May 3 16:14:49 2013 New Revision: 1478858 URL: http://svn.apache.org/r1478858 Log: Remove unused code Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java?rev=1478858&r1=1478857&r2=1478858&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java Fri May 3 16:14:49 2013 @@ -162,12 +162,8 @@ public abstract class AbstractInputBuffe protected int lastActiveFilter; -// - TODO SERVLET 3.1 IN PROGRESS -public abstract boolean supportsNonBlocking(); - // - Properties - /** * Add an input filter to the filter library. */ Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java?rev=1478858&r1=1478857&r2=1478858&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java Fri May 3 16:14:49 2013 @@ -104,13 +104,6 @@ public class InternalAprInputBuffer exte } -@Override -public boolean supportsNonBlocking() { -//TODO SERVLET 3.1 -return false; -} - - /** * Read the request line. This function is meant to be used during the * HTTP request header parsing. Do NOT attempt to read the request body @@ -631,8 +624,8 @@ public class InternalAprInputBuffer exte @Override protected int nbRead() throws IOException { -// TODO Auto-generated method stub -return 0; +// TODO +throw new UnsupportedOperationException("APR non-blocking read"); } Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java?rev=1478858&r1=1478857&r2=1478858&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java Fri May 3 16:14:49 2013 @@ -442,12 +442,6 @@ public class InternalInputBuffer extends } -@Override -public boolean supportsNonBlocking() { -//TODO SERVLET 3.1 -return false; -} - @Override public void recycle() { Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java?rev=1478858&r1=1478857&r2=1478858&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java Fri May 3 16:14:49 2013 @@ -159,12 +159,6 @@ public class InternalNioInputBuffer exte // - Public Methods @Override -public boolean supportsNonBlocking() { -return true; -} - - -@Override public int available() { int available = super.available(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1478862 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractInputBuffer.java LocalStrings.properties
Author: markt Date: Fri May 3 16:21:06 2013 New Revision: 1478862 URL: http://svn.apache.org/r1478862 Log: Another TODO. Inputs are never null. Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java?rev=1478862&r1=1478861&r2=1478862&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java Fri May 3 16:21:06 2013 @@ -166,10 +166,14 @@ public abstract class AbstractInputBuffe /** * Add an input filter to the filter library. + * + * @throws NullPointerException if the supplied filter is null */ public void addFilter(InputFilter filter) { -// FIXME: Check for null ? +if (filter == null) { +throw new NullPointerException(sm.getString("iib.filter.npe")); +} InputFilter[] newFilterLibrary = new InputFilter[filterLibrary.length + 1]; @@ -180,7 +184,6 @@ public abstract class AbstractInputBuffe filterLibrary = newFilterLibrary; activeFilters = new InputFilter[filterLibrary.length]; - } Modified: tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties?rev=1478862&r1=1478861&r2=1478862&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Fri May 3 16:21:06 2013 @@ -27,6 +27,7 @@ http11processor.sendfile.error=Error sen http11Processor.upgrade=An internal error has occurred as upgraded connections should only be processed by the dedicated upgrade processor implementations iib.eof.error=Unexpected EOF read on the socket +iib.filter.npe=You may not add a null filter iib.invalidheader=The HTTP header line [{0}] does not conform to RFC 2616 and has been ignored. iib.invalidmethod=Invalid character (CR or LF) found in method name iib.parseheaders.ise.error=Unexpected state: headers already parsed. Buffer not recycled? - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1478863 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractOutputBuffer.java LocalStrings.properties
Author: markt Date: Fri May 3 16:23:04 2013 New Revision: 1478863 URL: http://svn.apache.org/r1478863 Log: Another TODO Add an error message Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java?rev=1478863&r1=1478862&r2=1478863&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java Fri May 3 16:23:04 2013 @@ -297,8 +297,9 @@ public abstract class AbstractOutputBuff */ public void reset() { -if (committed) -throw new IllegalStateException(/*FIXME:Put an error message*/); +if (committed) { +throw new IllegalStateException(sm.getString("iob.illegalreset")); +} // Recycle Request object response.recycle(); Modified: tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties?rev=1478863&r1=1478862&r2=1478863&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Fri May 3 16:23:04 2013 @@ -34,4 +34,5 @@ iib.parseheaders.ise.error=Unexpected st iib.requestheadertoolarge.error=Request header is too large iib.socketClosed=The socket has been closed in another thread +iob.illegalreset=The response may not be reset once it has been committed iob.responseheadertoolarge.error=An attempt was made to write more data to the response headers than there was room available in the buffer. Increase maxHttpHeaderSize on the connector or write less data into the response headers. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1478941 - in /tomcat/trunk/java/org/apache/coyote/http11: InternalNioInputBuffer.java LocalStrings.properties
Author: markt Date: Fri May 3 19:30:01 2013 New Revision: 1478941 URL: http://svn.apache.org/r1478941 Log: Another small TODO. Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java?rev=1478941&r1=1478940&r2=1478941&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java Fri May 3 19:30:01 2013 @@ -172,13 +172,14 @@ public class InternalNioInputBuffer exte } try { available = nbRead(); -}catch (IOException x) { -//TODO SERVLET 3.1 - -//we should not swallow this exception - +}catch (IOException ioe) { if (log.isDebugEnabled()) { -log.debug("Unable to issue non blocking read.", x); +log.debug(sm.getString("iib.available.readFail"), ioe); } +// Not ideal. This will indicate that data is available which should +// trigger a read which in turn will trigger another IOException and +// that one can be thrown. +available = 1; } return available; } Modified: tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties?rev=1478941&r1=1478940&r2=1478941&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Fri May 3 19:30:01 2013 @@ -26,6 +26,7 @@ http11processor.comet.notsupported=The C http11processor.sendfile.error=Error sending data using sendfile. May be caused by invalid request attributes for start/end points http11Processor.upgrade=An internal error has occurred as upgraded connections should only be processed by the dedicated upgrade processor implementations +iib.available.readFail=A non-blocking read failed while attempting to determine if data was available iib.eof.error=Unexpected EOF read on the socket iib.filter.npe=You may not add a null filter iib.invalidheader=The HTTP header line [{0}] does not conform to RFC 2616 and has been ignored. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1478941 - in /tomcat/trunk/java/org/apache/coyote/http11: InternalNioInputBuffer.java LocalStrings.properties
On 03/05/2013 20:30, ma...@apache.org wrote: > Author: markt > Date: Fri May 3 19:30:01 2013 > New Revision: 1478941 > > URL: http://svn.apache.org/r1478941 > Log: > Another small TODO. > > Modified: > tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java > tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties > > Modified: > tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java?rev=1478941&r1=1478940&r2=1478941&view=diff > == > --- tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java > (original) > +++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java > Fri May 3 19:30:01 2013 > @@ -172,13 +172,14 @@ public class InternalNioInputBuffer exte > } > try { > available = nbRead(); > -}catch (IOException x) { > -//TODO SERVLET 3.1 - > -//we should not swallow this exception > - > +}catch (IOException ioe) { > if (log.isDebugEnabled()) { > -log.debug("Unable to issue non blocking read.", x); > +log.debug(sm.getString("iib.available.readFail"), ioe); > } > +// Not ideal. This will indicate that data is available which > should > +// trigger a read which in turn will trigger another IOException > and > +// that one can be thrown. > +available = 1; I'm not a huge fan of this solution but I think it is the least worst option. The other options I considered: 1. Replacing int available() with boolean hasData() throughout. The value of available() is only ever tested for == 0 or > 0 but this was quite a big change for not much benefit. 2. Throwing a RuntimeException - Not really viable as the user isn't expecting it. 3. Refactor the API to pass the IOException back to the caller - no point as the method does not declare a throws clause Better ideas welcome. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1478968 - in /tomcat/trunk: java/org/apache/coyote/http11/ test/org/apache/catalina/nonblocking/
Author: markt Date: Fri May 3 20:34:34 2013 New Revision: 1478968 URL: http://svn.apache.org/r1478968 Log: Faking of non-blocking reads for BIO. Tweak test case so it relies more on the Servlet API and less on the implementation details of the test so BIO's fake blocking passes. Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1478968&r1=1478967&r2=1478968&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Fri May 3 20:34:34 2013 @@ -810,6 +810,8 @@ public abstract class AbstractHttp11Proc ((AtomicBoolean) param).set(asyncStateMachine.isAsyncTimingOut()); } else if (actionCode == ActionCode.ASYNC_IS_ERROR) { ((AtomicBoolean) param).set(asyncStateMachine.isAsyncError()); +} else if (actionCode == ActionCode.AVAILABLE) { +request.setAvailable(inputBuffer.available()); } else if (actionCode == ActionCode.NB_WRITE_INTEREST) { AtomicBoolean isReady = (AtomicBoolean)param; isReady.set(getOutputBuffer().isReady()); Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1478968&r1=1478967&r2=1478968&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Fri May 3 20:34:34 2013 @@ -472,9 +472,6 @@ public class Http11NioProcessor extends log.warn(sm.getString("http11processor.socket.ssl"), e); } } - -} else if (actionCode == ActionCode.AVAILABLE) { -request.setAvailable(inputBuffer.available()); } else if (actionCode == ActionCode.COMET_BEGIN) { comet = true; } else if (actionCode == ActionCode.COMET_END) { Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java?rev=1478968&r1=1478967&r2=1478968&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java Fri May 3 20:34:34 2013 @@ -71,6 +71,17 @@ public class InternalInputBuffer extends /** + * Data is always available for blocking IO (if you wait long enough) so + * return a value of 1. Note that the actual value is never used it is only + * tested for == 0 or > 0. + */ +@Override +public int available() { +return 1; +} + + +/** * Read the request line. This function is meant to be used during the * HTTP request header parsing. Do NOT attempt to read the request body * using it. @@ -543,8 +554,7 @@ public class InternalInputBuffer extends @Override protected int nbRead() throws IOException { -// TODO Auto-generated method stub -return 0; +throw new IllegalStateException("This method is unused for BIO"); } Modified: tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java?rev=1478968&r1=1478967&r2=1478968&view=diff == --- tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java (original) +++ tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java Fri May 3 20:34:34 2013 @@ -57,12 +57,6 @@ public class TestNonBlockingAPI extends public void testNonBlockingRead() throws Exception { Tomcat tomcat = getTomcatInstance(); -// TODO Faking non-blocking reads is not yet implemented for BIO. -if (tomcat.getConnector().getProtocolHandlerClassName().equals( -"org.apache.coyote.http11.Http11Protocol")) { -return; -} - // TODO Non-blocking reads are not yet implemented for APR. if (tomcat.getConnector().getProtocolHandlerClassName().equals( "org.apache.coyote.http11.Http11
svn commit: r1478980 - /tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
Author: markt Date: Fri May 3 21:05:08 2013 New Revision: 1478980 URL: http://svn.apache.org/r1478980 Log: Filip's changes fixed non-blocking writes Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java?rev=1478980&r1=1478979&r2=1478980&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Fri May 3 21:05:08 2013 @@ -122,7 +122,6 @@ public class InternalNioOutputBuffer ext * @param flip boolean * @return int * @throws IOException - * TODO Fix non blocking write properly */ private synchronized int writeToSocket(ByteBuffer bytebuffer, boolean block, boolean flip) throws IOException { if ( flip ) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54770] Add jarsToScan properties to counteract jarsToSkip exclusions; support per-web-app properties; port to Tomcat 7
https://issues.apache.org/bugzilla/show_bug.cgi?id=54770 Nick Williams changed: What|Removed |Added Summary|Add jarsToScan properties |Add jarsToScan properties |to counteract jarsToSkip|to counteract jarsToSkip |exclusions; support |exclusions; support |per-web-app properties; |per-web-app properties; |port to Java 7 |port to Tomcat 7 -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot failure in ASF Buildbot on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4277 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1478968 Blamelist: markt BUILD FAILED: failed compile_1 sincerely, -The Buildbot
[Bug 54926] New: WsFilter performs handshake validation even if it doesn't have a mapped endpoint
https://issues.apache.org/bugzilla/show_bug.cgi?id=54926 Bug ID: 54926 Summary: WsFilter performs handshake validation even if it doesn't have a mapped endpoint Product: Tomcat 8 Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: rstoyanc...@yahoo.com Classification: Unclassified WsFilter performs several validations on WebSocket requests before checking if there is a registered Endpoint. I think the check for registered Endponts (and delegation to the next Filter) should take place first and the filter should do no further processing if there is mapped Endpoint for that URL. For example a SockJS protocol test send a POST request with a connection and upgrade headers but no ws version header and expects back a 405 (invalid HTTP method) where WsFilter sends 426 even though it has no Endpoint mapped at that URL. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54926] WsFilter performs handshake validation even if it doesn't have a mapped endpoint
https://issues.apache.org/bugzilla/show_bug.cgi?id=54926 --- Comment #1 from rstoyanc...@yahoo.com --- Typo above. I meant to write "if there is *no* mapped Endpoint". -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org