JBossWeb SVN: r2516 - branches/7.5.x/src/main/java/org/apache/tomcat/websocket.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-06 10:51:59 -0400 (Mon, 06 Oct 2014)
New Revision: 2516
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
Log:
Port patch for a fragmentation issue.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2014-10-06 14:51:07 UTC (rev 2515)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2014-10-06 14:51:59 UTC (rev 2516)
@@ -548,6 +548,9 @@
boolean readHeaders = false;
String line = null;
while (!readHeaders) {
+ // On entering loop buffer will be empty and at the start of a new
+ // loop the buffer will have been fully read.
+ response.clear();
// Blocking read
Future<Integer> read = channel.read(response);
Integer bytesRead = read.get(timeout, TimeUnit.MILLISECONDS);
10 years, 2 months
JBossWeb SVN: r2515 - branches/7.5.x.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-06 10:51:07 -0400 (Mon, 06 Oct 2014)
New Revision: 2515
Modified:
branches/7.5.x/pom.xml
Log:
New beta2 build.
Modified: branches/7.5.x/pom.xml
===================================================================
--- branches/7.5.x/pom.xml 2014-10-03 15:06:41 UTC (rev 2514)
+++ branches/7.5.x/pom.xml 2014-10-06 14:51:07 UTC (rev 2515)
@@ -33,7 +33,7 @@
<groupId>org.jboss.web</groupId>
<artifactId>jbossweb</artifactId>
- <version>7.5.0.Beta1</version>
+ <version>7.5.0.Beta2</version>
<name>JBoss Web</name>
<description>Servlet 3.0 container</description>
10 years, 2 months
JBossWeb SVN: r2514 - in branches/7.5.x/src/main/java/org/apache: jasper/compiler and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-03 11:06:41 -0400 (Fri, 03 Oct 2014)
New Revision: 2514
Modified:
branches/7.5.x/src/main/java/org/apache/catalina/startup/ContextConfig.java
branches/7.5.x/src/main/java/org/apache/jasper/compiler/JDTCompiler.java
branches/7.5.x/src/main/java/org/apache/tomcat/util/http/HttpMessages.java
Log:
BZ1149211: Close some IS, submitted by Radim Hatlapatka.
Modified: branches/7.5.x/src/main/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/startup/ContextConfig.java 2014-10-03 14:57:36 UTC (rev 2513)
+++ branches/7.5.x/src/main/java/org/apache/catalina/startup/ContextConfig.java 2014-10-03 15:06:41 UTC (rev 2514)
@@ -87,8 +87,9 @@
static {
// Load our mapping properties
authenticators = new Properties();
+ InputStream is = null;
try {
- InputStream is = ContextConfig.class.getClassLoader().getResourceAsStream("org/apache/catalina/startup/Authenticators.properties");
+ is = ContextConfig.class.getClassLoader().getResourceAsStream("org/apache/catalina/startup/Authenticators.properties");
if (is != null) {
authenticators.load(is);
} else {
@@ -96,6 +97,14 @@
}
} catch (IOException e) {
CatalinaLogger.STARTUP_LOGGER.failedLoadingAuthenticatoMappings(e);
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
}
}
Modified: branches/7.5.x/src/main/java/org/apache/jasper/compiler/JDTCompiler.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/jasper/compiler/JDTCompiler.java 2014-10-03 14:57:36 UTC (rev 2513)
+++ branches/7.5.x/src/main/java/org/apache/jasper/compiler/JDTCompiler.java 2014-10-03 15:06:41 UTC (rev 2514)
@@ -242,8 +242,18 @@
return false;
}
String resourceName = result.replace('.', '/') + ".class";
- InputStream is =
- classLoader.getResourceAsStream(resourceName);
+ InputStream is = null;
+ try {
+ is = classLoader.getResourceAsStream(resourceName);
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ }
return is == null;
}
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/util/http/HttpMessages.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/util/http/HttpMessages.java 2014-10-03 14:57:36 UTC (rev 2513)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/util/http/HttpMessages.java 2014-10-03 15:06:41 UTC (rev 2514)
@@ -17,6 +17,7 @@
package org.apache.tomcat.util.http;
+import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
@@ -36,11 +37,20 @@
protected static Properties statusMessages = new Properties();
static {
+ InputStream is = null;
try {
- InputStream is = HttpMessages.class.getClassLoader().getResourceAsStream("org/apache/tomcat/util/http/HttpMessages.properties");
+ is = HttpMessages.class.getClassLoader().getResourceAsStream("org/apache/tomcat/util/http/HttpMessages.properties");
statusMessages.load(is);
} catch (Exception e) {
CoyoteLogger.HTTP_LOGGER.errorLoadingMessages(e);
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
}
}
10 years, 2 months
JBossWeb SVN: r2513 - branches/7.5.x/src/main/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-03 10:57:36 -0400 (Fri, 03 Oct 2014)
New Revision: 2513
Modified:
branches/7.5.x/src/main/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
Log:
Add a sync and use remaining() instead of something more convoluted which could fail.
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/InternalNioOutputBuffer.java 2014-10-01 11:58:54 UTC (rev 2512)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/InternalNioOutputBuffer.java 2014-10-03 14:57:36 UTC (rev 2513)
@@ -867,26 +867,26 @@
if (leftover.getLength() > Constants.ASYNC_BUFFER_SIZE) {
response.setLastWrite(0);
}
- }
- if (semaphore.tryAcquire()) {
- // Calculate the number of bytes that fit in the buffer
- int n = Math.min(leftover.getLength(), bbuf.capacity() - bbuf.position());
- bbuf.put(leftover.getBuffer(), leftover.getOffset(), n).flip();
- leftover.setOffset(leftover.getOffset() + n);
- boolean writeNotification = processor.getWriteNotification();
- processor.setWriteNotification(false);
- try {
- channel.write(bbuf, writeTimeout, TimeUnit.MILLISECONDS, channel, completionHandler);
- } catch (Exception e) {
- processor.getResponse().setErrorException(e);
- if (CoyoteLogger.HTTP_LOGGER.isDebugEnabled()) {
- CoyoteLogger.HTTP_LOGGER.errorWithNonBlockingWrite(e);
+ if (semaphore.tryAcquire()) {
+ // Calculate the number of bytes that fit in the buffer
+ int n = Math.min(leftover.getLength(), bbuf.remaining());
+ bbuf.put(leftover.getBuffer(), leftover.getOffset(), n).flip();
+ leftover.setOffset(leftover.getOffset() + n);
+ boolean writeNotification = processor.getWriteNotification();
+ processor.setWriteNotification(false);
+ try {
+ channel.write(bbuf, writeTimeout, TimeUnit.MILLISECONDS, channel, completionHandler);
+ } catch (Exception e) {
+ processor.getResponse().setErrorException(e);
+ if (CoyoteLogger.HTTP_LOGGER.isDebugEnabled()) {
+ CoyoteLogger.HTTP_LOGGER.errorWithNonBlockingWrite(e);
+ }
}
- }
- if (semaphore.availablePermits() == 0) {
- // Write did not complete inline, possible write notification
- if (writeNotification) {
- processor.setWriteNotification(true);
+ if (semaphore.availablePermits() == 0) {
+ // Write did not complete inline, possible write notification
+ if (writeNotification) {
+ processor.setWriteNotification(true);
+ }
}
}
}
10 years, 2 months
JBossWeb SVN: r2512 - branches/7.5.x/src/main/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2014-10-01 07:58:54 -0400 (Wed, 01 Oct 2014)
New Revision: 2512
Modified:
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AbstractProcessor.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AbstractProtocol.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java
branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Protocol.java
Log:
BZ1059511: Refix since the flag initial value should be on the protocol.
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AbstractProcessor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AbstractProcessor.java 2014-09-29 15:13:58 UTC (rev 2511)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AbstractProcessor.java 2014-10-01 11:58:54 UTC (rev 2512)
@@ -152,7 +152,7 @@
/**
* Flag to disable setting a different time-out on uploads.
*/
- protected boolean disableUploadTimeout = Constants.DEFAULT_DISABLE_UPLOAD_TIMEOUT;
+ protected boolean disableUploadTimeout = true;
/**
* Allowed compression level.
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AbstractProtocol.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AbstractProtocol.java 2014-09-29 15:13:58 UTC (rev 2511)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AbstractProtocol.java 2014-10-01 11:58:54 UTC (rev 2512)
@@ -77,7 +77,7 @@
* If true, the regular socket timeout will be used for the full duration of
* the connection.
*/
- protected boolean disableUploadTimeout = true;
+ protected boolean disableUploadTimeout = Constants.DEFAULT_DISABLE_UPLOAD_TIMEOUT;
/**
* Integrated compression support.
*/
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java 2014-09-29 15:13:58 UTC (rev 2511)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java 2014-10-01 11:58:54 UTC (rev 2512)
@@ -252,7 +252,7 @@
/**
* Flag to disable setting a different time-out on uploads.
*/
- protected boolean disableUploadTimeout = Constants.DEFAULT_DISABLE_UPLOAD_TIMEOUT;
+ protected boolean disableUploadTimeout = true;
/**
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java 2014-09-29 15:13:58 UTC (rev 2511)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java 2014-10-01 11:58:54 UTC (rev 2512)
@@ -316,7 +316,7 @@
* If true, the regular socket timeout will be used for the full duration
* of the connection.
*/
- protected boolean disableUploadTimeout = true;
+ protected boolean disableUploadTimeout = Constants.DEFAULT_DISABLE_UPLOAD_TIMEOUT;
public boolean getDisableUploadTimeout() { return disableUploadTimeout; }
public void setDisableUploadTimeout(boolean isDisabled) { disableUploadTimeout = isDisabled; }
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java 2014-09-29 15:13:58 UTC (rev 2511)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Processor.java 2014-10-01 11:58:54 UTC (rev 2512)
@@ -234,7 +234,7 @@
/**
* Flag to disable setting a different time-out on uploads.
*/
- protected boolean disableUploadTimeout = Constants.DEFAULT_DISABLE_UPLOAD_TIMEOUT;
+ protected boolean disableUploadTimeout = true;
/**
Modified: branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Protocol.java 2014-09-29 15:13:58 UTC (rev 2511)
+++ branches/7.5.x/src/main/java/org/apache/coyote/http11/Http11Protocol.java 2014-10-01 11:58:54 UTC (rev 2512)
@@ -373,7 +373,7 @@
* If true, the regular socket timeout will be used for the full duration
* of the connection.
*/
- protected boolean disableUploadTimeout = true;
+ protected boolean disableUploadTimeout = Constants.DEFAULT_DISABLE_UPLOAD_TIMEOUT;
public boolean getDisableUploadTimeout() { return disableUploadTimeout; }
public void setDisableUploadTimeout(boolean isDisabled) { disableUploadTimeout = isDisabled; }
10 years, 2 months