DO NOT REPLY [Bug 51767] New: isapi_redirect intermittently crashes iis worker process w3wp
https://issues.apache.org/bugzilla/show_bug.cgi?id=51767 Bug #: 51767 Summary: isapi_redirect intermittently crashes iis worker process w3wp Product: Tomcat Connectors Version: 1.2.30 Platform: PC Status: NEW Severity: major Priority: P2 Component: isapi AssignedTo: dev@tomcat.apache.org ReportedBy: frank.kavan...@wbtsystems.com Classification: Unclassified Created attachment 27461 --> https://issues.apache.org/bugzilla/attachment.cgi?id=27461 Windows debug file We are currently running multiple web servers redirecting through isapi_redirect to a single application server. We have frequent but intermitten errors which result in the IIS workers processs w3wp crashing with the error below (furthe information is in the debug file attached). Currenly we are using version 1.2.30. I see a few bugs fixed for header lenght in 1.2.32 but none of the fixes appear to directly reference this particular issue. As the bug is intermittent (there have been gaps of in excess of 2 months between issues) simply putting 1.2.32 on and waiting is not really an ideal situation. Does anyone know if this issue has been addressed in 1.2.32 Application Error: -- Faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bd0eb Faulting module name: msvcrt.dll, version: 7.0.7600.16385, time stamp: 0x4a5bdfbe Exception code: 0xc005 Fault offset: 0x16cb Faulting process id: 0x1048 Faulting application start time: 0x01cc5048637d02ca Faulting application path: c:\windows\system32\inetsrv\w3wp.exe Faulting module path: C:\Windows\system32\msvcrt.dll Report Id: a22b0c9c-bc3b-11e0-ad5e-0050568d3cb8 Windows Error Reporting: Fault bucket , type 0 Event Name: APPCRASH Response: Not available Cab Id: 0 Problem signature: P1: w3wp.exe P2: 7.5.7600.16385 P3: 4a5bd0eb P4: msvcrt.dll P5: 7.0.7600.16385 P6: 4a5bdfbe P7: c005 P8: 16cb P9: P10: Attached files: These files may be available here: C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_w3wp.exe_c9d767888cb8755d34c77c5e66e185e35a87c594_267977ef Analysis symbol: Rechecking for solution: 0 Report Id: a22b0c9c-bc3b-11e0-ad5e-0050568d3cb8 Report Status: 4 Source IIS Worker Process Summary Stopped working Date ?1/?08/?2011 10:41 PM Status Report sent Description Faulting Application Path:c:\Windows\System32\inetsrv\w3wp.exe -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 51769] New: False positive: Somebody try to hack into the site!!!
https://issues.apache.org/bugzilla/show_bug.cgi?id=51769 Bug #: 51769 Summary: False positive: Somebody try to hack into the site!!! Product: Tomcat Connectors Version: 1.2.31 Platform: PC OS/Version: Windows Server 2003 Status: NEW Severity: normal Priority: P2 Component: isapi AssignedTo: dev@tomcat.apache.org ReportedBy: stefan.ll...@essentia.ltd.uk Classification: Unclassified Messages such as the following are logged: [Mon Sep 05 11:36:35 2011] [jk_isapi_plugin.c (843)]: HttpFilterProc [/integrator/download/d2b3b4c1-5eb2-4c45-9ca6-2af7bdc286e3/teamtrainer/50/meta-inf.xml;jsessionid=4adfb2366e39fef63fda294d375f0273] points to the web-inf or meta-inf directory. Somebody try to hack into the site!!! and HTTP status 403 is returned on the request. This is a false positive. The file name is meta-inf.xml but it is not in the meta-inf directory. A number of forum references can be found e.g. http://mail-archives.apache.org/mod_mbox/tomcat-dev/200505.mbox/%3c1115929838.4283bcee5c...@aragorntools.webappcabaret.net%3E but it does appear to have been previously raised as a bug. Unfortunately this renders the ispai connector unusable with this Tomcat application. Reproduced on isapi at 1.2.32 (not available in pulldown list!). Cannot be reproduced in mod_jk connector. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 51769] False positive: Somebody try to hack into the site!!!
https://issues.apache.org/bugzilla/show_bug.cgi?id=51769 Stefan Lloyd changed: What|Removed |Added CC||stefan.ll...@essentia.ltd.u ||k -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r1165601 - /tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
Author: markt Date: Tue Sep 6 11:12:17 2011 New Revision: 1165601 URL: http://svn.apache.org/viewvc?rev=1165601&view=rev Log: Add another 3.7+ note Modified: tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt Modified: tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt URL: http://svn.apache.org/viewvc/tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt?rev=1165601&r1=1165600&r2=1165601&view=diff == --- tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt (original) +++ tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt Tue Sep 6 11:12:17 2011 @@ -50,6 +50,7 @@ Unnecessary code (all additional check boxes) Generic types - All - W + (ignore unavoidable generics warnings) (Eclipse 3.7+) Annotations - All - W (all additional check boxes) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1165602 - /tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
Author: markt Date: Tue Sep 6 11:12:35 2011 New Revision: 1165602 URL: http://svn.apache.org/viewvc?rev=1165602&view=rev Log: Fix typo Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.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=1165602&r1=1165601&r2=1165602&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Sep 6 11:12:35 2011 @@ -1293,7 +1293,7 @@ public abstract class AbstractHttp11Proc /** * Provides a mechanism for those connectors (currently only NIO) that need - * that need to set comment timeouts. + * that need to set comet timeouts. */ protected abstract void setCometTimeouts(SocketWrapper socketWrapper); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1165338 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
On 06/09/2011 07:29, Felix Schumacher wrote: >> +/** >> + * Provides a mechanism for those connectors (currently only NIO) >> that need >> + * that need to set comment timeouts. > Did you mean Comet timeouts? I did. Fixed. Thanks. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1165608 - in /tomcat/trunk/java/org/apache: coyote/http11/ tomcat/util/net/
Author: markt Date: Tue Sep 6 11:26:30 2011 New Revision: 1165608 URL: http://svn.apache.org/viewvc?rev=1165608&view=rev Log: Make keptAlive initialization common between the connectors Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.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/tomcat/util/net/AbstractEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.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=1165608&r1=1165607&r2=1165608&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Sep 6 11:26:30 2011 @@ -87,6 +87,16 @@ public abstract class AbstractHttp11Proc /** + * Flag used to indicate that the socket should treat the next request + * processed like a keep-alive connection - i.e. one where there may not be + * any data to process. The initial value of this flag on entering the + * process method is different for connectors that use polling (NIO / APR - + * data is always expected) compared to those that use blocking (BIO - data + * is only expected if the connection isn't in the keep-alive state). + */ +protected boolean keptAlive; + +/** * Flag that indicates that send file processing is in progress and that the * socket should not be returned to the poller (where a poller is used). */ 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=1165608&r1=1165607&r2=1165608&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Sep 6 11:26:30 2011 @@ -184,6 +184,11 @@ public class Http11AprProcessor extends openSocket = false; sendfileInProgress = false; readComplete = true; +if (endpoint.getUsePolling()) { +keptAlive = false; +} else { +keptAlive = socketWrapper.isKeptAlive(); +} int soTimeout = endpoint.getSoTimeout(); @@ -191,8 +196,6 @@ public class Http11AprProcessor extends socketWrapper.setKeepAliveLeft(0); } -boolean keptAlive = false; - long socketRef = socketWrapper.getSocket().longValue(); while (!error && keepAlive && !comet && !isAsync() && 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=1165608&r1=1165607&r2=1165608&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Sep 6 11:26:30 2011 @@ -213,6 +213,11 @@ public class Http11NioProcessor extends openSocket = false; sendfileInProgress = false; readComplete = true; +if (endpoint.getUsePolling()) { +keptAlive = false; +} else { +keptAlive = socketWrapper.isKeptAlive(); +} int soTimeout = endpoint.getSoTimeout(); @@ -220,8 +225,6 @@ public class Http11NioProcessor extends socketWrapper.setKeepAliveLeft(0); } -boolean keptAlive = false; - while (!error && keepAlive && !comet && !isAsync() && !endpoint.isPaused()) { 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=1165608&r1=1165607&r2=1165608&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Tue Sep 6 11:26:30 2011 @@ -148,6 +148,11 @@ public class Http11Processor extends Abs openSocket = false; sendfileInProgress = false; readComplete = true; +if (endpoint.getUsePolling()) { +keptAlive = false;
svn commit: r1165677 - /tomcat/trunk/webapps/docs/config/http.xml
Author: markt Date: Tue Sep 6 14:14:27 2011 New Revision: 1165677 URL: http://svn.apache.org/viewvc?rev=1165677&view=rev Log: Clarify the default connectionTimeout. Add info on setting infinite timeouts. Modified: tomcat/trunk/webapps/docs/config/http.xml Modified: tomcat/trunk/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=1165677&r1=1165676&r2=1165677&view=diff == --- tomcat/trunk/webapps/docs/config/http.xml (original) +++ tomcat/trunk/webapps/docs/config/http.xml Tue Sep 6 14:14:27 2011 @@ -317,7 +317,10 @@ The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be - presented. The default value is 6 (i.e. 60 seconds). + presented. Use a value of -1 to indicate no (i.e. infinite) timeout. + The default value is 6 (i.e. 60 seconds) but note that the standard + server.xml that ships with Tomcat sets this to 2 (i.e. 20 seconds). + @@ -347,7 +350,8 @@ The number of milliseconds this Connector will wait for another HTTP request before closing the connection. The default value is to use the value that has been set for the - connectionTimeout attribute. + connectionTimeout attribute. + Use a value of -1 to indicate no (i.e. infinite) timeout. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1165693 - in /tomcat/trunk/java/org/apache: coyote/http11/AbstractHttp11Processor.java coyote/http11/Http11AprProcessor.java coyote/http11/Http11NioProcessor.java coyote/http11/Http11Proc
Author: markt Date: Tue Sep 6 15:00:02 2011 New Revision: 1165693 URL: http://svn.apache.org/viewvc?rev=1165693&view=rev Log: Aligning the HTTP connectors. Handle request line timeouts consistently Handle upload timeouts more consistently Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.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/tomcat/util/net/AprEndpoint.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=1165693&r1=1165692&r2=1165693&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Sep 6 15:00:02 2011 @@ -96,6 +96,7 @@ public abstract class AbstractHttp11Proc */ protected boolean keptAlive; + /** * Flag that indicates that send file processing is in progress and that the * socket should not be returned to the poller (where a poller is used). @@ -816,6 +817,12 @@ public abstract class AbstractHttp11Proc /** + * Configures the timeout to be used for reading the request line. + */ +protected abstract void setRequestLineReadTimeout() throws IOException; + + +/** * After reading the request headers, we have to setup the request filters. */ protected void prepareRequest() { 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=1165693&r1=1165692&r2=1165693&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Sep 6 15:00:02 2011 @@ -190,8 +190,6 @@ public class Http11AprProcessor extends keptAlive = socketWrapper.isKeptAlive(); } -int soTimeout = endpoint.getSoTimeout(); - if (disableKeepAlive()) { socketWrapper.setKeepAliveLeft(0); } @@ -203,9 +201,8 @@ public class Http11AprProcessor extends // Parsing the request header try { -if( !disableUploadTimeout && keptAlive && soTimeout > 0 ) { -Socket.timeoutSet(socketRef, soTimeout * 1000); -} +setRequestLineReadTimeout(); + if (!inputBuffer.parseRequestLine(keptAlive)) { // This means that no data is available right now // (long keepalive), so that the processor should be recycled @@ -326,6 +323,10 @@ public class Http11AprProcessor extends outputBuffer.nextRequest(); } +if (!disableUploadTimeout) { +Socket.timeoutSet(socketRef, endpoint.getSoTimeout() * 1000); +} + rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); if (breakKeepAliveLoop(socketWrapper)) { @@ -358,6 +359,36 @@ public class Http11AprProcessor extends @Override +protected boolean disableKeepAlive() { +return false; +} + + +@Override +protected void setRequestLineReadTimeout() throws IOException { +// Timeouts while in the poller are handled entirely by the poller +// Only need to be concerned with socket timeouts + +// APR uses simulated blocking so if some request line data is present +// then it must all be presented (with the normal socket timeout). + +// When entering the processing loop for the first time there will +// always be some data to read so the keep-alive timeout is not required + +// For the second and subsequent executions of the processing loop, if +// there is no request line data present then no further data will be +// read from the socket. If there is request line data present then it +// must all be presented (with the normal socket timeout) + +// When the socket is created it is given the correct timeout. +// sendfile may change the timeout but will restore it +// This processor may change the timeout for uploads but will restore it + +// NO-OP +} + + +@Override protected void setCometTimeouts(SocketWrapper socketWrapper) { // NO-OP for APR/native return; @@ -393,12 +424,6 @@ public class Http11AprProcessor extends @Override -protected boolean di
svn commit: r1165721 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Author: markt Date: Tue Sep 6 15:45:08 2011 New Revision: 1165721 URL: http://svn.apache.org/viewvc?rev=1165721&view=rev Log: Connector alignment - request line reading Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.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 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=1165721&r1=1165720&r2=1165721&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Sep 6 15:45:08 2011 @@ -823,6 +823,14 @@ public abstract class AbstractHttp11Proc /** + * Defines how a connector handles an incomplete request line read. + * + * @returns true if the processor should break out of the + * processing loop, otherwise false. + */ +protected abstract boolean handleIncompleteRequestLineRead(); + +/** * After reading the request headers, we have to setup the request filters. */ protected void prepareRequest() { 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=1165721&r1=1165720&r2=1165721&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Sep 6 15:45:08 2011 @@ -204,16 +204,7 @@ public class Http11AprProcessor extends setRequestLineReadTimeout(); if (!inputBuffer.parseRequestLine(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 -openSocket = true; -if (endpoint.isPaused()) { -// 503 - Service unavailable -response.setStatus(503); -adapter.log(request, response, 0); -error = true; -} else { +if (handleIncompleteRequestLineRead()) { break; } } @@ -389,9 +380,26 @@ public class Http11AprProcessor extends @Override +protected boolean handleIncompleteRequestLineRead() { +// This means that no data is available right now +// (long keepalive), so that the processor should be recycled +// and the method should return true +openSocket = true; +if (endpoint.isPaused()) { +// 503 - Service unavailable +response.setStatus(503); +adapter.log(request, response, 0); +error = true; +} else { +return true; +} +return false; +} + + +@Override protected void setCometTimeouts(SocketWrapper socketWrapper) { // NO-OP for APR/native -return; } 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=1165721&r1=1165720&r2=1165721&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Sep 6 15:45:08 2011 @@ -231,27 +231,7 @@ public class Http11NioProcessor extends setRequestLineReadTimeout(); if (!inputBuffer.parseRequestLine(keptAlive)) { -// Haven't finished reading the request so keep the socket -// open -openSocket = true; -// Check to see if we have read any of the request line yet -if (inputBuffer.getParsingRequestLinePhase()<2) { -// No data read, OK to recycle the processor -// Continue to use keep alive timeout -if (keepAliveTimeout>0) { -socketWrapper.setTimeout(keepAliveTimeout); -} -} else { -// Started to read request line. Need to keep processor -// associated with socket -
svn commit: r1165723 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Author: markt Date: Tue Sep 6 15:49:43 2011 New Revision: 1165723 URL: http://svn.apache.org/viewvc?rev=1165723&view=rev Log: Connector alignment - this parameter is ignored with BIO Modified: 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 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=1165723&r1=1165722&r2=1165723&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Sep 6 15:49:43 2011 @@ -208,7 +208,13 @@ public class Http11AprProcessor extends break; } } -if (!endpoint.isPaused()) { + +if (endpoint.isPaused()) { +// 503 - Service unavailable +response.setStatus(503); +adapter.log(request, response, 0); +error = true; +} else { request.setStartTime(System.currentTimeMillis()); keptAlive = true; inputBuffer.parseHeaders(); 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=1165723&r1=1165722&r2=1165723&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Sep 6 15:49:43 2011 @@ -235,7 +235,13 @@ public class Http11NioProcessor extends break; } } -if (!endpoint.isPaused()) { + +if (endpoint.isPaused()) { +// 503 - Service unavailable +response.setStatus(503); +adapter.log(request, response, 0); +error = true; +} else { request.setStartTime(System.currentTimeMillis()); keptAlive = true; if ( !inputBuffer.parseHeaders() ) { 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=1165723&r1=1165722&r2=1165723&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Tue Sep 6 15:49:43 2011 @@ -165,7 +165,7 @@ public class Http11Processor extends Abs try { setRequestLineReadTimeout(); -if (!inputBuffer.parseRequestLine(false)) { +if (!inputBuffer.parseRequestLine(keptAlive)) { if (handleIncompleteRequestLineRead()) { break; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1165728 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Author: markt Date: Tue Sep 6 15:54:51 2011 New Revision: 1165728 URL: http://svn.apache.org/viewvc?rev=1165728&view=rev Log: More connector alignment - request header parsing Modified: 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 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=1165728&r1=1165727&r2=1165728&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Sep 6 15:54:51 2011 @@ -217,7 +217,14 @@ public class Http11AprProcessor extends } else { request.setStartTime(System.currentTimeMillis()); keptAlive = true; -inputBuffer.parseHeaders(); +// Currently only NIO will ever return false here +if (!inputBuffer.parseHeaders()) { +// We've read part of the request, don't recycle it +// instead associate it with the socket +openSocket = true; +readComplete = false; +break; +} if (!disableUploadTimeout) { Socket.timeoutSet(socketRef, connectionUploadTimeout * 1000); 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=1165728&r1=1165727&r2=1165728&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Sep 6 15:54:51 2011 @@ -244,9 +244,10 @@ public class Http11NioProcessor extends } else { request.setStartTime(System.currentTimeMillis()); keptAlive = true; -if ( !inputBuffer.parseHeaders() ) { -//we've read part of the request, don't recycle it -//instead associate it with the socket +// Currently only NIO will ever return false here +if (!inputBuffer.parseHeaders()) { +// We've read part of the request, don't recycle it +// instead associate it with the socket openSocket = true; readComplete = false; break; 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=1165728&r1=1165727&r2=1165728&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Tue Sep 6 15:54:51 2011 @@ -181,7 +181,14 @@ public class Http11Processor extends Abs keptAlive = true; // Reset timeout for reading headers socket.getSocket().setSoTimeout(endpoint.getSoTimeout()); -inputBuffer.parseHeaders(); +// Currently only NIO will ever return false here +if (!inputBuffer.parseHeaders()) { +// We've read part of the request, don't recycle it +// instead associate it with the socket +openSocket = true; +readComplete = false; +break; +} if (!disableUploadTimeout) { socket.getSocket().setSoTimeout(connectionUploadTimeout); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1165730 - /tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
Author: markt Date: Tue Sep 6 15:55:53 2011 New Revision: 1165730 URL: http://svn.apache.org/viewvc?rev=1165730&view=rev Log: Remove unnecessary setting of timeout (will have been correctly set in setRequestLineReadTimeout()) Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java 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=1165730&r1=1165729&r2=1165730&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Tue Sep 6 15:55:53 2011 @@ -179,8 +179,6 @@ public class Http11Processor extends Abs } else { request.setStartTime(System.currentTimeMillis()); keptAlive = true; -// Reset timeout for reading headers -socket.getSocket().setSoTimeout(endpoint.getSoTimeout()); // Currently only NIO will ever return false here if (!inputBuffer.parseHeaders()) { // We've read part of the request, don't recycle it - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 51773] New: lost parameter value
https://issues.apache.org/bugzilla/show_bug.cgi?id=51773 Bug #: 51773 Summary: lost parameter value Product: Tomcat 6 Version: 6.0.33 Platform: PC Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: nine...@sina.com Classification: Unclassified OS & tomcat 64bit public class SetCharacterEncodingFilter implements Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain){ //fix bug //request.getParameterMap(); request.setCharacterEncoding(encoding); //if param test is one character //testValue is "" String testValue = request.getParameter("test"); chain.doFilter(request, response); } -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 51773] lost parameter value
https://issues.apache.org/bugzilla/show_bug.cgi?id=51773 buzidao changed: What|Removed |Added OS/Version||Windows 7 -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r1165738 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Author: markt Date: Tue Sep 6 16:05:29 2011 New Revision: 1165738 URL: http://svn.apache.org/viewvc?rev=1165738&view=rev Log: Align connectors - setting timeouts Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.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 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=1165738&r1=1165737&r2=1165738&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Sep 6 16:05:29 2011 @@ -830,6 +830,13 @@ public abstract class AbstractHttp11Proc */ protected abstract boolean handleIncompleteRequestLineRead(); + +/** + * Set the socket timeout. + */ +protected abstract void setSocketTimeout(int timeout) throws IOException; + + /** * After reading the request headers, we have to setup the request filters. */ 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=1165738&r1=1165737&r2=1165738&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Sep 6 16:05:29 2011 @@ -194,8 +194,6 @@ public class Http11AprProcessor extends socketWrapper.setKeepAliveLeft(0); } -long socketRef = socketWrapper.getSocket().longValue(); - while (!error && keepAlive && !comet && !isAsync() && !endpoint.isPaused()) { @@ -226,8 +224,7 @@ public class Http11AprProcessor extends break; } if (!disableUploadTimeout) { -Socket.timeoutSet(socketRef, -connectionUploadTimeout * 1000); +setSocketTimeout(connectionUploadTimeout); } } } catch (IOException e) { @@ -328,7 +325,7 @@ public class Http11AprProcessor extends } if (!disableUploadTimeout) { -Socket.timeoutSet(socketRef, endpoint.getSoTimeout() * 1000); +setSocketTimeout(endpoint.getSoTimeout()); } rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); @@ -411,6 +408,12 @@ public class Http11AprProcessor extends @Override +protected void setSocketTimeout(int timeout) { +Socket.timeoutSet(socket.getSocket().longValue(), timeout * 1000); +} + + +@Override protected void setCometTimeouts(SocketWrapper socketWrapper) { // NO-OP for APR/native } 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=1165738&r1=1165737&r2=1165738&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Sep 6 16:05:29 2011 @@ -252,9 +252,8 @@ public class Http11NioProcessor extends readComplete = false; break; } -if (!disableUploadTimeout) { //only for body, not for request headers - socketWrapper.getSocket().getIOChannel().socket().setSoTimeout( -connectionUploadTimeout); +if (!disableUploadTimeout) { +setSocketTimeout(connectionUploadTimeout); } } } catch (IOException e) { @@ -354,9 +353,8 @@ public class Http11NioProcessor extends outputBuffer.nextRequest(); } -if (!disableUploadTimeout) { //only for body, not for request headers -socketWrapper.getSocket().getIOChannel().socket().setSoTimeout( -endpoint.getSoTimeout()); +if (!disableUploadTimeout) { +setSocketTimeout(endpoint.getSoTimeout()); } rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); @@ -447,6 +445,12 @@ public class Http11NioProcessor extends @Override +protected void setSocketTimeout(int timeout) thr
svn commit: r1165746 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Author: markt Date: Tue Sep 6 16:16:28 2011 New Revision: 1165746 URL: http://svn.apache.org/viewvc?rev=1165746&view=rev Log: Connector alignment - final tweaks to the process method Modified: 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 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=1165746&r1=1165745&r2=1165746&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Sep 6 16:16:28 2011 @@ -172,7 +172,7 @@ public class Http11AprProcessor extends RequestInfo rp = request.getRequestProcessor(); rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); -// Setting up the socket +// Setting up the I/O this.socket = socketWrapper; inputBuffer.init(socketWrapper, endpoint); outputBuffer.init(socketWrapper, endpoint); @@ -318,8 +318,7 @@ public class Http11AprProcessor extends } request.updateCounters(); -if (!comet && !isAsync()) { -// Next request +if (!isAsync() && !comet || error) { inputBuffer.nextRequest(); outputBuffer.nextRequest(); } @@ -339,7 +338,7 @@ public class Http11AprProcessor extends if (error || endpoint.isPaused()) { return SocketState.CLOSED; -} else if (comet || isAsync()) { +} else if (comet || isAsync()) { return SocketState.LONG; } else { if (sendfileInProgress) { 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=1165746&r1=1165745&r2=1165746&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Sep 6 16:16:28 2011 @@ -201,7 +201,7 @@ public class Http11NioProcessor extends RequestInfo rp = request.getRequestProcessor(); rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); -// Setting up the socket +// Setting up the I/O this.socket = socketWrapper; inputBuffer.init(socketWrapper, endpoint); outputBuffer.init(socketWrapper, endpoint); @@ -329,7 +329,7 @@ public class Http11NioProcessor extends rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT); if (!isAsync() && !comet) { -if(error) { +if (error) { // If we know we are closing the connection, don't drain // input. This way uploading a 100GB file doesn't tie up the // thread if the servlet has rejected it. @@ -347,8 +347,7 @@ public class Http11NioProcessor extends } request.updateCounters(); -if (!comet && !isAsync()) { -// Next request +if (!isAsync() && !comet || error) { inputBuffer.nextRequest(); outputBuffer.nextRequest(); } 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=1165746&r1=1165745&r2=1165746&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Tue Sep 6 16:16:28 2011 @@ -263,7 +263,7 @@ public class Http11Processor extends Abs // Finish the handling of the request rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT); -if(!isAsync() && !comet) { +if (!isAsync() && !comet) { if (error) { // If we know we are closing the connection, don't drain // input. This way uploading a 100GB file doesn't tie up the @@ -282,8 +282,7 @@ public class Http11Processor extends Abs } request.updateCounters(); -// Next request -if (!isAsync() || error) { +if (!isAsync() && !comet || error) { inputBuffer.nextRequest(); outputBuffer.nextRequest(); } - To unsubscribe, e-mail: dev-uns
svn commit: r1165765 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11Processor.java
Author: markt Date: Tue Sep 6 17:35:39 2011 New Revision: 1165765 URL: http://svn.apache.org/viewvc?rev=1165765&view=rev Log: Fix keep-alive broken by refactoring Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java 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=1165765&r1=1165764&r2=1165765&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Sep 6 17:35:39 2011 @@ -420,6 +420,7 @@ public class Http11AprProcessor extends @Override protected boolean breakKeepAliveLoop(SocketWrapper socketWrapper) { +openSocket = true; // Do sendfile as needed: add socket to sendfile and end if (sendfileData != null && !error) { sendfileData.socket = socketWrapper.getSocket().longValue(); 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=1165765&r1=1165764&r2=1165765&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Tue Sep 6 17:35:39 2011 @@ -409,6 +409,7 @@ public class Http11Processor extends Abs @Override protected boolean breakKeepAliveLoop(SocketWrapper socketWrapper) { +openSocket = true; // If we don't have a pipe-lined request allow this thread to be // used by another connection if (inputBuffer.lastValid == 0) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1165777 - /tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
Author: markt Date: Tue Sep 6 18:39:41 2011 New Revision: 1165777 URL: http://svn.apache.org/viewvc?rev=1165777&view=rev Log: Fix timeouts broken by refactoring Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 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=1165777&r1=1165776&r2=1165777&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Sep 6 18:39:41 2011 @@ -420,16 +420,16 @@ public class Http11NioProcessor extends // open openSocket = true; // Check to see if we have read any of the request line yet -if (inputBuffer.getParsingRequestLinePhase()<2) { -// No data read, OK to recycle the processor -// Continue to use keep alive timeout -if (keepAliveTimeout>0) { -socket.setTimeout(keepAliveTimeout); -} +if (inputBuffer.getParsingRequestLinePhase() < 2) { +// Haven't read the request line. Must be keep-alive +// Make sure poller uses keepAlive from here onwards +socket.setTimeout(endpoint.getKeepAliveTimeout()); } else { // Started to read request line. Need to keep processor // associated with socket readComplete = false; +// Make sure poller uses soTimeout from here onwards +socket.setTimeout(endpoint.getSoTimeout()); } if (endpoint.isPaused()) { // 503 - Service unavailable - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 51773] lost parameter value
https://issues.apache.org/bugzilla/show_bug.cgi?id=51773 Christopher Schultz changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID OS/Version||All --- Comment #1 from Christopher Schultz 2011-09-06 19:40:58 UTC --- Bugzilla is not a support forum. Please post to the Tomcat users' list. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 51769] False positive: Somebody try to hack into the site!!!
https://issues.apache.org/bugzilla/show_bug.cgi?id=51769 --- Comment #1 from Christopher Schultz 2011-09-06 20:17:01 UTC --- Looks like jk_isapi_plugin.c::uri_is_web_inf is a little too liberal with it's check: static int uri_is_web_inf(const char *uri) { if (stristr(uri, "/web-inf")) { return JK_TRUE; } if (stristr(uri, "/meta-inf")) { return JK_TRUE; } return JK_FALSE; } Might make sense to check to see if the uri either ends with either of those two strings or explicitly has a "/" after either of them. Obviously, requesting "/anything/meta-info-for-my-application" would cause a failure, here. I can confirm that mod_jk does not enforce such checks, because without Allow/Deny, httpd will serve content out of WEB-INF and META-INF directories if an Alias is set up to point to the deployment directory. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r1165918 - in /tomcat/trunk/java/org/apache: coyote/http11/Http11NioProcessor.java coyote/http11/Http11Processor.java tomcat/util/net/AbstractEndpoint.java tomcat/util/net/AprEndpoint.java
Author: markt Date: Tue Sep 6 22:56:40 2011 New Revision: 1165918 URL: http://svn.apache.org/viewvc?rev=1165918&view=rev Log: Handle infinite timeouts for both soTimeout and keepAliveTimeout Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java 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=1165918&r1=1165917&r2=1165918&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Sep 6 22:56:40 2011 @@ -137,7 +137,7 @@ public class Http11NioProcessor extends if (comettimeout != null) attach.setTimeout(comettimeout.longValue()); } else { //reset the timeout -if (keepAlive && keepAliveTimeout>0) { +if (keepAlive) { attach.setTimeout(keepAliveTimeout); } else { attach.setTimeout(soTimeout); @@ -177,7 +177,7 @@ public class Http11NioProcessor extends long soTimeout = endpoint.getSoTimeout(); //reset the timeout -if (keepAlive && keepAliveTimeout>0) { +if (keepAlive) { attach.setTimeout(keepAliveTimeout); } else { attach.setTimeout(soTimeout); @@ -421,9 +421,11 @@ public class Http11NioProcessor extends openSocket = true; // Check to see if we have read any of the request line yet if (inputBuffer.getParsingRequestLinePhase() < 2) { -// Haven't read the request line. Must be keep-alive -// Make sure poller uses keepAlive from here onwards -socket.setTimeout(endpoint.getKeepAliveTimeout()); +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. +socket.setTimeout(endpoint.getKeepAliveTimeout()); +} } else { // Started to read request line. Need to keep processor // associated with socket 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=1165918&r1=1165917&r2=1165918&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Tue Sep 6 22:56:40 2011 @@ -345,15 +345,6 @@ public class Http11Processor extends Abs @Override protected void setRequestLineReadTimeout() throws IOException { -int standardTimeout = 0; - -if (keptAlive) { -if (keepAliveTimeout > 0) { -standardTimeout = keepAliveTimeout; -} else if (endpoint.getSoTimeout() > 0) { -standardTimeout = endpoint.getSoTimeout(); -} -} /* * When there is no data in the buffer and this is not the first * request on this connection and timeouts are being used the @@ -363,19 +354,23 @@ public class Http11Processor extends Abs * This is a little hacky but better than exposing the socket * and the timeout info to the InputBuffer */ -if (inputBuffer.lastValid == 0 && socket.getLastAccess() > -1 && -standardTimeout > 0) { - -long queueTime = System.currentTimeMillis() - socket.getLastAccess(); +if (inputBuffer.lastValid == 0 && socket.getLastAccess() > -1) { int firstReadTimeout; -if (queueTime >= standardTimeout) { -// Queued for longer than timeout but there might be -// data so use shortest possible timeout -firstReadTimeout = 1; +if (keepAliveTimeout == -1) { +firstReadTimeout = 0; } else { -// Cast is safe since queueTime must be less than -// standardTimeout which is an int -firstReadTimeout = standardTimeout - (int) queueTime; +long queueTime = +System.currentTimeMillis() - socket.getLastAccess(); + +if (queueTime >= keepAliveTimeo
svn commit: r1165921 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Author: markt Date: Tue Sep 6 23:07:00 2011 New Revision: 1165921 URL: http://svn.apache.org/viewvc?rev=1165921&view=rev Log: Pull up the process() method Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.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 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=1165921&r1=1165920&r2=1165921&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Sep 6 23:07:00 2011 @@ -638,6 +638,12 @@ public abstract class AbstractHttp11Proc status == 501 /* SC_NOT_IMPLEMENTED */; } + +/** + * Allows the super class to set the socket wrapper being used. + */ +protected abstract void setSocketWrapper(SocketWrapper socketWrapper); + /** * Exposes input buffer to super class to allow better code re-use. @@ -838,6 +844,211 @@ public abstract class AbstractHttp11Proc /** + * Process pipelined HTTP requests using the specified input and output + * streams. + * + * @param socketWrapper Socket from which the HTTP requests will be read + * and the HTTP responses will be written. + * + * @throws IOException error during an I/O operation + */ +@Override +public SocketState process(SocketWrapper socketWrapper) +throws IOException { +RequestInfo rp = request.getRequestProcessor(); +rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); + +// Setting up the I/O +setSocketWrapper(socketWrapper); +getInputBuffer().init(socketWrapper, endpoint); +getOutputBuffer().init(socketWrapper, endpoint); + +// Flags +error = false; +keepAlive = true; +comet = false; +openSocket = false; +sendfileInProgress = false; +readComplete = true; +if (endpoint.getUsePolling()) { +keptAlive = false; +} else { +keptAlive = socketWrapper.isKeptAlive(); +} + +if (disableKeepAlive()) { +socketWrapper.setKeepAliveLeft(0); +} + +while (!error && keepAlive && !comet && !isAsync() && +!endpoint.isPaused()) { + +// Parsing the request header +try { +setRequestLineReadTimeout(); + +if (!getInputBuffer().parseRequestLine(keptAlive)) { +if (handleIncompleteRequestLineRead()) { +break; +} +} + +if (endpoint.isPaused()) { +// 503 - Service unavailable +response.setStatus(503); +adapter.log(request, response, 0); +error = true; +} else { +request.setStartTime(System.currentTimeMillis()); +keptAlive = true; +// Currently only NIO will ever return false here +if (!getInputBuffer().parseHeaders()) { +// We've read part of the request, don't recycle it +// instead associate it with the socket +openSocket = true; +readComplete = false; +break; +} +if (!disableUploadTimeout) { +setSocketTimeout(connectionUploadTimeout); +} +} +} catch (IOException e) { +if (getLog().isDebugEnabled()) { +getLog().debug( +sm.getString("http11processor.header.parse"), e); +} +error = true; +break; +} catch (Throwable t) { +ExceptionUtils.handleThrowable(t); +if (getLog().isDebugEnabled()) { +getLog().debug( +sm.getString("http11processor.header.parse"), t); +} +// 400 - Bad Request +response.setStatus(400); +adapter.log(request, response, 0); +error = true; +} + +if (!error) { +// Setting up filters, and parse some request headers +rp.setStage(org.apache.coyote.Constants.STAGE_PREPARE); +try { +prepareRequest(); +} catch (Throwable t) { +
DO NOT REPLY [Bug 51181] Add support for Web Sockets
https://issues.apache.org/bugzilla/show_bug.cgi?id=51181 --- Comment #13 from Mark Thomas 2011-09-06 23:15:59 UTC --- It might appear that there hasn't been much progress on this but there has been a lot going on behind the scenes. 1. The HTTP connectors have been refactored to reduce duplication and inconsistenceies between them that should make it possible to implement WebSockets once for all three HTTP connectors rather than once for each connector. This was long overdue and it took rather a long time to unpick the various differences that had crept in over the years. 2. I took a look at a SocketIO implementation and I have some initial code but the API doesn't translate that easily (at least I found it didn't) from JavaScript to Java. Therefore I'm not convinced at the moment that this is the right direction to go in. What would be very useful at this point is an idea of the API users would like to work with. I can make something up but it would be much better if this was user driven. Proposals can be attached to this Bugzilla issue. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 51774] New: java.lang.NoSuchMethodException thrown when starting tomcat with security enabled and "tracking-mode" used in web.xml
https://issues.apache.org/bugzilla/show_bug.cgi?id=51774 Bug #: 51774 Summary: java.lang.NoSuchMethodException thrown when starting tomcat with security enabled and "tracking-mode" used in web.xml Product: Tomcat 7 Version: 7.0.19 Platform: PC Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: you...@gmail.com Classification: Unclassified When starting my application with security enabled I get the exception below if I have the following in my web.xml. COOKIE If I remove the "tracking-mode" element then I don't get the exception. Mike [11/09/06 19:01:19:758] 0001 Sv HostConfig: Error deploying configuration descriptor stack-pet-store-ui.xml java.lang.RuntimeException: org.apache.catalina.core.ApplicationContext.setSessionTrackingModes(java.util.EnumSet) at org.apache.catalina.core.ApplicationContextFacade.doPrivileged(ApplicationContextFacade.java:769) at org.apache.catalina.core.ApplicationContextFacade.setSessionTrackingModes(ApplicationContextFacade.java:608) at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1324) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1343) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:896) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:322) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:121) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:144) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:133) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:379) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:324) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.startup.Catalina.start(Catalina.java:621) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450) Caused by: java.lang.NoSuchMethodException: org.apache.catalina.core.ApplicationContext.setSessionTrackingModes(java.util.EnumSet) at java.lang.Class.getMethod(Class.java:1622) at org.apache.catalina.core.ApplicationContextFacade.invokeMethod(ApplicationContextFacade.java:790) at org.apache.catalina.core.ApplicationContextFacade.doPrivileged(ApplicationContextFacade.java:767) ... 42 more -- Configure bugmail: