svn commit: r1518900 [2/2] - /tomcat/trunk/webapps/docs/
Modified: tomcat/trunk/webapps/docs/ssl-howto.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/ssl-howto.xml?rev=1518900r1=1518899r2=1518900view=diff == --- tomcat/trunk/webapps/docs/ssl-howto.xml (original) +++ tomcat/trunk/webapps/docs/ssl-howto.xml Fri Aug 30 07:38:49 2013 @@ -36,33 +36,29 @@ section name=Quick Start -blockquoteem -pThe description below uses the variable name $CATALINA_BASE to refer the + +pemThe description below uses the variable name $CATALINA_BASE to refer the base directory against which most relative paths are resolved. If you have not configured Tomcat for multiple instances by setting a CATALINA_BASE directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME, -the directory into which you have installed Tomcat./p -/em/blockquote +the directory into which you have installed Tomcat./em/p + pTo install and configure SSL support on Tomcat, you need to follow these simple steps. For more information, read the rest of this HOW-TO./p ol -liCreate a keystore file to store the serverapos;s private key and -self-signed certificate by executing the following command: +lipCreate a keystore file to store the serverapos;s private key and +self-signed certificate by executing the following command:/p pWindows:/p -source -%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA -/source +source%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA/source pUnix:/p -source -$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -/source -p/p -and specify a password value of changeit./libr/br/ -liUncomment the SSL HTTP/1.1 Connector entry in +source$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA/source + +pand specify a password value of changeit./p/li +lipUncomment the SSL HTTP/1.1 Connector entry in code$CATALINA_BASE/conf/server.xml/code and modify as described in -the a href=#ConfigurationConfiguration section/a below./li -br/br/ +the a href=#ConfigurationConfiguration section/a below./p/li + /ol @@ -213,24 +209,19 @@ Note that OpenSSL often adds readable co they exist before importing the key using codekeytool/code. /p pTo import an existing certificate signed by your own CA into a PKCS12 -keystore using OpenSSL you would execute a command like: +keystore using OpenSSL you would execute a command like:/p sourceopenssl pkcs12 -export -in mycert.crt -inkey mykey.key \ -out mycert.p12 -name tomcat -CAfile myCA.crt \ --caname root -chain -/source -For more advanced cases, consult the a href=http://www.openssl.org/;OpenSSL +-caname root -chain/source +pFor more advanced cases, consult the a href=http://www.openssl.org/;OpenSSL documentation/a. /p pTo create a new keystore from scratch, containing a single self-signed Certificate, execute the following from a terminal command line:/p pWindows:/p -source -%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA -/source +source%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA/source pUnix:/p -source -$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -/source +source$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA/source p(The RSA algorithm should be preferred as a secure algorithm, and this also ensures general compatibility with other servers and components.)/p @@ -243,15 +234,11 @@ to the codekeytool/code command show reflect this new location in the codeserver.xml/code configuration file, as described later. For example:/p pWindows:/p -source -%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA \ - -keystore \path\to\my\keystore -/source +source%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA \ + -keystore \path\to\my\keystore/source pUnix:/p -source -$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA \ - -keystore /path/to/my/keystore -/source +source$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA \ + -keystore /path/to/my/keystore/source pAfter executing this command, you will first be prompted for the keystore password. The default password used by Tomcat is codechangeit/code @@ -281,10 +268,12 @@ Certificate that can be used by your ser subsection name=Edit the Tomcat Configuration File p Tomcat can use two different implementations of SSL: +/p ul lithe JSSE implementation provided as part of the Java runtime (since 1.4)/li lithe APR implementation, which uses the OpenSSL engine by default./li /ul +p The exact configuration details depend on which implementation is being used. The implementation used by Tomcat is chosen automatically unless it is overriden as described below. If the installation uses a href=apr.htmlAPR/a @@ -296,46 +285,38 @@ then it will use the APR SSL implementat To avoid auto configuration you can define which implementation to use by specifying a
svn commit: r1518901 - /tomcat/trunk/webapps/docs/images/docs-stylesheet.css
Author: markt Date: Fri Aug 30 07:39:36 2013 New Revision: 1518901 URL: http://svn.apache.org/r1518901 Log: Part of fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=55383 Improve CSS - use different colours for odd and even table rows Patch by Konstantin Preißer Modified: tomcat/trunk/webapps/docs/images/docs-stylesheet.css Modified: tomcat/trunk/webapps/docs/images/docs-stylesheet.css URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/images/docs-stylesheet.css?rev=1518901r1=1518900r2=1518901view=diff == --- tomcat/trunk/webapps/docs/images/docs-stylesheet.css (original) +++ tomcat/trunk/webapps/docs/images/docs-stylesheet.css Fri Aug 30 07:39:36 2013 @@ -184,15 +184,14 @@ main { code { background-color: rgb(224,255,255); - padding: 0 0.1em; } -div.codeBox pre code, code.attributeName, code.propertyName { +div.codeBox pre code, code.attributeName, code.propertyName, code.noHighlight { background-color: transparent; } div.codeBox { overflow: auto; - /* TODO: Maybe add margin-top and margin-bottom like with p */ + margin: 1em 0; } div.codeBox pre { margin: 0; @@ -214,6 +213,18 @@ div.codeBox pre.wrap { } +table.defaultTable tr { +border: 1px solid #CCC; +} + +table.defaultTable tr:nth-child(even) { +background-color: #FAFBFF; +} + +table.defaultTable tr:nth-child(odd) { +background-color: #EEEFFF; +} + table.defaultTable th { background-color: #88b; color: #fff; @@ -228,8 +239,7 @@ table.detail-table td { } table.defaultTable th, table.defaultTable td, table.detail-table th, table.detail-table td { - border: 1px solid #777; - padding: 5px; + padding: 5px 8px; text-align: left; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55383] Improve markup and design of Tomcat's HTML pages
https://issues.apache.org/bugzilla/show_bug.cgi?id=55383 --- Comment #26 from Mark Thomas ma...@apache.org --- (In reply to Konstantin Preißer from comment #25) Created attachment 30786 [details] Part 2 of updated documentation XMLs Applied. Many thanks. -- 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 55508] New: TldLocationsCache not recognising custom TLDs in WEB-INF/lib
https://issues.apache.org/bugzilla/show_bug.cgi?id=55508 Bug ID: 55508 Summary: TldLocationsCache not recognising custom TLDs in WEB-INF/lib Product: Tomcat 7 Version: 7.0.42 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Jasper Assignee: dev@tomcat.apache.org Reporter: alan@gmail.com I have moved my web app from Tomcat 6.0.35 to Tomcat 7.0.42 and the custom TLDs are not being located. 50783 is similar, but my issue is with custom TLDs located in WEB-INF/lib. TldLocationsCache does not locate them or add them to it's internal map of TLD locations. -- 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 55508] TldLocationsCache not recognising custom TLDs in WEB-INF/lib
https://issues.apache.org/bugzilla/show_bug.cgi?id=55508 Alan McLachlan alan@gmail.com changed: What|Removed |Added OS||All --- Comment #1 from Alan McLachlan alan@gmail.com --- I posted more context on StackOverflow: http://stackoverflow.com/questions/18383997/jsp-jsf-documents-not-rendering-correctly-after-upgrade-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
svn commit: r1518905 - /tomcat/trunk/webapps/examples/WEB-INF/classes/nonblocking/ByteCounter.java
Author: markt Date: Fri Aug 30 07:56:54 2013 New Revision: 1518905 URL: http://svn.apache.org/r1518905 Log: Fix copy/paste error Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/nonblocking/ByteCounter.java Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/nonblocking/ByteCounter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/nonblocking/ByteCounter.java?rev=1518905r1=1518904r2=1518905view=diff == --- tomcat/trunk/webapps/examples/WEB-INF/classes/nonblocking/ByteCounter.java (original) +++ tomcat/trunk/webapps/examples/WEB-INF/classes/nonblocking/ByteCounter.java Fri Aug 30 07:56:54 2013 @@ -90,7 +90,7 @@ public class ByteCounter extends HttpSer this.sos = sos; // In Tomcat, the order the listeners are set controls the order -// that the first calls are made. In this case, the write listener +// that the first calls are made. In this case, the read listener // will be called before the write listener. sis.setReadListener(this); sos.setWriteListener(this); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1518904 - in /tomcat/trunk/webapps/docs: rewrite.xml ssl-howto.xml windows-service-howto.xml
Author: markt Date: Fri Aug 30 07:56:37 2013 New Revision: 1518904 URL: http://svn.apache.org/r1518904 Log: Fix tabs / whitespace Modified: tomcat/trunk/webapps/docs/rewrite.xml tomcat/trunk/webapps/docs/ssl-howto.xml tomcat/trunk/webapps/docs/windows-service-howto.xml Modified: tomcat/trunk/webapps/docs/rewrite.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/rewrite.xml?rev=1518904r1=1518903r2=1518904view=diff == --- tomcat/trunk/webapps/docs/rewrite.xml (original) +++ tomcat/trunk/webapps/docs/rewrite.xml Fri Aug 30 07:56:37 2013 @@ -173,7 +173,7 @@ /p /li /ul - + pThese variables all correspond to the similarly named HTTP MIME-headers and Servlet API methods. Modified: tomcat/trunk/webapps/docs/ssl-howto.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/ssl-howto.xml?rev=1518904r1=1518903r2=1518904view=diff == --- tomcat/trunk/webapps/docs/ssl-howto.xml (original) +++ tomcat/trunk/webapps/docs/ssl-howto.xml Fri Aug 30 07:56:37 2013 @@ -36,13 +36,11 @@ section name=Quick Start - pemThe description below uses the variable name $CATALINA_BASE to refer the base directory against which most relative paths are resolved. If you have not configured Tomcat for multiple instances by setting a CATALINA_BASE directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME, the directory into which you have installed Tomcat./em/p - pTo install and configure SSL support on Tomcat, you need to follow these simple steps. For more information, read the rest of this HOW-TO./p @@ -367,13 +365,11 @@ change this to any port number you wish (outside the scope of this document) is necessary to run Tomcat on port numbers lower than 1024 on many operating systems./p - pemIf you change the port number here, you should also change the value specified for the coderedirectPort/code attribute on the non-SSL connector. This allows Tomcat to automatically redirect users who attempt to access a page with a security constraint specifying that SSL is required, as required by the Servlet Specification./em/p - pAfter completing these configuration changes, you must restart Tomcat as you normally do, and you should be in business. You should be able to access Modified: tomcat/trunk/webapps/docs/windows-service-howto.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/windows-service-howto.xml?rev=1518904r1=1518903r2=1518904view=diff == --- tomcat/trunk/webapps/docs/windows-service-howto.xml (original) +++ tomcat/trunk/webapps/docs/windows-service-howto.xml Fri Aug 30 07:56:37 2013 @@ -232,7 +232,7 @@ tdexecutable/td tdCan one of bjvm/b bjava/b or bexe/b/td /tr - tr +tr td--StopImage/td td/td tdExecutable that will be run on Stop service signal./td - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55508] TldLocationsCache not recognising custom TLDs in WEB-INF/lib
https://issues.apache.org/bugzilla/show_bug.cgi?id=55508 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #2 from Mark Thomas ma...@apache.org --- JSP Specification (2.1 - Tomcat 6, 2.2 - Tomcat 7) section JSP.7.3.1 states: quote When deployed directly into a web application, the tag library descriptor files must always be in the WEB-INF directory, or some subdirectory of it. TLD files should not be placed in /WEB-INF/classes or /WEB-INF/lib ... /quote Tomcat 7 is simply stricter about enforcing this requirement as a result of some refactoring of TLD processing that took place between Tomcat 6 and 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
[Bug 55508] TldLocationsCache not recognising custom TLDs in WEB-INF/lib
https://issues.apache.org/bugzilla/show_bug.cgi?id=55508 --- Comment #3 from Alan McLachlan alan@gmail.com --- Thanks for the speedy response Mark, and for the clarification. -- 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 success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4897 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1518901 Blamelist: markt Build succeeded! sincerely, -The Buildbot
svn commit: r1518926 - in /tomcat/trunk/java/org/apache: catalina/connector/CoyoteAdapter.java coyote/ActionCode.java coyote/ajp/AbstractAjpProcessor.java coyote/ajp/LocalStrings.properties coyote/htt
Author: markt Date: Fri Aug 30 09:50:30 2013 New Revision: 1518926 URL: http://svn.apache.org/r1518926 Log: Review action code usage across HTTP and AJP processors - remove the unused POST_REQUEST action - align ordering between AJP and HTTP for easier comparison - add missing actions to AJP for implementation / review (see TODOs) - document known NO-OPs for AJP - ensure trying to use comet over AJP triggers an error Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java tomcat/trunk/java/org/apache/coyote/ActionCode.java tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/LocalStrings.properties tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1518926r1=1518925r2=1518926view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Fri Aug 30 09:50:30 2013 @@ -425,7 +425,6 @@ public class CoyoteAdapter implements Ad if (!request.isAsync() !comet) { request.finishRequest(); response.finishResponse(); -req.action(ActionCode.POST_REQUEST , null); request.getMappingData().context.logAccess( request, response, System.currentTimeMillis() - req.getStartTime(), @@ -561,7 +560,6 @@ public class CoyoteAdapter implements Ad System.currentTimeMillis() - req.getStartTime(), false); } -req.action(ActionCode.POST_REQUEST , null); } } catch (IOException e) { Modified: tomcat/trunk/java/org/apache/coyote/ActionCode.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ActionCode.java?rev=1518926r1=1518925r2=1518926view=diff == --- tomcat/trunk/java/org/apache/coyote/ActionCode.java (original) +++ tomcat/trunk/java/org/apache/coyote/ActionCode.java Fri Aug 30 09:50:30 2013 @@ -41,12 +41,6 @@ public enum ActionCode { RESET, /** - * Hook called after request, but before recycling. Can be used for logging, - * to update counters, custom cleanup - the request is still visible - */ -POST_REQUEST, - -/** * Hook called if swallowing request input should be disabled. * Example: Cancel a large file upload. * Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1518926r1=1518925r2=1518926view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Fri Aug 30 09:50:30 2013 @@ -318,7 +318,18 @@ public abstract class AbstractAjpProcess @Override public final void action(ActionCode actionCode, Object param) { -if (actionCode == ActionCode.COMMIT) { +if (actionCode == ActionCode.CLOSE) { +// End the processing of the current request, and stop any further +// transactions with the client + +try { +finish(); +} catch (IOException e) { +// Set error flag +error = true; +} + +} else if (actionCode == ActionCode.COMMIT) { if (response.isCommitted()) return; @@ -338,6 +349,9 @@ public abstract class AbstractAjpProcess error = true; } +} else if (actionCode == ActionCode.ACK) { +// NO_OP for AJP + } else if (actionCode == ActionCode.CLIENT_FLUSH) { if (!response.isCommitted()) { @@ -363,17 +377,10 @@ public abstract class AbstractAjpProcess // make sure we are closing the connection error = true; -} else if (actionCode == ActionCode.CLOSE) { -// Close -// End the processing of the current request, and stop any further -// transactions with the client - -try { -finish(); -} catch (IOException e) { -// Set error flag -error = true; -} +} else if (actionCode == ActionCode.RESET) { +// NO-OP +// TODO Check if this is really a NO-OP for AJP or if something +// needs to be done here } else if (actionCode ==
svn commit: r1518944 - /tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
Author: markt Date: Fri Aug 30 12:01:17 2013 New Revision: 1518944 URL: http://svn.apache.org/r1518944 Log: Correct the comment on the default timeout Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1518944r1=1518943r2=1518944view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Fri Aug 30 12:01:17 2013 @@ -266,8 +266,8 @@ public abstract class AbstractAjpProcess /** * The number of milliseconds Tomcat will wait for a subsequent request - * before closing the connection. The default is the same as for - * Apache HTTP Server (15 000 milliseconds). + * before closing the connection. The default is -1 which is an infinite + * timeout. */ protected int keepAliveTimeout = -1; public int getKeepAliveTimeout() { return keepAliveTimeout; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[jira] [Updated] (MTOMCAT-165) http status 401 reported as success
[ https://issues.apache.org/jira/browse/MTOMCAT-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Emeric MARTINEAU updated MTOMCAT-165: - Attachment: maven-plugin-tomcat.patch Add check HTTP status of Tomcat http status 401 reported as success --- Key: MTOMCAT-165 URL: https://issues.apache.org/jira/browse/MTOMCAT-165 Project: Apache Tomcat Maven Plugin Issue Type: Bug Affects Versions: 2.0-beta-1 Environment: Ubuntu/openjdk6 Reporter: Tim Pizey Attachments: maven-plugin-tomcat.patch If tomcat.username and tomcat.password empty then the 401 response is rendered as INFO and SUCCESS is reported. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[jira] [Commented] (MTOMCAT-165) http status 401 reported as success
[ https://issues.apache.org/jira/browse/MTOMCAT-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13754642#comment-13754642 ] Emeric MARTINEAU commented on MTOMCAT-165: -- Hi, plugin never check http status. I submit a patch to check http status. I hope it can be include in 2.2 release. Regards, http status 401 reported as success --- Key: MTOMCAT-165 URL: https://issues.apache.org/jira/browse/MTOMCAT-165 Project: Apache Tomcat Maven Plugin Issue Type: Bug Affects Versions: 2.0-beta-1 Environment: Ubuntu/openjdk6 Reporter: Tim Pizey Attachments: maven-plugin-tomcat.patch If tomcat.username and tomcat.password empty then the 401 response is rendered as INFO and SUCCESS is reported. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519052 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
Author: markt Date: Fri Aug 30 19:28:34 2013 New Revision: 1519052 URL: http://svn.apache.org/r1519052 Log: More non-blocking IO plumbing for the AJP APR/native connector. This will allow reads to be non-blocking between messages (if desired) but remain blocking once a message starts. A more sophisticated approach to non-blocking could be taken but this approach is similar to how NIO does it and, depending on how mod_jk writes and reads data, may be all that is realistic. Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1519052r1=1519051r2=1519052view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Fri Aug 30 19:28:34 2013 @@ -341,10 +341,23 @@ public class AjpAprProcessor extends Abs /** * Read at least the specified amount of bytes, and place them - * in the input buffer. + * in the input buffer. Note that if any data is available to read then this + * method will always block until at least the specified number of bytes + * have been read. + * + * @param n The minimum number of bytes to read + * @param block If there is no data available to read when this method is + * called, should this call block until data becomes available? + * @return + * @throws IOException */ -protected boolean read(int n) -throws IOException { +protected boolean read(int n, boolean block) throws IOException { + +boolean nextReadBlocks = block; + +if (!block inputBuffer.remaining() 0) { +nextReadBlocks = true; +} if (inputBuffer.capacity() - inputBuffer.limit() = n - inputBuffer.remaining()) { @@ -355,9 +368,14 @@ public class AjpAprProcessor extends Abs int nRead; while (inputBuffer.remaining() n) { nRead = readSocket(inputBuffer.limit(), -inputBuffer.capacity() - inputBuffer.limit(), true); -if (nRead 0) { +inputBuffer.capacity() - inputBuffer.limit(), +nextReadBlocks); +if (nRead == 0) { +// Must be a non-blocking read +return false; +} else if (nRead 0) { inputBuffer.limit(inputBuffer.limit() + nRead); +nextReadBlocks = true; } else { throw new IOException(sm.getString(ajpprocessor.failedread)); } @@ -499,7 +517,7 @@ public class AjpAprProcessor extends Abs return false; } } else { -read(headerLength); +read(headerLength, true); } inputBuffer.get(message.getBuffer(), 0, headerLength); int messageLength = message.processHeader(true); @@ -521,7 +539,7 @@ public class AjpAprProcessor extends Abs Integer.valueOf(messageLength), Integer.valueOf(message.getBuffer().length))); } -read(messageLength); +read(messageLength, true); inputBuffer.get(message.getBuffer(), headerLength, messageLength); return true; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519050 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
Author: markt Date: Fri Aug 30 19:06:07 2013 New Revision: 1519050 URL: http://svn.apache.org/r1519050 Log: Add the (as yet unused) plumbing to allow the AJP APR/native processor to perform non-blocking reads and writes. Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1519050r1=1519049r2=1519050view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Fri Aug 30 19:06:07 2013 @@ -19,6 +19,8 @@ package org.apache.coyote.ajp; import java.io.IOException; import java.io.InterruptedIOException; import java.nio.ByteBuffer; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock; import org.apache.coyote.ActionCode; import org.apache.coyote.RequestInfo; @@ -280,7 +282,8 @@ public class AjpAprProcessor extends Abs long socketRef = socketWrapper.getSocket().longValue(); if (outputBuffer.position() 0) { -if ((socketRef != 0) Socket.sendbb(socketRef, 0, outputBuffer.position()) 0) { +if ((socketRef != 0) +writeSocket(0, outputBuffer.position(), true) 0) { // There are no re-tries so clear the buffer to prevent a // possible overflow if the buffer is used again. BZ53119. outputBuffer.clear(); @@ -291,6 +294,51 @@ public class AjpAprProcessor extends Abs } +private int writeSocket(int pos, int len, boolean block) { + +Lock readLock = socketWrapper.getBlockingStatusReadLock(); +WriteLock writeLock = socketWrapper.getBlockingStatusWriteLock(); +long socket = socketWrapper.getSocket().longValue(); + +boolean writeDone = false; +int result = 0; +try { +readLock.lock(); +if (socketWrapper.getBlockingStatus() == block) { +result = Socket.sendbb(socket, pos, len); +writeDone = true; +} +} finally { +readLock.unlock(); +} + +if (!writeDone) { +try { +writeLock.lock(); +socketWrapper.setBlockingStatus(block); +// Set the current settings for this socket +Socket.optSet(socket, Socket.APR_SO_NONBLOCK, (block ? 0 : 1)); +// Downgrade the lock +try { +readLock.lock(); +writeLock.unlock(); +result = Socket.sendbb(socket, pos, len); +} finally { +readLock.unlock(); +} +} finally { +// Should have been released above but may not have been on some +// exception paths +if (writeLock.isHeldByCurrentThread()) { +writeLock.unlock(); +} +} +} + +return result; +} + + /** * Read at least the specified amount of bytes, and place them * in the input buffer. @@ -306,9 +354,8 @@ public class AjpAprProcessor extends Abs } int nRead; while (inputBuffer.remaining() n) { -nRead = Socket.recvbb -(socketWrapper.getSocket().longValue(), inputBuffer.limit(), -inputBuffer.capacity() - inputBuffer.limit()); +nRead = readSocket(inputBuffer.limit(), +inputBuffer.capacity() - inputBuffer.limit(), true); if (nRead 0) { inputBuffer.limit(inputBuffer.limit() + nRead); } else { @@ -339,9 +386,8 @@ public class AjpAprProcessor extends Abs } int nRead; while (inputBuffer.remaining() n) { -nRead = Socket.recvbb -(socketWrapper.getSocket().longValue(), inputBuffer.limit(), -inputBuffer.capacity() - inputBuffer.limit()); +nRead = readSocket(inputBuffer.limit(), +inputBuffer.capacity() - inputBuffer.limit(), true); if (nRead 0) { inputBuffer.limit(inputBuffer.limit() + nRead); } else { @@ -358,6 +404,51 @@ public class AjpAprProcessor extends Abs } +private int readSocket(int pos, int len, boolean block) { + +Lock readLock = socketWrapper.getBlockingStatusReadLock(); +WriteLock writeLock = socketWrapper.getBlockingStatusWriteLock(); +long socket = socketWrapper.getSocket().longValue(); + +boolean readDone = false; +int result = 0; +try { +readLock.lock(); +if (socketWrapper.getBlockingStatus() == block) { +
svn commit: r1519057 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
Author: markt Date: Fri Aug 30 19:53:20 2013 New Revision: 1519057 URL: http://svn.apache.org/r1519057 Log: Complete a TODO that allows the receive() method to be refactored so it is identical in all three AJP processors Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1519057r1=1519056r2=1519057view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Fri Aug 30 19:53:20 2013 @@ -118,7 +118,7 @@ public class AjpProcessor extends Abstra socket.getSocket().setSoTimeout(keepAliveTimeout); } // Get first message of the request -if (!readMessage(requestHeaderMessage)) { +if (!readMessage(requestHeaderMessage, true)) { // This means a connection timeout break; } @@ -321,10 +321,9 @@ public class AjpProcessor extends Abstra first = false; bodyMessage.reset(); -if (!readMessage(bodyMessage)) { -// Invalid message -return false; -} + +readMessage(bodyMessage, true); + // No data received. if (bodyMessage.getLen() == 0) { // just the header @@ -341,14 +340,17 @@ public class AjpProcessor extends Abstra return true; } + /** * Read an AJP message. * + * @param message The message to populate + * @param ignored Not used in BIO * @return true if the message has been read, false if the short read * didn't return anything * @throws IOException any other failure, including incomplete reads */ -protected boolean readMessage(AjpMessage message) +protected boolean readMessage(AjpMessage message, boolean ignored) throws IOException { byte[] buf = message.getBuffer(); @@ -359,8 +361,8 @@ public class AjpProcessor extends Abstra int messageLength = message.processHeader(true); if (messageLength 0) { // Invalid AJP header signature -// TODO: Throw some exception and close the connection to frontend. -return false; +throw new IOException(sm.getString(ajpmessage.invalidLength, +Integer.valueOf(messageLength))); } else if (messageLength == 0) { // Zero length message. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519091 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
Author: markt Date: Fri Aug 30 21:26:11 2013 New Revision: 1519091 URL: http://svn.apache.org/r1519091 Log: Align the readMessage() signature in NIO with the BIO and APR. Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1519091r1=1519090r2=1519091view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Fri Aug 30 21:26:11 2013 @@ -100,8 +100,7 @@ public class AjpNioProcessor extends Abs // Parsing the request header try { // Get first message of the request -int bytesRead = readMessage(requestHeaderMessage, false); -if (bytesRead == 0) { +if (!readMessage(requestHeaderMessage, false)) { break; } // Set back timeout if keep alive timeout is enabled @@ -396,10 +395,11 @@ public class AjpNioProcessor extends Abs /** * Read an AJP message. * - * @return The number of bytes read + * @return codetrue/code if a message was read, otherwise false + * * @throws IOException any other failure, including incomplete reads */ -protected int readMessage(AjpMessage message, boolean blockFirstRead) +protected boolean readMessage(AjpMessage message, boolean blockFirstRead) throws IOException { byte[] buf = message.getBuffer(); @@ -408,7 +408,7 @@ public class AjpNioProcessor extends Abs int bytesRead = read(buf, 0, headerLength, blockFirstRead); if (bytesRead == 0) { -return 0; +return false; } int messageLength = message.processHeader(true); @@ -419,7 +419,7 @@ public class AjpNioProcessor extends Abs } else if (messageLength == 0) { // Zero length message. -return bytesRead; +return true; } else { if (messageLength buf.length) { @@ -431,7 +431,7 @@ public class AjpNioProcessor extends Abs Integer.valueOf(buf.length))); } bytesRead += read(buf, headerLength, messageLength, true); -return bytesRead; +return true; } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519053 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
Author: markt Date: Fri Aug 30 19:39:51 2013 New Revision: 1519053 URL: http://svn.apache.org/r1519053 Log: Remove the second (almost identical) read method and hook everything up to the new read method with optional blocking. The only non-blocking read is for the first byte for the second and subsequent requests on a kept alive connection to enable the worker thread to return to the pool if there is no request to process. Both the behaviour and code should be more similar to the AJP NIO connector now. More refactoring to follow. Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1519053r1=1519052r2=1519053view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Fri Aug 30 19:39:51 2013 @@ -27,7 +27,6 @@ import org.apache.coyote.RequestInfo; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.jni.Socket; -import org.apache.tomcat.jni.Status; import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState; import org.apache.tomcat.util.net.AprEndpoint; @@ -119,7 +118,7 @@ public class AjpAprProcessor extends Abs // Parsing the request header try { // Get first message of the request -if (!readMessage(requestHeaderMessage, true, keptAlive)) { +if (!readMessage(requestHeaderMessage, !keptAlive)) { // This means that no data is available right now // (long keepalive), so that the processor should be recycled // and the method should return true @@ -382,43 +381,6 @@ public class AjpAprProcessor extends Abs } return true; - -} - - -/** - * Read at least the specified amount of bytes, and place them - * in the input buffer. - */ -protected boolean readt(int n, boolean useAvailableData) -throws IOException { - -if (useAvailableData inputBuffer.remaining() == 0) { -return false; -} -if (inputBuffer.capacity() - inputBuffer.limit() = -n - inputBuffer.remaining()) { -inputBuffer.compact(); -inputBuffer.limit(inputBuffer.position()); -inputBuffer.position(0); -} -int nRead; -while (inputBuffer.remaining() n) { -nRead = readSocket(inputBuffer.limit(), -inputBuffer.capacity() - inputBuffer.limit(), true); -if (nRead 0) { -inputBuffer.limit(inputBuffer.limit() + nRead); -} else { -if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) { -return false; -} else { -throw new IOException(sm.getString(ajpprocessor.failedread)); -} -} -} - -return true; - } @@ -476,10 +438,9 @@ public class AjpAprProcessor extends Abs first = false; bodyMessage.reset(); -if (!readMessage(bodyMessage, false, false)) { -// Invalid message -return false; -} + +readMessage(bodyMessage, true); + // No data received. if (bodyMessage.getLen() == 0) { // just the header @@ -500,25 +461,22 @@ public class AjpAprProcessor extends Abs /** * Read an AJP message. * - * @param first is true if the message is the first in the request, which - *will cause a short duration blocking read - * @return true if the message has been read, false if the short read - * didn't return anything + * @param block If there is no data available to read when this method is + * called, should this call block until data becomes available? + + * @return true if the message has been read, false if no data was read + * * @throws IOException any other failure, including incomplete reads */ -protected boolean readMessage(AjpMessage message, boolean first, -boolean useAvailableData) +protected boolean readMessage(AjpMessage message, boolean block) throws IOException { int headerLength = message.getHeaderLength(); -if (first) { -if (!readt(headerLength, useAvailableData)) { -return false; -} -} else { -read(headerLength, true); +if (!read(headerLength, block)) { +return false; } + inputBuffer.get(message.getBuffer(), 0, headerLength); int messageLength =
svn commit: r1519097 - in /tomcat/trunk/java/org/apache/coyote/ajp: AbstractAjpProcessor.java AjpAprProcessor.java AjpNioProcessor.java AjpProcessor.java
Author: markt Date: Fri Aug 30 21:57:45 2013 New Revision: 1519097 URL: http://svn.apache.org/r1519097 Log: Pull up receive Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1519097r1=1519096r2=1519097view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Fri Aug 30 21:57:45 2013 @@ -649,8 +649,47 @@ public abstract class AbstractAjpProcess throws IOException; // Methods used by SocketInputBuffer -protected abstract boolean receive() throws IOException; +/** Receive a chunk of data. Called to implement the + * 'special' packet in ajp13 and to receive the data + * after we send a GET_BODY packet + */ +protected boolean receive() throws IOException { + +first = false; +bodyMessage.reset(); + +readMessage(bodyMessage, true); + +// No data received. +if (bodyMessage.getLen() == 0) { +// just the header +// Don't mark 'end of stream' for the first chunk. +return false; +} +int blen = bodyMessage.peekInt(); +if (blen == 0) { +return false; +} +bodyMessage.getBodyBytes(bodyBytes); +empty = false; +return true; +} + + +/** + * Read an AJP message. + * + * @param message The message to populate + * @param block If there is no data available to read when this method is + * called, should this call block until data becomes available? + + * @return true if the message has been read, false if no data was read + * + * @throws IOException any other failure, including incomplete reads + */ +protected abstract boolean readMessage(AjpMessage message, +boolean blockOnFirstRead) throws IOException; @Override public final boolean isComet() { Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1519097r1=1519096r2=1519097view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Fri Aug 30 21:57:45 2013 @@ -429,35 +429,6 @@ public class AjpAprProcessor extends Abs } -/** Receive a chunk of data. Called to implement the - * 'special' packet in ajp13 and to receive the data - * after we send a GET_BODY packet - */ -@Override -public boolean receive() throws IOException { - -first = false; -bodyMessage.reset(); - -readMessage(bodyMessage, true); - -// No data received. -if (bodyMessage.getLen() == 0) { -// just the header -// Don't mark 'end of stream' for the first chunk. -return false; -} -int blen = bodyMessage.peekInt(); -if (blen == 0) { -return false; -} - -bodyMessage.getBodyBytes(bodyBytes); -empty = false; -return true; -} - - /** * Read an AJP message. * @@ -468,6 +439,7 @@ public class AjpAprProcessor extends Abs * * @throws IOException any other failure, including incomplete reads */ +@Override protected boolean readMessage(AjpMessage message, boolean block) throws IOException { Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1519097r1=1519096r2=1519097view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Fri Aug 30 21:57:45 2013 @@ -363,35 +363,6 @@ public class AjpNioProcessor extends Abs } -/** Receive a chunk of data. Called to implement the - * 'special' packet in ajp13 and to receive the data - * after we send a GET_BODY packet - */ -@Override -public boolean receive() throws IOException { - -first = false; -bodyMessage.reset(); - -readMessage(bodyMessage, true); - -// No data received. -if (bodyMessage.getLen() == 0) { -// just the header -//
svn commit: r1519103 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
Author: markt Date: Fri Aug 30 22:38:51 2013 New Revision: 1519103 URL: http://svn.apache.org/r1519103 Log: timeout is an int Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1519103r1=1519102r2=1519103view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Fri Aug 30 22:38:51 2013 @@ -90,7 +90,7 @@ public class AjpNioProcessor extends Abs // Setting up the socket this.socketWrapper = socket; -long soTimeout = endpoint.getSoTimeout(); +int soTimeout = endpoint.getSoTimeout(); boolean cping = false; // Error flag - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519106 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
Author: markt Date: Fri Aug 30 22:52:14 2013 New Revision: 1519106 URL: http://svn.apache.org/r1519106 Log: Align the setting of the keep-alive timeout with the NIO implementation Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1519106r1=1519105r2=1519106view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Fri Aug 30 22:52:14 2013 @@ -110,13 +110,8 @@ public class AjpProcessor extends Abstra error = false; while (!error !endpoint.isPaused()) { - // Parsing the request header try { -// Set keep alive timeout if enabled -if (keepAliveTimeout 0) { -socket.getSocket().setSoTimeout(keepAliveTimeout); -} // Get first message of the request if (!readMessage(requestHeaderMessage, true)) { // This means a connection timeout @@ -225,6 +220,11 @@ public class AjpProcessor extends Abstra request.updateCounters(); rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); +// Set keep alive timeout if enabled +if (keepAliveTimeout 0) { +socket.getSocket().setSoTimeout(keepAliveTimeout); +} + recycle(false); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519114 - in /tomcat/trunk/java/org/apache/coyote/ajp: AbstractAjpProcessor.java AjpAprProcessor.java AjpNioProcessor.java AjpProcessor.java
Author: markt Date: Fri Aug 30 23:11:33 2013 New Revision: 1519114 URL: http://svn.apache.org/r1519114 Log: Add a (current unused) method to set socket timeouts Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1519114r1=1519113r2=1519114view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Fri Aug 30 23:11:33 2013 @@ -46,6 +46,7 @@ import org.apache.tomcat.util.net.Abstra import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState; import org.apache.tomcat.util.net.SSLSupport; import org.apache.tomcat.util.net.SocketStatus; +import org.apache.tomcat.util.net.SocketWrapper; import org.apache.tomcat.util.res.StringManager; /** @@ -648,6 +649,10 @@ public abstract class AbstractAjpProcess protected abstract void output(byte[] src, int offset, int length) throws IOException; +// Methods used by process +protected abstract void setTimeout(SocketWrapperS socketWrapper, +int timeout) throws IOException; + // Methods used by SocketInputBuffer /** Receive a chunk of data. Called to implement the * 'special' packet in ajp13 and to receive the data Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1519114r1=1519113r2=1519114view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Fri Aug 30 23:11:33 2013 @@ -272,6 +272,13 @@ public class AjpAprProcessor extends Abs // -- Protected Methods +@Override +protected void setTimeout(SocketWrapperLong socketWrapper, +int timeout) throws IOException { +Socket.timeoutSet( +socketWrapper.getSocket().longValue(), timeout * 1000); +} + @Override protected void output(byte[] src, int offset, int length) Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1519114r1=1519113r2=1519114view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Fri Aug 30 23:11:33 2013 @@ -266,6 +266,13 @@ public class AjpNioProcessor extends Abs // -- Protected Methods @Override +protected void setTimeout(SocketWrapperNioChannel socketWrapper, +int timeout) throws IOException { +socketWrapper.setTimeout(timeout); +} + + +@Override protected void output(byte[] src, int offset, int length) throws IOException { Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1519114r1=1519113r2=1519114view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Fri Aug 30 23:11:33 2013 @@ -282,6 +282,13 @@ public class AjpProcessor extends Abstra // -- Protected Methods @Override +protected void setTimeout(SocketWrapperSocket socketWrapper, +int timeout) throws IOException { +socketWrapper.getSocket().setSoTimeout(timeout); +} + + +@Override protected void output(byte[] src, int offset, int length) throws IOException { output.write(src, offset, length); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519116 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
Author: markt Date: Fri Aug 30 23:25:27 2013 New Revision: 1519116 URL: http://svn.apache.org/r1519116 Log: Use the new method to set socket timeouts Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1519116r1=1519115r2=1519116view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Fri Aug 30 23:25:27 2013 @@ -118,7 +118,7 @@ public class AjpProcessor extends Abstra } // Set back timeout if keep alive timeout is enabled if (keepAliveTimeout 0) { -socket.getSocket().setSoTimeout(soTimeout); +setTimeout(socketWrapper, soTimeout); } // Check message type, process right away and break if // not regular request processing @@ -221,7 +221,7 @@ public class AjpProcessor extends Abstra rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); // Set keep alive timeout if enabled if (keepAliveTimeout 0) { -socket.getSocket().setSoTimeout(keepAliveTimeout); +setTimeout(socketWrapper, keepAliveTimeout); } recycle(false); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519120 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
Author: markt Date: Fri Aug 30 23:28:33 2013 New Revision: 1519120 URL: http://svn.apache.org/r1519120 Log: Add the keptAlive flag (copied from APR) so that the first requst uses a blocking read as there should be data to read immediately after the connection has been established. Use the new method to set timeouts. Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1519120r1=1519119r2=1519120view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Fri Aug 30 23:28:33 2013 @@ -96,16 +96,18 @@ public class AjpNioProcessor extends Abs // Error flag error = false; +boolean keptAlive = false; + while (!error !endpoint.isPaused()) { // Parsing the request header try { // Get first message of the request -if (!readMessage(requestHeaderMessage, false)) { +if (!readMessage(requestHeaderMessage, !keptAlive)) { break; } // Set back timeout if keep alive timeout is enabled if (keepAliveTimeout 0) { -socket.setTimeout(soTimeout); +setTimeout(socketWrapper, soTimeout); } // Check message type, process right away and break if // not regular request processing @@ -133,6 +135,7 @@ public class AjpNioProcessor extends Abs recycle(true); break; } +keptAlive = true; request.setStartTime(System.currentTimeMillis()); } catch (IOException e) { error = true; @@ -210,7 +213,7 @@ public class AjpNioProcessor extends Abs rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); // Set keep alive timeout if enabled if (keepAliveTimeout 0) { -socket.setTimeout(keepAliveTimeout); +setTimeout(socketWrapper, keepAliveTimeout); } recycle(false); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1519121 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
Author: markt Date: Fri Aug 30 23:32:05 2013 New Revision: 1519121 URL: http://svn.apache.org/r1519121 Log: Use the new method to set socket timeouts Add support for a separate keepalive timeout Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1519121r1=1519120r2=1519121view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Fri Aug 30 23:32:05 2013 @@ -104,9 +104,12 @@ public class AjpAprProcessor extends Abs // Setting up the socket this.socketWrapper = socket; + long socketRef = socket.getSocket().longValue(); Socket.setrbb(socketRef, inputBuffer); Socket.setsbb(socketRef, outputBuffer); + +int soTimeout = endpoint.getSoTimeout(); boolean cping = false; // Error flag @@ -124,6 +127,10 @@ public class AjpAprProcessor extends Abs // and the method should return true break; } +// Set back timeout if keep alive timeout is enabled +if (keepAliveTimeout 0) { +setTimeout(socketWrapper, soTimeout); +} // Check message type, process right away and break if // not regular request processing int type = requestHeaderMessage.getByte(); @@ -223,6 +230,11 @@ public class AjpAprProcessor extends Abs request.updateCounters(); rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); +// Set keep alive timeout if enabled +if (keepAliveTimeout 0) { +setTimeout(socketWrapper, keepAliveTimeout); +} + recycle(false); } - 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/4905 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1519109 Blamelist: markt BUILD FAILED: failed compile_1 sincerely, -The Buildbot
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4906 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1519121 Blamelist: markt Build succeeded! sincerely, -The Buildbot
[GUMP@vmgump]: Project tomcat-trunk-test (in module tomcat-trunk) failed
To whom it may engage... This is an automated request, but not an unsolicited one. For more information please visit http://gump.apache.org/nagged.html, and/or contact the folk at gene...@gump.apache.org. Project tomcat-trunk-test has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 62 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - tomcat-trunk-test : Tomcat 8.x, a web server implementing the Java Servlet 3.1, ... Full details are available at: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Dependency on junit exists, no need to add for property hamcrest.jar. -DEBUG- Dependency on commons-daemon exists, no need to add for property commons-daemon.native.src.tgz. -DEBUG- Dependency on commons-daemon exists, no need to add for property tomcat-native.tar.gz. -DEBUG- Dependency on tomcat-trunk exists, no need to add for property tomcat-dbcp.home. -INFO- Failed with reason build failed -INFO- Project Reports in: /srv/gump/public/workspace/tomcat-trunk/output/build/logs The following work was performed: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test/gump_work/build_tomcat-trunk_tomcat-trunk-test.html Work Name: build_tomcat-trunk_tomcat-trunk-test (Type: Build) Work ended in a state of : Failed Elapsed: 52 mins 46 secs Command Line: /usr/lib/jvm/java-7-oracle/bin/java -Djava.awt.headless=true -Dbuild.sysclasspath=only org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml -Djunit.jar=/srv/gump/public/workspace/junit/dist/junit-20130831.jar -Dobjenesis.jar=/srv/gump/public/workspace/objenesis/main/target/objenesis-2.1-SNAPSHOT.jar -Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20130831-native-src.tar.gz -Dexamples.sources.skip=true -Dtomcat-dbcp.home=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps -Djdt.jar=/srv/gump/packages/eclipse/plugins/org.eclipse.jdt.core_3.4.2/jdtcore.jar -Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-20130831.jar -Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20130831-native-src.tar.gz -Dtest.accesslog=true -Dcommons-pool.home=/srv/gump/public/workspace/apache-commons/pool -Dcommons-dbcp.home=/ srv/gump/public/workspace/apache-commons/dbcp -Deasymock.jar=/srv/gump/public/workspace/easymock/easymock/target/easymock-3.3-SNAPSHOT.jar -Dhamcrest.jar=/srv/gump/public/workspace/junit/dist/junit-20130831.jar -Dcglib.jar=/srv/gump/packages/cglib/cglib-nodep-2.2.jar test [Working Directory: /srv/gump/public/workspace/tomcat-trunk] CLASSPATH: /usr/lib/jvm/java-7-oracle/lib/tools.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-trunk/output/testclasses:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit4.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/servle t-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/websocket-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-storeconfig.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-tribes.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ha.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-jni.jar:/srv/gump/public/workspace/tomcat