[Bug 54277] FilterRegistration wrong order

2012-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=54277

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Mark Thomas  ---
You need to read the all of the Javadoc for
FilterRegistration.Dynamic#addMappingForUrlPatterns(), not just some of it.

1. Filter mappings are matched in the order in which they were
added.

2. A declared filter mapping is one that is not created programmatically. i.e.
a declared filter is one defined in web.xml, web-fragment.xml or via
annotations.

-- 
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: r1069 - /dev/tomcat/tomcat-7/v7.0.34/ /release/tomcat/tomcat-7/v7.0.34/

2012-12-11 Thread markt
Author: markt
Date: Tue Dec 11 09:16:43 2012
New Revision: 1069

Log:
Release 7.0.34

Added:
release/tomcat/tomcat-7/v7.0.34/
  - copied from r1068, dev/tomcat/tomcat-7/v7.0.34/
Removed:
dev/tomcat/tomcat-7/v7.0.34/


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



svn commit: r1069 - /dev/tomcat/tomcat-7/v7.0.34/ /release/tomcat/tomcat-7/v7.0.34/

2012-12-11 Thread markt
Author: markt
Date: Tue Dec 11 09:16:43 2012
New Revision: 1069

Log:
Release 7.0.34

Added:
release/tomcat/tomcat-7/v7.0.34/
  - copied from r1068, dev/tomcat/tomcat-7/v7.0.34/
Removed:
dev/tomcat/tomcat-7/v7.0.34/


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



[Bug 54277] FilterRegistration wrong order

2012-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=54277

--- Comment #4 from psf...@clustertech.com ---
FYI posted in Jetty Bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=396253

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



[Bug 54278] New: Nested quotes inside a quoted log element aren't escaped

2012-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=54278

Bug ID: 54278
   Summary: Nested quotes inside a quoted log element aren't
escaped
   Product: Tomcat 7
   Version: 7.0.33
  Hardware: PC
OS: Mac OS X 10.4
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: giles.westw...@gmail.com
Classification: Unclassified

We had to created an extended class to handle this, to urlencode the quotes

public void addElement(StringBuffer buf, Date date, Request request,
Response response, long time) {
// CHANGED HERE
String headerStr = request.getHeader(header);
if(headerStr != null){
headerStr = headerStr.replace("\"", "%22");
}
buf.append(headerStr);
}


protected class RequestElement implements AccessLogElement {
public void addElement(StringBuffer buf, Date date, Request request,
Response response, long time) {
if (request != null) {
buf.append(request.getMethod());
buf.append(' ');
//CHANGED HERE
buf.append(request.getRequestURI().replace("\"", "%22"));
if (request.getQueryString() != null) {
buf.append('?');
//CHANGED HERE
buf.append(request.getQueryString().replace("\"", "%22"));
}
buf.append(' ');
buf.append(request.getProtocol());
} else {
buf.append("- - ");
}
}
}

protected class ResponseHeaderElement implements AccessLogElement {
private String header;

public ResponseHeaderElement(String header) {
this.header = header;
}

public void addElement(StringBuffer buf, Date date, Request request,
Response response, long time) {
   if (null != response) {
String[] values = response.getHeaderValues(header);
if(values.length > 0) {
for (int i = 0; i < values.length; i++) {
String string = values[i];
//CHANGED HERE
buf.append(string.replace("\"","%22"));
if(i+1

[Bug 54278] Nested quotes inside a quoted log element aren't escaped

2012-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=54278

Konstantin Kolinko  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Konstantin Kolinko  ---
There is no such requirement in AccessLogValve and thus it is not a bug.

If you want to submit a patch, the rules are here:
http://tomcat.apache.org/bugreport.html#How_to_submit_patches_and_enhancement_requests

-- 
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: r1420198 - in /tomcat/trunk/java/org/apache/tomcat/websocket: Constants.java WsFrame.java WsPingMessage.java WsProtocolHandler.java WsSession.java

2012-12-11 Thread markt
Author: markt
Date: Tue Dec 11 14:37:37 2012
New Revision: 1420198

URL: http://svn.apache.org/viewvc?rev=1420198&view=rev
Log:
WebSocket 1.0 implementation part 10 of many
WsSession only needs to support one message handler of each type so store each 
individually rather than in a HashSet.
Add the handling for Ping and Close control messages to WsFrame.

Added:
tomcat/trunk/java/org/apache/tomcat/websocket/WsPingMessage.java   (with 
props)
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java
tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java
tomcat/trunk/java/org/apache/tomcat/websocket/WsProtocolHandler.java
tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java?rev=1420198&r1=1420197&r2=1420198&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java Tue Dec 11 
14:37:37 2012
@@ -25,6 +25,14 @@ public class Constants {
 
 protected static final String SERVLET_NAME = WsServlet.class.getName();
 
+// OP Codes
+public static final byte OPCODE_CONTINUATION = 0x00;
+public static final byte OPCODE_TEXT = 0x01;
+public static final byte OPCODE_BINARY = 0x02;
+public static final byte OPCODE_CLOSE = 0x08;
+public static final byte OPCODE_PING = 0x09;
+public static final byte OPCODE_PONG = 0x0A;
+
 private Constants() {
 // Hide default constructor
 }

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java?rev=1420198&r1=1420197&r2=1420198&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java Tue Dec 11 
14:37:37 2012
@@ -18,6 +18,7 @@ package org.apache.tomcat.websocket;
 
 import java.io.EOFException;
 import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 
 import javax.servlet.ServletInputStream;
@@ -91,6 +92,10 @@ public class WsFrame {
 }
 
 
+/**
+ * @return true if sufficient data was present to process all
+ * of the initial header
+ */
 private boolean processInitialHeader() throws IOException {
 // Need at least two bytes of data to do this
 if (pos < 2) {
@@ -115,6 +120,10 @@ public class WsFrame {
 }
 
 
+/**
+ * @return true if sufficient data was present to complete the
+ * processing of the header
+ */
 private boolean processRemainingHeader() throws IOException {
 // Initial 2 bytes already read + 4 for the mask
 headerLength = 6;
@@ -155,8 +164,26 @@ public class WsFrame {
 }
 
 
-private boolean processData() {
-if (pos < (headerLength + payloadLength)) {
+private boolean processData() throws IOException {
+if (isControl()) {
+if (!isPayloadComplete()) {
+return false;
+}
+if (opCode == Constants.OPCODE_CLOSE) {
+wsSession.close();
+} else if (opCode == Constants.OPCODE_PING) {
+wsSession.getPingMessageHandler().onMessage(
+new WsPingMessage(getPayload()));
+} else if (opCode == Constants.OPCODE_PONG) {
+// TODO
+// Validate the PONG?
+} else {
+// TODO i18n
+throw new UnsupportedOperationException();
+}
+return true;
+}
+if (isPayloadComplete()) {
 // TODO Check if partial messages supported
 if (inputBuffer.length - pos > 0) {
 return false;
@@ -184,6 +211,24 @@ public class WsFrame {
 }
 
 
+private boolean isPayloadComplete() {
+return pos < (headerLength + payloadLength);
+}
+
+private ByteBuffer getPayload() {
+ByteBuffer result;
+if (isPayloadComplete()) {
+result = ByteBuffer.allocate((int) payloadLength);
+System.arraycopy(inputBuffer, headerLength, result.array(), 0,
+(int) payloadLength);
+} else {
+// TODO Handle partial payloads
+result = null;
+}
+
+return result;
+}
+
 protected static long byteArrayToLong(byte[] b, int start, int len)
 throws IOException {
 

Added: tomcat/trunk/java/org/apache/tomcat/websocket/WsPingMessage.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsPingMessage.java?rev=1420198&view=auto
=

svn commit: r1420250 - /tomcat/maven-plugin/trunk/pom.xml

2012-12-11 Thread olamy
Author: olamy
Date: Tue Dec 11 16:19:49 2012
New Revision: 1420250

URL: http://svn.apache.org/viewvc?rev=1420250&view=rev
Log:
tomcat7 use 7.0.34

Modified:
tomcat/maven-plugin/trunk/pom.xml

Modified: tomcat/maven-plugin/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/pom.xml?rev=1420250&r1=1420249&r2=1420250&view=diff
==
--- tomcat/maven-plugin/trunk/pom.xml (original)
+++ tomcat/maven-plugin/trunk/pom.xml Tue Dec 11 16:19:49 2012
@@ -70,7 +70,7 @@
 2001
 
 2008
-7.0.33
+7.0.34
 
 
 



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



svn commit: r1420446 - in /tomcat/trunk: java/javax/websocket/ java/org/apache/tomcat/websocket/ webapps/examples/WEB-INF/classes/websocket/echo/

2012-12-11 Thread markt
Author: markt
Date: Tue Dec 11 21:59:06 2012
New Revision: 1420446

URL: http://svn.apache.org/viewvc?rev=1420446&view=rev
Log:
WebSocket 1.0 implementation part 11 of many
Fix s/ping/pong/ in the API. pings are automatically responded to with pongs. 
Apps send ping and receive pongs. (Sending unsolicited pong is also possible.)
Handle incoming messages (at the frame, still need to map WebSocketMessage 
annotations)
Add some debug to the examples to check messages are received

Added:
tomcat/trunk/java/javax/websocket/PongMessage.java
  - copied, changed from r1420331, 
tomcat/trunk/java/javax/websocket/PingMessage.java
tomcat/trunk/java/org/apache/tomcat/websocket/WsPongMessage.java
  - copied, changed from r1420331, 
tomcat/trunk/java/org/apache/tomcat/websocket/WsPingMessage.java
Removed:
tomcat/trunk/java/javax/websocket/PingMessage.java
tomcat/trunk/java/org/apache/tomcat/websocket/WsPingMessage.java
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java
tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java
tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java

tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/echo/EchoAnnotation.java

tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/echo/EchoEndpoint.java

Copied: tomcat/trunk/java/javax/websocket/PongMessage.java (from r1420331, 
tomcat/trunk/java/javax/websocket/PingMessage.java)
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/PongMessage.java?p2=tomcat/trunk/java/javax/websocket/PongMessage.java&p1=tomcat/trunk/java/javax/websocket/PingMessage.java&r1=1420331&r2=1420446&rev=1420446&view=diff
==
--- tomcat/trunk/java/javax/websocket/PingMessage.java (original)
+++ tomcat/trunk/java/javax/websocket/PongMessage.java Tue Dec 11 21:59:06 2012
@@ -1,23 +1,23 @@
-/*
- * 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.
- */
-package javax.websocket;
-
-import java.nio.ByteBuffer;
-
-public interface PingMessage {
-ByteBuffer getApplicationData();
-}
+/*
+ * 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.
+ */
+package javax.websocket;
+
+import java.nio.ByteBuffer;
+
+public interface PongMessage {
+ByteBuffer getApplicationData();
+}

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java?rev=1420446&r1=1420445&r2=1420446&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java Tue 
Dec 11 21:59:06 2012
@@ -23,6 +23,7 @@ import java.util.Map;
 import javax.websocket.Session;
 import javax.websocket.WebSocketClose;
 import javax.websocket.WebSocketError;
+import javax.websocket.WebSocketMessage;
 import javax.websocket.WebSocketOpen;
 import javax.websocket.WebSocketPathParam;
 
@@ -57,6 +58,8 @@ public class PojoMethodMapping {
 } else if (error == null &&
 method.getAnnotation(WebSocketError.class) != null) {
 error = method;
+} else if (method.getAnnotation(WebSocketMessage.class) != null) {
+// TODO
 }
 }
 this.onOpen = open;

Modified: tomcat/trunk/java/org/a