DO NOT REPLY [Bug 49478] New: Add encoding parameter to AddDefaultCharSetFilter

2010-06-21 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49478

   Summary: Add encoding parameter to AddDefaultCharSetFilter
   Product: Tomcat 7
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: felix.schumac...@internetallee.de


AddDefaultCharSetFilter adds a default charset to each request. It assumes
ISO-8859-1 as the default charset.

The attached patch makes it configurable by introducing an "encoding"
parameter. This parameter can take one of two special values "default" or
"system". Every other value will be interpreted as a name of an character set,
e.g "utf-8".

The meaning of the two special values are as follows:

 default: use ISO-8859-1. This value will also be used, if no parameter was
specified, or if it is empty

 system: the jvm will be asked for the default charset. This charset will
usually be set by system locale.

Together with this functional change, there are two minor changes and one
bigger changes hidden. First use of annotation "Override" at overriden methods.
Second use of keyword "static" for the ResponseWrapper, since it has no
reference to outer class. The third and somewhat bigger change is use of
HttpServletResponse#setCharacterEncoding(encoding) instead of manipulating the
content-type.

-- 
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 49478] Add encoding parameter to AddDefaultCharSetFilter

2010-06-21 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49478

--- Comment #1 from Felix Schumacher  
2010-06-21 05:45:21 EDT ---
Created an attachment (id=25623)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25623)
add encoding parameter to AddDefaultCharsetFilter

-- 
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: r956531 - /tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java

2010-06-21 Thread markt
Author: markt
Date: Mon Jun 21 11:25:08 2010
New Revision: 956531

URL: http://svn.apache.org/viewvc?rev=956531&view=rev
Log:
Reduce code duplication in connectors: Use AbstractInputBuffer with APR/native 
connector

Modified:
tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java?rev=956531&r1=956530&r2=956531&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java Mon 
Jun 21 11:25:08 2010
@@ -27,8 +27,6 @@ import org.apache.tomcat.jni.Socket;
 import org.apache.tomcat.jni.Status;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.buf.MessageBytes;
-import org.apache.tomcat.util.http.MimeHeaders;
-import org.apache.tomcat.util.res.StringManager;
 
 import org.apache.coyote.InputBuffer;
 import org.apache.coyote.Request;
@@ -39,7 +37,7 @@ import org.apache.coyote.Request;
  *
  * @author mailto:r...@apache.org";>Remy Maucherat
  */
-public class InternalAprInputBuffer implements InputBuffer {
+public class InternalAprInputBuffer extends AbstractInputBuffer {
 
 
 // -- Constants
@@ -75,69 +73,10 @@ public class InternalAprInputBuffer impl
 }
 
 
-// -- Variables
-
-
-/**
- * The string manager for this package.
- */
-protected static final StringManager sm =
-StringManager.getManager(Constants.Package);
-
-
 // - Instance Variables
 
 
 /**
- * Associated Coyote request.
- */
-protected Request request;
-
-
-/**
- * Headers of the associated request.
- */
-protected MimeHeaders headers;
-
-
-/**
- * State.
- */
-protected boolean parsingHeader;
-
-
-/**
- * Swallow input ? (in the case of an expectation)
- */
-protected boolean swallowInput;
-
-
-/**
- * Pointer to the current read buffer.
- */
-protected byte[] buf;
-
-
-/**
- * Last valid byte.
- */
-protected int lastValid;
-
-
-/**
- * Position in the buffer.
- */
-protected int pos;
-
-
-/**
- * Pos of the end of the header in the buffer, which is also the
- * start of the body.
- */
-protected int end;
-
-
-/**
  * Direct byte buffer used to perform actual reading.
  */
 protected ByteBuffer bbuf;
@@ -149,31 +88,6 @@ public class InternalAprInputBuffer impl
 protected long socket;
 
 
-/**
- * Underlying input buffer.
- */
-protected InputBuffer inputStreamInputBuffer;
-
-
-/**
- * Filter library.
- * Note: Filter[0] is always the "chunked" filter.
- */
-protected InputFilter[] filterLibrary;
-
-
-/**
- * Active filters (in order).
- */
-protected InputFilter[] activeFilters;
-
-
-/**
- * Index of the last active filter.
- */
-protected int lastActiveFilter;
-
-
 // - Properties
 
 
@@ -194,75 +108,6 @@ public class InternalAprInputBuffer impl
 }
 
 
-/**
- * Add an input filter to the filter library.
- */
-public void addFilter(InputFilter filter) {
-
-InputFilter[] newFilterLibrary = 
-new InputFilter[filterLibrary.length + 1];
-for (int i = 0; i < filterLibrary.length; i++) {
-newFilterLibrary[i] = filterLibrary[i];
-}
-newFilterLibrary[filterLibrary.length] = filter;
-filterLibrary = newFilterLibrary;
-
-activeFilters = new InputFilter[filterLibrary.length];
-
-}
-
-
-/**
- * Get filters.
- */
-public InputFilter[] getFilters() {
-
-return filterLibrary;
-
-}
-
-
-/**
- * Clear filters.
- */
-public void clearFilters() {
-
-filterLibrary = new InputFilter[0];
-lastActiveFilter = -1;
-
-}
-
-
-/**
- * Add an input filter to the filter library.
- */
-public void addActiveFilter(InputFilter filter) {
-
-if (lastActiveFilter == -1) {
-filter.setBuffer(inputStreamInputBuffer);
-} else {
-for (int i = 0; i <= lastActiveFilter; i++) {
-if (activeFilters[i] == filter)
-return;
-}
-filter.setBuffer(activeFilters[lastActiveFilter]);
-}
-
-activeFilters[++lastActiveFilter] = filter;
-
-filter.setRequest(request);
-
-}
-
-
-/**
- * Set the swallow input flag.
- */
-public void setSwallowInput(boolean swallowInput) {
-this.swallo

svn commit: r956532 - /tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java

2010-06-21 Thread markt
Author: markt
Date: Mon Jun 21 11:25:46 2010
New Revision: 956532

URL: http://svn.apache.org/viewvc?rev=956532&view=rev
Log:
Reduce code duplication in connectors: Use AbstractOutputBuffer with APR/native 
connector

Modified:
tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java?rev=956532&r1=956531&r2=956532&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java Mon 
Jun 21 11:25:46 2010
@@ -22,11 +22,7 @@ import java.nio.ByteBuffer;
 
 import org.apache.tomcat.jni.Socket;
 import org.apache.tomcat.util.buf.ByteChunk;
-import org.apache.tomcat.util.buf.CharChunk;
-import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.HttpMessages;
-import org.apache.tomcat.util.http.MimeHeaders;
-import org.apache.tomcat.util.res.StringManager;
 
 import org.apache.coyote.ActionCode;
 import org.apache.coyote.OutputBuffer;
@@ -37,8 +33,7 @@ import org.apache.coyote.Response;
  * 
  * @author mailto:r...@apache.org";>Remy Maucherat
  */
-public class InternalAprOutputBuffer 
-implements OutputBuffer {
+public class InternalAprOutputBuffer extends AbstractOutputBuffer {
 
 
 // -- Constants
@@ -85,87 +80,16 @@ public class InternalAprOutputBuffer 
 }
 
 
-// -- Variables
-
-
-/**
- * The string manager for this package.
- */
-protected static final StringManager sm =
-StringManager.getManager(Constants.Package);
-
-
 // - Instance Variables
 
 
 /**
- * Associated Coyote response.
- */
-protected Response response;
-
-
-/**
- * Headers of the associated request.
- */
-protected MimeHeaders headers;
-
-
-/**
- * Committed flag.
- */
-protected boolean committed;
-
-
-/**
- * Finished flag.
- */
-protected boolean finished;
-
-
-/**
- * Pointer to the current write buffer.
- */
-protected byte[] buf;
-
-
-/**
- * Position in the buffer.
- */
-protected int pos;
-
-
-/**
  * Underlying socket.
  */
 protected long socket;
 
 
 /**
- * Underlying output buffer.
- */
-protected OutputBuffer outputStreamOutputBuffer;
-
-
-/**
- * Filter library.
- * Note: Filter[0] is always the "chunked" filter.
- */
-protected OutputFilter[] filterLibrary;
-
-
-/**
- * Active filter (which is actually the top of the pipeline).
- */
-protected OutputFilter[] activeFilters;
-
-
-/**
- * Index of the last active filter.
- */
-protected int lastActiveFilter;
-
-
-/**
  * Direct byte buffer used for writing.
  */
 protected ByteBuffer bbuf = null;
@@ -191,67 +115,6 @@ public class InternalAprOutputBuffer 
 }
 
 
-/**
- * Add an output filter to the filter library.
- */
-public void addFilter(OutputFilter filter) {
-
-OutputFilter[] newFilterLibrary = 
-new OutputFilter[filterLibrary.length + 1];
-for (int i = 0; i < filterLibrary.length; i++) {
-newFilterLibrary[i] = filterLibrary[i];
-}
-newFilterLibrary[filterLibrary.length] = filter;
-filterLibrary = newFilterLibrary;
-
-activeFilters = new OutputFilter[filterLibrary.length];
-
-}
-
-
-/**
- * Get filters.
- */
-public OutputFilter[] getFilters() {
-
-return filterLibrary;
-
-}
-
-
-/**
- * Clear filters.
- */
-public void clearFilters() {
-
-filterLibrary = new OutputFilter[0];
-lastActiveFilter = -1;
-
-}
-
-
-/**
- * Add an output filter to the filter library.
- */
-public void addActiveFilter(OutputFilter filter) {
-
-if (lastActiveFilter == -1) {
-filter.setBuffer(outputStreamOutputBuffer);
-} else {
-for (int i = 0; i <= lastActiveFilter; i++) {
-if (activeFilters[i] == filter)
-return;
-}
-filter.setBuffer(activeFilters[lastActiveFilter]);
-}
-
-activeFilters[++lastActiveFilter] = filter;
-
-filter.setResponse(response);
-
-}
-
-
 // - Public Methods
 
 
@@ -260,37 +123,14 @@ public class InternalAprOutputBuffer 
  * 
  * @throws IOException an underlying I/O error occurred
  */
+@Override
 public void flush()
 throws IOException {
 
-if (!committed) {
-
-   

svn commit: r956533 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2010-06-21 Thread markt
Author: markt
Date: Mon Jun 21 11:27:18 2010
New Revision: 956533

URL: http://svn.apache.org/viewvc?rev=956533&view=rev
Log:
Reduce code duplication in connectors: Move addFilter() and addInputFilter() to 
base class

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=956533&r1=956532&r2=956533&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Mon 
Jun 21 11:27:18 2010
@@ -30,7 +30,7 @@ import org.apache.tomcat.util.buf.ByteCh
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.res.StringManager;
 
-public class AbstractHttp11Processor {
+public abstract class AbstractHttp11Processor {
 
 /**
  * Logger.
@@ -720,4 +720,69 @@ public class AbstractHttp11Processor {
 }
 
 
+/**
+ * Exposes input buffer to super class to allow better code re-use.
+ * @return  The input buffer used by the processor. 
+ */
+protected abstract AbstractInputBuffer getInputBuffer();
+
+/**
+ * Exposes output buffer to super class to allow better code re-use.
+ * @return  The output buffer used by the processor. 
+ */
+protected abstract AbstractOutputBuffer getOutputBuffer();
+
+/**
+ * Add input or output filter.
+ *
+ * @param className class name of the filter
+ */
+protected void addFilter(String className) {
+try {
+Class clazz = Class.forName(className);
+Object obj = clazz.newInstance();
+if (obj instanceof InputFilter) {
+getInputBuffer().addFilter((InputFilter) obj);
+} else if (obj instanceof OutputFilter) {
+getOutputBuffer().addFilter((OutputFilter) obj);
+} else {
+log.warn(sm.getString("http11processor.filter.unknown",
+className));
+}
+} catch (Exception e) {
+log.error(sm.getString(
+"http11processor.filter.error", className), e);
+}
+}
+
+
+/**
+ * Add an input filter to the current request.
+ *
+ * @return false if the encoding was not found (which would mean it is
+ * unsupported)
+ */
+protected boolean addInputFilter(InputFilter[] inputFilters,
+ String encodingName) {
+if (encodingName.equals("identity")) {
+// Skip
+} else if (encodingName.equals("chunked")) {
+getInputBuffer().addActiveFilter
+(inputFilters[Constants.CHUNKED_FILTER]);
+contentDelimitation = true;
+} else {
+for (int i = 2; i < inputFilters.length; i++) {
+if (inputFilters[i].getEncodingName()
+.toString().equals(encodingName)) {
+getInputBuffer().addActiveFilter(inputFilters[i]);
+return true;
+}
+}
+return false;
+}
+return true;
+}
+
+
+
 }

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=956533&r1=956532&r2=956533&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Mon Jun 
21 11:27:18 2010
@@ -151,28 +151,6 @@ public class Http11AprProcessor extends 
 
 
 /**
- * Add input or output filter.
- *
- * @param className class name of the filter
- */
-protected void addFilter(String className) {
-try {
-Class clazz = Class.forName(className);
-Object obj = clazz.newInstance();
-if (obj instanceof InputFilter) {
-inputBuffer.addFilter((InputFilter) obj);
-} else if (obj instanceof OutputFilter) {
-outputBuffer.addFilter((OutputFilter) obj);
-} else {
-log.warn(sm.getString("http11processor.filter.unknown", 
className));
-}
-} catch (Exception e) {
-log.error(sm.getString("http11processor.filter.error", className), 
e);
-}
-}
-
-
-/**
  * Process pipelined HTTP requests using the specified input and output
  * streams

svn commit: r956537 - in /tomcat/trunk/java/org/apache/coyote/http11/filters: BufferedInputFilter.java ChunkedInputFilter.java ChunkedOutputFilter.java GzipOutputFilter.java SavedRequestInputFilter.ja

2010-06-21 Thread markt
Author: markt
Date: Mon Jun 21 11:54:13 2010
New Revision: 956537

URL: http://svn.apache.org/viewvc?rev=956537&view=rev
Log:
Fix Eclipse warnings in this package. No functional change.

Modified:
tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java

tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java
tomcat/trunk/java/org/apache/coyote/http11/filters/VoidInputFilter.java
tomcat/trunk/java/org/apache/coyote/http11/filters/VoidOutputFilter.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java?rev=956537&r1=956536&r2=956537&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java 
Mon Jun 21 11:54:13 2010
@@ -89,11 +89,11 @@ public class BufferedInputFilter impleme
 public int doRead(ByteChunk chunk, Request request) throws IOException {
 if (hasRead || buffered.getLength() <= 0) {
 return -1;
-} else {
-chunk.setBytes(buffered.getBytes(), buffered.getStart(),
-   buffered.getLength());
-hasRead = true;
 }
+
+chunk.setBytes(buffered.getBytes(), buffered.getStart(),
+buffered.getLength());
+hasRead = true;
 return chunk.getLength();
 }
 

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java?rev=956537&r1=956536&r2=956537&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 
Mon Jun 21 11:54:13 2010
@@ -176,6 +176,7 @@ public class ChunkedInputFilter implemen
  * Read the content length from the request.
  */
 public void setRequest(Request request) {
+// NOOP: Request isn't used so ignore it
 }
 
 
@@ -187,6 +188,7 @@ public class ChunkedInputFilter implemen
 
 // Consume extra bytes : parse the stream until the end chunk is found
 while (doRead(readChunk, null) >= 0) {
+// NOOP: Just consume the input
 }
 
 // Return the number of extra bytes which were consumed
@@ -275,6 +277,7 @@ public class ChunkedInputFilter implemen
 }
 
 if (buf[pos] == Constants.CR) {
+// FIXME: Improve parsing to check for CRLF 
 } else if (buf[pos] == Constants.LF) {
 eol = true;
 } else if (buf[pos] == Constants.SEMI_COLON) {

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java?rev=956537&r1=956536&r2=956537&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java 
Mon Jun 21 11:54:13 2010
@@ -142,6 +142,7 @@ public class ChunkedOutputFilter impleme
  * after the response header processing is complete.
  */
 public void setResponse(Response response) {
+// NOOP: No need for parameters from response in this filter
 }
 
 
@@ -172,6 +173,7 @@ public class ChunkedOutputFilter impleme
  * Make the filter ready to process the next request.
  */
 public void recycle() {
+// NOOP: Nothing to recycle
 }
 
 

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java?rev=956537&r1=956536&r2=956537&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java 
Mon Jun 21 11:54:13 2010
@@ -99,6 +99,7 @@ public class GzipOutputFilter implements
  * after the response header processing is complete.
  */
 public void setResponse(Response response) {
+// NOOP: No need for parameters from response in this filter
 }
 
 
@@ -166,9 +167,9 @@ public class G

Re: [VOTE] Release Apache Tomcat 7.0.0 as beta

2010-06-21 Thread Martin Dubuc
+1 Beta

On Sun, Jun 13, 2010 at 6:15 PM, Mark Thomas  wrote:

> The proposed Apache Tomcat 7.0.0 release is now available for voting.
>
> It can be obtained from:
> http://people.apache.org/~markt/dev/tomcat-7/v7.0.0/
> The svn tag is:
> http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_0/
>
> Based on testing of RC4, feedback received on RC1-RC4, the currently
> open bugs against 7.0.x and the extensive refactoring that has taken
> place both of the connectors and the lifecycle componenets, I am
> proposing to release 7.0.0 as a beta release.
>
> And now for the important bit:
>
> The propsoed 7.0.0 release is
> [ ] Broken - do not release
> [ ] Alpha  - go ahead and release as 7.0.0 Alpha
> [X] Beta   - go ahead and release as 7.0.0 Beta
>
> Mark
>
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


Re: [VOTE] Release Apache Tomcat 7.0.0 as beta

2010-06-21 Thread Konstantin Kolinko
2010/6/14 Mark Thomas :
> The proposed Apache Tomcat 7.0.0 release is now available for voting.
>
> It can be obtained from:
> http://people.apache.org/~markt/dev/tomcat-7/v7.0.0/
> The svn tag is:
> http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_0/
>
> The propsoed 7.0.0 release is
> [ ] Broken - do not release
> [ ] Alpha  - go ahead and release as 7.0.0 Alpha

> [x] Beta   - go ahead and release as 7.0.0 Beta

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release Apache Tomcat 7.0.0 as beta

2010-06-21 Thread jfarcand


> [ ] Broken - do not release
> [ ] Alpha  - go ahead and release as 7.0.0 Alpha
> [x ] Beta   - go ahead and release as 7.0.0 Beta

I've tested Comet (both native and Servlet 3.0) with Atmosphere 
framework and works pretty well with both.


-- Jeanfrancois

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r956617 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2010-06-21 Thread markt
Author: markt
Date: Mon Jun 21 15:16:33 2010
New Revision: 956617

URL: http://svn.apache.org/viewvc?rev=956617&view=rev
Log:
Reduce code duplication in connectors: Move initializeFilters()to base class

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=956617&r1=956616&r2=956617&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Mon 
Jun 21 15:16:33 2010
@@ -23,6 +23,14 @@ import java.util.regex.PatternSyntaxExce
 import org.apache.coyote.Adapter;
 import org.apache.coyote.Request;
 import org.apache.coyote.Response;
+import org.apache.coyote.http11.filters.BufferedInputFilter;
+import org.apache.coyote.http11.filters.ChunkedInputFilter;
+import org.apache.coyote.http11.filters.ChunkedOutputFilter;
+import org.apache.coyote.http11.filters.GzipOutputFilter;
+import org.apache.coyote.http11.filters.IdentityInputFilter;
+import org.apache.coyote.http11.filters.IdentityOutputFilter;
+import org.apache.coyote.http11.filters.VoidInputFilter;
+import org.apache.coyote.http11.filters.VoidOutputFilter;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.Ascii;
@@ -726,12 +734,40 @@ public abstract class AbstractHttp11Proc
  */
 protected abstract AbstractInputBuffer getInputBuffer();
 
+
 /**
  * Exposes output buffer to super class to allow better code re-use.
  * @return  The output buffer used by the processor. 
  */
 protected abstract AbstractOutputBuffer getOutputBuffer();
 
+
+/**
+ * Initialize standard input and output filters.
+ */
+protected void initializeFilters() {
+// Create and add the identity filters.
+getInputBuffer().addFilter(new IdentityInputFilter());
+getOutputBuffer().addFilter(new IdentityOutputFilter());
+
+// Create and add the chunked filters.
+getInputBuffer().addFilter(new ChunkedInputFilter());
+getOutputBuffer().addFilter(new ChunkedOutputFilter());
+
+// Create and add the void filters.
+getInputBuffer().addFilter(new VoidInputFilter());
+getOutputBuffer().addFilter(new VoidOutputFilter());
+
+// Create and add buffered input filter
+getInputBuffer().addFilter(new BufferedInputFilter());
+
+// Create and add the chunked filters.
+//getInputBuffer().addFilter(new GzipInputFilter());
+getOutputBuffer().addFilter(new GzipOutputFilter());
+
+}
+
+
 /**
  * Add input or output filter.
  *

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=956617&r1=956616&r2=956617&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Mon Jun 
21 15:16:33 2010
@@ -30,14 +30,7 @@ import org.apache.coyote.ActionHook;
 import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
-import org.apache.coyote.http11.filters.ChunkedInputFilter;
-import org.apache.coyote.http11.filters.ChunkedOutputFilter;
-import org.apache.coyote.http11.filters.GzipOutputFilter;
-import org.apache.coyote.http11.filters.IdentityInputFilter;
-import org.apache.coyote.http11.filters.IdentityOutputFilter;
 import org.apache.coyote.http11.filters.SavedRequestInputFilter;
-import org.apache.coyote.http11.filters.VoidInputFilter;
-import org.apache.coyote.http11.filters.VoidOutputFilter;
 import org.apache.coyote.http11.filters.BufferedInputFilter;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -1149,32 +1142,6 @@ public class Http11AprProcessor extends 
 }
 
 
-/**
- * Initialize standard input and output filters.
- */
-protected void initializeFilters() {
-
-// Create and add the identity filters.
-inputBuffer.addFilter(new IdentityInputFilter());
-outputBuffer.addFilter(new IdentityOutputFilter());
-
-// Create and add the chunked filters.
-inputBuffer.addFilter(new ChunkedInputFilter());
-outputBuffer.addFilter(new ChunkedOutputFilter());
-
-// Create and add the void filters.
-

svn commit: r956653 - /tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java

2010-06-21 Thread markt
Author: markt
Date: Mon Jun 21 17:52:25 2010
New Revision: 956653

URL: http://svn.apache.org/viewvc?rev=956653&view=rev
Log:
Add support for additional 500 error codes.
Allow responses to include blank lines

Modified:
tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java

Modified: tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java?rev=956653&r1=956652&r2=956653&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java Mon Jun 
21 17:52:25 2010
@@ -44,7 +44,9 @@ public abstract class SimpleHttpClient {
 
 public static final String OK_200 = "HTTP/1.1 200";
 public static final String FAIL_404 = "HTTP/1.1 404";
+public static final String FAIL_50X = "HTTP/1.1 50";
 public static final String FAIL_500 = "HTTP/1.1 500";
+public static final String FAIL_501 = "HTTP/1.1 501";
 
 private Socket socket;
 private Writer writer;
@@ -121,7 +123,7 @@ public abstract class SimpleHttpClient {
 StringBuilder builder = new StringBuilder();
 if (readBody) {
 line = readLine();
-while (line != null && line.length() > 0) {
+while (line != null) {
 builder.append(line);
 line = readLine();
 }
@@ -161,10 +163,18 @@ public abstract class SimpleHttpClient {
 return getResponseLine().startsWith(FAIL_404);
 }
 
+public boolean isResponse50x() {
+return getResponseLine().startsWith(FAIL_50X);
+}
+
 public boolean isResponse500() {
 return getResponseLine().startsWith(FAIL_500);
 }
 
+public boolean isResponse501() {
+return getResponseLine().startsWith(FAIL_501);
+}
+
 public Socket getSocket() {
 return socket;
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r956655 - /tomcat/trunk/test/webapp-3.0/echo-params.jsp

2010-06-21 Thread markt
Author: markt
Date: Mon Jun 21 17:53:27 2010
New Revision: 956655

URL: http://svn.apache.org/viewvc?rev=956655&view=rev
Log:
Add useful test JSP. Not used in unit tests yet but I expect to use it in later 
commits.

Added:
tomcat/trunk/test/webapp-3.0/echo-params.jsp   (with props)

Added: tomcat/trunk/test/webapp-3.0/echo-params.jsp
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0/echo-params.jsp?rev=956655&view=auto
==
--- tomcat/trunk/test/webapp-3.0/echo-params.jsp (added)
+++ tomcat/trunk/test/webapp-3.0/echo-params.jsp Mon Jun 21 17:53:27 2010
@@ -0,0 +1,33 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--%>
+<%...@page import="java.util.Enumeration" %>
+
+
+<%
+Enumeration params = request.getParameterNames();
+while (params.hasMoreElements()) {
+String param = params.nextElement();
+
+String[] values = request.getParameterValues(param);
+for (String value : values) {
+// Don't do this in a real webapp - XSS issues
+out.println("" + param + " - " + value + "");
+}
+}
+%>
+
+

Propchange: tomcat/trunk/test/webapp-3.0/echo-params.jsp
--
svn:eol-style = native



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 49234] JMX Descriptor Modifications

2010-06-21 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49234

--- Comment #34 from Mark Thomas  2010-06-21 19:12:50 EDT ---
Ping. No update/progress in over a week. I'm starting to get concerned.

-- 
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 44454] busy count reported in mod_jk inflated, causes incorrect balancing

2010-06-21 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44454

--- Comment #19 from William A. Rowe Jr.  2010-06-21 22:44:52 
EDT ---
Studying this at length; the locking mechanism is not the issue.  fcntl() 
is likely the most reliable (not fastest) and flock(), which is not used by
default, would be far less reliable as it isn't supported by nas solutions.

The faulty assumption that 'volatile' magically enables atomic math operations
on smb environments is the issue.  'int64' is not atomic on any platform, and
it would appear that 'int' increments are acting appropriately for affected
users,
while their decrements are failing.

All operations on the scoreboard must be mutexed.

-- 
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 49234] JMX Descriptor Modifications

2010-06-21 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49234

--- Comment #35 from chamith buddhika  2010-06-22 
00:00:20 EDT ---
(In reply to comment #34)
> Ping. No update/progress in over a week. I'm starting to get concerned.

Sorry I was extremely busy last 1 and half weeks with my university work.
(Finalization of the final year project). So couldn't attend much to Tomcat
related work. It will be over in another couple of days and I hope to speed-up
my work after that. Sorry for the inconvenience.

-- 
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