Author: markt Date: Thu Mar 15 22:47:40 2012 New Revision: 1301255 URL: http://svn.apache.org/viewvc?rev=1301255&view=rev Log: Backport use of constants
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CometEventImpl.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/DefaultServlet.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/AccessLogValve.java tomcat/tc7.0.x/trunk/java/org/apache/coyote/Constants.java tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Mar 15 22:47:40 2012 @@ -1 +1 @@ -/tomcat/trunk:1156115-1157160,1157162-1157859,1157862-1157942,1157945-1160347,1160349-1163716,1163718-1166689,1166691-1174340,1174342-1175596,1175598-1175611,1175613-1175932,1175934-1177783,1177785-1177980,1178006-1180720,1180722-1183094,1183096-1187753,1187755,1187775,1187801,1187806,1187809,1187826-1188312,1188314-1188401,1188646-1188840,1188842-1190176,1190178-1195223,1195225-1195953,1195955,1195957-1201238,1201240-1203345,1203347-1206623,1206625-1208046,1208073,1208096,1208114,1208145,1208772,1209194-1212125,1212127-1220291,1220293,1220295-1221321,1221323-1222328,1222332-1222401,1222405-1222795,1222850-1222950,1222969-1225326,1225328-1225463,1225465,1225627,1225629-1226534,1226536-1228908,1228911-1228923,1228927-1229532,1229534-1230766,1230768-1231625,1231627-1233414,1233419-1235207,1235209-1237425,1237427,1237429-1237977,1237981,1237985,1238070,1238073,1239024-1239048,1239050-1239062,1239135,1239483,1239485,1240101,1240106,1240109,1240112,1240114,1240116,1240118,1240121 ,1240329,1240697,1240795,1240821,1240842,1240857,1241087,1241160,1241908-1241909,1241982,1242099,1242110,1242371,1242434,1242495,1242947,1243034,1243038,1244302,1244511,1244567,1244718-1244719,1244935-1244938,1245274,1245449,1245849,1290875,1292334,1292338,1292345-1292347,1293155,1293831-1293832,1295998,1296284,1297014-1297015,1297017,1297158,1297177,1297202,1297209,1297213,1297717,1297722,1297729,1297768,1297778,1297818,1297828,1297979,1297987,1298121,1298140,1298590,1298592,1298628-1298629,1298794,1298983-1298984,1299020,1299034,1299819,1300154-1300155,1300569,1300948 +/tomcat/trunk:1156115-1157160,1157162-1157859,1157862-1157942,1157945-1160347,1160349-1163716,1163718-1166689,1166691-1174340,1174342-1175596,1175598-1175611,1175613-1175932,1175934-1177783,1177785-1177980,1178006-1180720,1180722-1183094,1183096-1187753,1187755,1187775,1187801,1187806,1187809,1187826-1188312,1188314-1188401,1188646-1188840,1188842-1190176,1190178-1195223,1195225-1195953,1195955,1195957-1201238,1201240-1203345,1203347-1206623,1206625-1208046,1208073,1208096,1208114,1208145,1208772,1209194-1212125,1212127-1220291,1220293,1220295-1221321,1221323-1222328,1222332-1222401,1222405-1222795,1222850-1222950,1222969-1225326,1225328-1225463,1225465,1225627,1225629-1226534,1226536-1228908,1228911-1228923,1228927-1229532,1229534-1230766,1230768-1231625,1231627-1233414,1233419-1235207,1235209-1237425,1237427,1237429-1237977,1237981,1237985,1238070,1238073,1239024-1239048,1239050-1239062,1239135,1239256,1239258-1239485,1240101,1240106,1240109,1240112,1240114,1240116,1240118 ,1240121,1240329,1240697,1240795,1240821,1240842,1240857,1241087,1241160,1241908-1241909,1241982,1242099,1242110,1242371,1242434,1242495,1242947,1243034,1243038,1244302,1244511,1244567,1244718-1244719,1244935-1244938,1245274,1245449,1245849,1290875,1292334,1292338,1292345-1292347,1293155,1293831-1293832,1295998,1296284,1297014-1297015,1297017,1297158,1297177,1297202,1297209,1297213,1297717,1297722,1297729,1297768,1297778,1297818,1297828,1297979,1297987,1298121,1298140,1298590,1298592,1298628-1298629,1298794,1298983-1298984,1299020,1299034,1299819,1300154-1300155,1300569,1300948 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java Thu Mar 15 22:47:40 2012 @@ -169,7 +169,9 @@ public final class Globals { * All request attributes which names start with this prefix are used by * connector implementations. They are passed down to coyoteRequest and back * up. See <code>Request.setAttribute(String, Object)</code>. + * @deprecated Unused. Will be removed in Tomcat 8.0.x. */ + @Deprecated public static final String TOMCAT_CONNECTOR_ATTR_PREFIX = "org.apache.tomcat."; @@ -177,9 +179,10 @@ public final class Globals { /** * The request attribute that is set to the value of {@code Boolean.TRUE} * if connector processing this request supports Comet API. + * Duplicated here for neater code in the catalina packages. */ public static final String COMET_SUPPORTED_ATTR = - "org.apache.tomcat.comet.support"; + org.apache.coyote.Constants.COMET_SUPPORTED_ATTR; /** @@ -188,9 +191,11 @@ public final class Globals { * per-connection request timeout through Comet API. * * @see org.apache.catalina.comet.CometEvent#setTimeout(int) + * + * Duplicated here for neater code in the catalina packages. */ public static final String COMET_TIMEOUT_SUPPORTED_ATTR = - "org.apache.tomcat.comet.timeout.support"; + org.apache.coyote.Constants.COMET_TIMEOUT_SUPPORTED_ATTR; /** @@ -199,17 +204,21 @@ public final class Globals { * timeout for Comet API. The value is in milliseconds. * * @see org.apache.catalina.comet.CometEvent#setTimeout(int) + * + * Duplicated here for neater code in the catalina packages. */ public static final String COMET_TIMEOUT_ATTR = - "org.apache.tomcat.comet.timeout"; + org.apache.coyote.Constants.COMET_TIMEOUT_ATTR; /** * The request attribute that is set to the value of {@code Boolean.TRUE} * if connector processing this request supports use of sendfile. + * + * Duplicated here for neater code in the catalina packages. */ public static final String SENDFILE_SUPPORTED_ATTR = - "org.apache.tomcat.sendfile.support"; + org.apache.coyote.Constants.SENDFILE_SUPPORTED_ATTR; /** @@ -217,9 +226,11 @@ public final class Globals { * to the connector the name of the file that is to be served * by sendfile. The value should be {@code java.lang.String} * that is {@code File.getCanonicalPath()} of the file to be served. + * + * Duplicated here for neater code in the catalina packages. */ public static final String SENDFILE_FILENAME_ATTR = - "org.apache.tomcat.sendfile.filename"; + org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR; /** @@ -228,9 +239,11 @@ public final class Globals { * that is to be served by sendfile. The value should be * {@code java.lang.Long}. To serve complete file * the value should be {@code Long.valueOf(0)}. + * + * Duplicated here for neater code in the catalina packages. */ public static final String SENDFILE_FILE_START_ATTR = - "org.apache.tomcat.sendfile.start"; + org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR; /** @@ -239,9 +252,11 @@ public final class Globals { * of a file that is to be served by sendfile. The value should be * {@code java.lang.Long}. To serve complete file * the value should be equal to the length of the file. + * + * Duplicated here for neater code in the catalina packages. */ public static final String SENDFILE_FILE_END_ATTR = - "org.apache.tomcat.sendfile.end"; + org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR; /** Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CometEventImpl.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CometEventImpl.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CometEventImpl.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CometEventImpl.java Thu Mar 15 22:47:40 2012 @@ -22,6 +22,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.catalina.Globals; import org.apache.catalina.comet.CometEvent; import org.apache.tomcat.util.res.StringManager; @@ -121,8 +122,10 @@ public class CometEventImpl implements C @Override public void setTimeout(int timeout) throws IOException, ServletException, UnsupportedOperationException { - if (request.getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE) { - request.setAttribute("org.apache.tomcat.comet.timeout", Integer.valueOf(timeout)); + if (request.getAttribute(Globals.COMET_TIMEOUT_SUPPORTED_ATTR) == + Boolean.TRUE) { + request.setAttribute(Globals.COMET_TIMEOUT_ATTR, + Integer.valueOf(timeout)); if (request.isComet()) { request.setCometTimeout(timeout); } Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java Thu Mar 15 22:47:40 2012 @@ -1008,9 +1008,9 @@ public class Request * The underlying connector may also expose request attributes. These all * have names starting with "org.apache.tomcat" and include: * <ul> - * <li>org.apache.tomcat.sendfile.support</li> - * <li>org.apache.tomcat.comet.support</li> - * <li>org.apache.tomcat.comet.timeout.support</li> + * <li>{@link Globals#SENDFILE_SUPPORTED_ATTR}</li> + * <li>{@link Globals#COMET_SUPPORTED_ATTR}</li> + * <li>{@link Globals#COMET_TIMEOUT_SUPPORTED_ATTR}</li> * </ul> * Connector implementations may return some, all or none of these * attributes and may also support additional attributes. @@ -1515,7 +1515,7 @@ public class Request // Do the security check before any updates are made if (Globals.IS_SECURITY_ENABLED && - name.equals("org.apache.tomcat.sendfile.filename")) { + name.equals(Globals.SENDFILE_FILENAME_ATTR)) { // Use the canonical file name to avoid any possible symlink and // relative path issues String canonicalPath; Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java Thu Mar 15 22:47:40 2012 @@ -29,6 +29,7 @@ import javax.servlet.UnavailableExceptio import javax.servlet.http.HttpServletResponse; import org.apache.catalina.Context; +import org.apache.catalina.Globals; import org.apache.catalina.LifecycleException; import org.apache.catalina.comet.CometEvent; import org.apache.catalina.comet.CometProcessor; @@ -165,8 +166,8 @@ final class StandardWrapperValve // Identify if the request is Comet related now that the servlet has been allocated boolean comet = false; - if (servlet instanceof CometProcessor - && request.getAttribute("org.apache.tomcat.comet.support") == Boolean.TRUE) { + if (servlet instanceof CometProcessor && request.getAttribute( + Globals.COMET_SUPPORTED_ATTR) == Boolean.TRUE) { comet = true; request.setComet(true); } Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/DefaultServlet.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/DefaultServlet.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Thu Mar 15 22:47:40 2012 @@ -1644,16 +1644,16 @@ public class DefaultServlet && (entry.resource != null) && ((length > sendfileSize) || (entry.resource.getContent() == null)) && (entry.attributes.getCanonicalPath() != null) - && (Boolean.TRUE == request.getAttribute("org.apache.tomcat.sendfile.support")) + && (Boolean.TRUE == request.getAttribute(Globals.SENDFILE_SUPPORTED_ATTR)) && (request.getClass().getName().equals("org.apache.catalina.connector.RequestFacade")) && (response.getClass().getName().equals("org.apache.catalina.connector.ResponseFacade"))) { - request.setAttribute("org.apache.tomcat.sendfile.filename", entry.attributes.getCanonicalPath()); + request.setAttribute(Globals.SENDFILE_FILENAME_ATTR, entry.attributes.getCanonicalPath()); if (range == null) { - request.setAttribute("org.apache.tomcat.sendfile.start", Long.valueOf(0L)); - request.setAttribute("org.apache.tomcat.sendfile.end", Long.valueOf(length)); + request.setAttribute(Globals.SENDFILE_FILE_START_ATTR, Long.valueOf(0L)); + request.setAttribute(Globals.SENDFILE_FILE_END_ATTR, Long.valueOf(length)); } else { - request.setAttribute("org.apache.tomcat.sendfile.start", Long.valueOf(range.start)); - request.setAttribute("org.apache.tomcat.sendfile.end", Long.valueOf(range.end + 1)); + request.setAttribute(Globals.SENDFILE_FILE_START_ATTR, Long.valueOf(range.start)); + request.setAttribute(Globals.SENDFILE_FILE_END_ATTR, Long.valueOf(range.end + 1)); } return true; } Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/AccessLogValve.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/AccessLogValve.java Thu Mar 15 22:47:40 2012 @@ -1638,10 +1638,10 @@ public class AccessLogValve extends Valv // Protect against nulls and unexpected types as these values // may be set by untrusted applications Object start = request.getAttribute( - "org.apache.tomcat.sendfile.start"); + Globals.SENDFILE_FILE_START_ATTR); if (start instanceof Long) { Object end = request.getAttribute( - "org.apache.tomcat.sendfile.end"); + Globals.SENDFILE_FILE_END_ATTR); if (end instanceof Long) { length = ((Long) end).longValue() - ((Long) start).longValue(); Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/Constants.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/Constants.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/Constants.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/Constants.java Thu Mar 15 22:47:40 2012 @@ -59,4 +59,73 @@ public final class Constants { Boolean.valueOf(System.getProperty( "org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER", "false")).booleanValue(); + + /** + * The request attribute that is set to the value of {@code Boolean.TRUE} + * if connector processing this request supports Comet API. + */ + public static final String COMET_SUPPORTED_ATTR = + "org.apache.tomcat.comet.support"; + + + /** + * The request attribute that is set to the value of {@code Boolean.TRUE} + * if connector processing this request supports setting + * per-connection request timeout through Comet API. + * + * @see org.apache.catalina.comet.CometEvent#setTimeout(int) + */ + public static final String COMET_TIMEOUT_SUPPORTED_ATTR = + "org.apache.tomcat.comet.timeout.support"; + + + /** + * The request attribute that can be set to a value of type + * {@code java.lang.Integer} to specify per-connection request + * timeout for Comet API. The value is in milliseconds. + * + * @see org.apache.catalina.comet.CometEvent#setTimeout(int) + */ + public static final String COMET_TIMEOUT_ATTR = + "org.apache.tomcat.comet.timeout"; + + + /** + * The request attribute that is set to the value of {@code Boolean.TRUE} + * if connector processing this request supports use of sendfile. + */ + public static final String SENDFILE_SUPPORTED_ATTR = + "org.apache.tomcat.sendfile.support"; + + + /** + * The request attribute that can be used by a servlet to pass + * to the connector the name of the file that is to be served + * by sendfile. The value should be {@code java.lang.String} + * that is {@code File.getCanonicalPath()} of the file to be served. + */ + public static final String SENDFILE_FILENAME_ATTR = + "org.apache.tomcat.sendfile.filename"; + + + /** + * The request attribute that can be used by a servlet to pass + * to the connector the start offset of the part of a file + * that is to be served by sendfile. The value should be + * {@code java.lang.Long}. To serve complete file + * the value should be {@code Long.valueOf(0)}. + */ + public static final String SENDFILE_FILE_START_ATTR = + "org.apache.tomcat.sendfile.start"; + + + /** + * The request attribute that can be used by a servlet to pass + * to the connector the end offset (not including) of the part + * of a file that is to be served by sendfile. The value should be + * {@code java.lang.Long}. To serve complete file + * the value should be equal to the length of the file. + */ + public static final String SENDFILE_FILE_END_ATTR = + "org.apache.tomcat.sendfile.end"; } Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Thu Mar 15 22:47:40 2012 @@ -1277,18 +1277,21 @@ public abstract class AbstractHttp11Proc // Advertise sendfile support through a request attribute if (endpoint.getUseSendfile()) { - request.setAttribute("org.apache.tomcat.sendfile.support", + request.setAttribute( + org.apache.coyote.Constants.SENDFILE_SUPPORTED_ATTR, Boolean.TRUE); } // Advertise comet support through a request attribute if (endpoint.getUseComet()) { - request.setAttribute("org.apache.tomcat.comet.support", + request.setAttribute( + org.apache.coyote.Constants.COMET_SUPPORTED_ATTR, Boolean.TRUE); } // Advertise comet timeout support if (endpoint.getUseCometTimeout()) { - request.setAttribute("org.apache.tomcat.comet.timeout.support", + request.setAttribute( + org.apache.coyote.Constants.COMET_TIMEOUT_SUPPORTED_ATTR, Boolean.TRUE); } Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Thu Mar 15 22:47:40 2012 @@ -486,7 +486,7 @@ public class Http11AprProcessor extends @Override protected boolean prepareSendfile(OutputFilter[] outputFilters) { String fileName = (String) request.getAttribute( - "org.apache.tomcat.sendfile.filename"); + org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR); if (fileName != null) { // No entity body sent here outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]); @@ -494,9 +494,9 @@ public class Http11AprProcessor extends sendfileData = new AprEndpoint.SendfileData(); sendfileData.fileName = fileName; sendfileData.start = ((Long) request.getAttribute( - "org.apache.tomcat.sendfile.start")).longValue(); + org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue(); sendfileData.end = ((Long) request.getAttribute( - "org.apache.tomcat.sendfile.end")).longValue(); + org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue(); return true; } return false; Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Thu Mar 15 22:47:40 2012 @@ -126,7 +126,8 @@ public class Http11NioProcessor extends if (attach != null) { attach.setComet(comet); if (comet) { - Integer comettimeout = (Integer) request.getAttribute("org.apache.tomcat.comet.timeout"); + Integer comettimeout = (Integer) request.getAttribute( + org.apache.coyote.Constants.COMET_TIMEOUT_ATTR); if (comettimeout != null) { attach.setTimeout(comettimeout.longValue()); } @@ -261,7 +262,8 @@ public class Http11NioProcessor extends if (attach != null) { attach.setComet(comet); if (comet) { - Integer comettimeout = (Integer) request.getAttribute("org.apache.tomcat.comet.timeout"); + Integer comettimeout = (Integer) request.getAttribute( + org.apache.coyote.Constants.COMET_TIMEOUT_ATTR); if (comettimeout != null) { attach.setTimeout(comettimeout.longValue()); } @@ -510,7 +512,7 @@ public class Http11NioProcessor extends @Override protected boolean prepareSendfile(OutputFilter[] outputFilters) { String fileName = (String) request.getAttribute( - "org.apache.tomcat.sendfile.filename"); + org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR); if (fileName != null) { // No entity body sent here outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]); @@ -518,9 +520,9 @@ public class Http11NioProcessor extends sendfileData = new NioEndpoint.SendfileData(); sendfileData.fileName = fileName; sendfileData.pos = ((Long) request.getAttribute( - "org.apache.tomcat.sendfile.start")).longValue(); + org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue(); sendfileData.length = ((Long) request.getAttribute( - "org.apache.tomcat.sendfile.end")).longValue() - sendfileData.pos; + org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue() - sendfileData.pos; return true; } return false; Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java?rev=1301255&r1=1301254&r2=1301255&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java (original) +++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java Thu Mar 15 22:47:40 2012 @@ -21,10 +21,17 @@ import java.io.Reader; import java.nio.ByteBuffer; import java.nio.CharBuffer; +import org.junit.Test; + import org.apache.catalina.startup.TomcatBaseTest; public class TestWebSocket extends TomcatBaseTest { + @Test + public void testSimple() { + // TODO: Write a test + } + private static final class StreamingWebSocketServlet extends WebSocketServlet { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org