[Bug 55127] Encoders init and destroy methods are never called
https://issues.apache.org/bugzilla/show_bug.cgi?id=55127 --- Comment #1 from Niki Dokovski --- Comment on attachment 30470 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30470 encoders lifecycle patch wrong set of files please ignore -- 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 55127] Encoders init and destroy methods are never called
https://issues.apache.org/bugzilla/show_bug.cgi?id=55127 Niki Dokovski changed: What|Removed |Added Attachment #30470|0 |1 is obsolete|| --- Comment #2 from Niki Dokovski --- Created attachment 30471 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30471&action=edit encoders lifecycle patch new patch set -- 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: r1495724 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java
Author: markt Date: Sat Jun 22 13:24:16 2013 New Revision: 1495724 URL: http://svn.apache.org/r1495724 Log: Fix failing test. Don't mark session as closed until Endpoint.onClose has completed. Reduce code duplication Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1495724&r1=1495723&r2=1495724&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Sat Jun 22 13:24:16 2013 @@ -332,22 +332,7 @@ public class WsSession implements Sessio @Override public void close(CloseReason closeReason) throws IOException { -// Double-checked locking. OK because state is volatile -if (state != State.OPEN) { -return; -} - -synchronized (stateLock) { -if (state != State.OPEN) { -return; -} - -state = State.CLOSING; - -sendCloseMessage(closeReason); - -fireEndpointOnClose(closeReason); -} +doClose(closeReason, closeReason); } @@ -356,7 +341,8 @@ public class WsSession implements Sessio * Need internal close method as spec requires that the local endpoint * receives a 1006 on timeout. */ -private void closeTimeout(CloseReason closeReason) { +private void doClose(CloseReason closeReasonMessage, +CloseReason closeReasonLocal) { // Double-checked locking. OK because state is volatile if (state != State.OPEN) { return; @@ -369,13 +355,10 @@ public class WsSession implements Sessio state = State.CLOSING; -sendCloseMessage(closeReason); +sendCloseMessage(closeReasonMessage); +fireEndpointOnClose(closeReasonLocal); -CloseReason localCloseReason = -new CloseReason(CloseCodes.CLOSED_ABNORMALLY, -closeReason.getReasonPhrase()); - -fireEndpointOnClose(localCloseReason); +state = State.CLOSED; } } @@ -391,10 +374,9 @@ public class WsSession implements Sessio if (state == State.OPEN) { sendCloseMessage(closeReason); fireEndpointOnClose(closeReason); +state = State.CLOSED; } -state = State.CLOSED; - // Close the socket wsRemoteEndpoint.close(); } @@ -520,14 +502,15 @@ public class WsSession implements Sessio } if (System.currentTimeMillis() - lastActive > timeout) { -closeTimeout(new CloseReason(CloseCodes.GOING_AWAY, -sm.getString("wsSession.timeout"))); +String msg = sm.getString("wsSession.timeout"); +doClose(new CloseReason(CloseCodes.GOING_AWAY, msg), +new CloseReason(CloseCodes.CLOSED_ABNORMALLY, msg)); } } private void checkState() { -if (!isOpen()) { +if (state == State.CLOSED) { throw new IllegalStateException(sm.getString("wsSession.closed")); } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1495735 - in /tomcat/trunk: java/org/apache/tomcat/websocket/ java/org/apache/tomcat/websocket/server/ test/org/apache/tomcat/websocket/pojo/
Author: markt Date: Sat Jun 22 14:09:34 2013 New Revision: 1495735 URL: http://svn.apache.org/r1495735 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55127 Encoders have init() and destroy() methdos that need to be called. Based on a patch provided by Niki Dokovski. Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java tomcat/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java tomcat/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1495735&r1=1495734&r2=1495735&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Sat Jun 22 14:09:34 2013 @@ -38,6 +38,7 @@ import java.util.concurrent.atomic.Atomi import javax.websocket.DeploymentException; import javax.websocket.EncodeException; import javax.websocket.Encoder; +import javax.websocket.EndpointConfig; import javax.websocket.RemoteEndpoint; import javax.websocket.SendHandler; import javax.websocket.SendResult; @@ -460,13 +461,15 @@ public abstract class WsRemoteEndpointIm } -protected void setEncoders(List> encoders) +protected void setEncoders(EndpointConfig endpointConfig) throws DeploymentException { encoderEntries.clear(); -for (Class encoderClazz : encoders) { +for (Class encoderClazz : +endpointConfig.getEncoders()) { Encoder instance; try { instance = encoderClazz.newInstance(); +instance.init(endpointConfig); } catch (InstantiationException | IllegalAccessException e) { throw new DeploymentException( sm.getString("wsRemoteEndpoint.invalidEncoder", @@ -489,10 +492,17 @@ public abstract class WsRemoteEndpointIm } +protected final void close() { +for (EncoderEntry entry : encoderEntries) { +entry.getEncoder().destroy(); +} +doClose(); +} + + protected abstract void doWrite(SendHandler handler, ByteBuffer... data); protected abstract boolean isMasked(); -protected abstract void close(); - +protected abstract void doClose(); private static void writeHeader(ByteBuffer headerBuffer, byte opCode, ByteBuffer payload, boolean first, boolean last, boolean masked, Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java?rev=1495735&r1=1495734&r2=1495735&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java Sat Jun 22 14:09:34 2013 @@ -50,7 +50,7 @@ public class WsRemoteEndpointImplClient } @Override -protected void close() { +protected void doClose() { channel.close(); } } Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1495735&r1=1495734&r2=1495735&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Sat Jun 22 14:09:34 2013 @@ -33,8 +33,8 @@ import java.util.concurrent.atomic.Atomi import javax.websocket.CloseReason; import javax.websocket.CloseReason.CloseCodes; import javax.websocket.DeploymentException; -import javax.websocket.Encoder; import javax.websocket.Endpoint; +import javax.websocket.EndpointConfig; import javax.websocket.Extension; import javax.websocket.MessageHandler; import javax.websocket.PongMessage; @@ -100,8 +100,7 @@ public class WsSession implements Sessio URI requestUri, Map> requestParameterMap, String queryString, Principal userPrincipal, String subProtocol, Map pathParameters, -boolean secure, List> encoders, -Map userProperties) +boolean secure, EndpointConfig endpointConfig)
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4508 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1495724 Blamelist: markt Build succeeded! sincerely, -The Buildbot
[Bug 55127] Encoders init and destroy methods are never called
https://issues.apache.org/bugzilla/show_bug.cgi?id=55127 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #3 from Mark Thomas --- Thanks for the patch. A variation of it has been applied to trunk and will be included in 8.0.0 onwards. I did change a few things but nothing major. The patch was pretty much spot on: - passed just an EndpointConfig to setEncoders() for simplicity - close() -> doClose() in WsRemoteEndpointImplBase rather than relying on sub-classes calling super.close() (the patch missed one of the sub-classes) - fixed a couple of auto-boxing warnings in the test code -- 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 55102] Add ability to report time taken to prepare response
https://issues.apache.org/bugzilla/show_bug.cgi?id=55102 --- Comment #3 from Jeremy Boynes --- Created attachment 30473 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30473&action=edit Documentation for %F AccessLogValve parameter Add documentation in the docs webapp -- 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 55102] Add ability to report time taken to prepare response
https://issues.apache.org/bugzilla/show_bug.cgi?id=55102 Jeremy Boynes changed: What|Removed |Added Attachment #30473|0 |1 is obsolete|| --- Comment #4 from Jeremy Boynes --- Created attachment 30474 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30474&action=edit Documentation for %F AccessLogValve parameter Minor change to add username to bug line from previous patch -- 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 55102] Add ability to report time taken to prepare response
https://issues.apache.org/bugzilla/show_bug.cgi?id=55102 --- Comment #5 from Jeremy Boynes --- Created attachment 30475 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30475&action=edit Backport to 7.0.x branch -- 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
SNAPSHOT of taglibs standard 1.2 updated - call for testing
In anticipation of a release of standard 1.2, I have deployed a new version to Apache's snapshot Maven repository: http://repository.apache.org/snapshots/ I have run this version through the TCK and it passes but have not had a chance to test it against real-world applications. I'd like to make a call out for pre-release testers who would be willing to report any issues they may find in real applications. To use this version, the following POM fragment will pull in the dependencies needed to use tags from JSTL 1.1 and later. > > org.apache.taglibs > taglibs-standard-spec > 1.2-SNAPSHOT > > > org.apache.taglibs > taglibs-standard-impl > 1.2-SNAPSHOT > This also supports JSTL 1.0-rt tags. If you use JSTL 1.0 non-rt tags you will also need to add an additional dependency on taglibs-standard-jstlel to bring in the original JSTL EL engine. If you use the XML tags, you will also need add a dependency on Apache Xalan 2.7.1 (xalan-2.7.1.jar and serializer-2.7.1.jar). If you find any problems or things that could be improved, please open an issue in Bugzilla: https://issues.apache.org/bugzilla/enter_bug.cgi?product=Taglibs If no major problems are found I will aim to release 1.2.0 later this month. Cheers Jeremy