This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 3a8d9813d3bc1f75fc4caa7836877609ff5a32b2 Author: Mark Thomas <ma...@apache.org> AuthorDate: Sun Jun 30 22:33:29 2019 +0100 Align with 9.0.x. Spacing and additional i18n keys. --- java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java | 6 ++---- java/org/apache/tomcat/websocket/LocalStrings.properties | 4 ++-- java/org/apache/tomcat/websocket/PerMessageDeflate.java | 2 +- java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java | 2 +- java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java b/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java index e736a88..631d669 100644 --- a/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java +++ b/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java @@ -268,8 +268,7 @@ public class AsyncChannelWrapperSecure implements AsyncChannelWrapper { Future<Integer> f = socketChannel.read(socketReadBuffer); Integer socketRead = f.get(); if (socketRead.intValue() == -1) { - throw new EOFException(sm.getString( - "asyncChannelWrapperSecure.eof")); + throw new EOFException(sm.getString("asyncChannelWrapperSecure.eof")); } } @@ -277,8 +276,7 @@ public class AsyncChannelWrapperSecure implements AsyncChannelWrapper { if (socketReadBuffer.hasRemaining()) { // Decrypt the data in the buffer - SSLEngineResult r = - sslEngine.unwrap(socketReadBuffer, dest); + SSLEngineResult r = sslEngine.unwrap(socketReadBuffer, dest); read += r.bytesProduced(); Status s = r.getStatus(); diff --git a/java/org/apache/tomcat/websocket/LocalStrings.properties b/java/org/apache/tomcat/websocket/LocalStrings.properties index 06894a6..820f06c 100644 --- a/java/org/apache/tomcat/websocket/LocalStrings.properties +++ b/java/org/apache/tomcat/websocket/LocalStrings.properties @@ -23,7 +23,6 @@ asyncChannelWrapperSecure.concurrentRead=Concurrent read operations are not perm asyncChannelWrapperSecure.concurrentWrite=Concurrent write operations are not permitted asyncChannelWrapperSecure.eof=Unexpected end of stream asyncChannelWrapperSecure.notHandshaking=Unexpected state [NOT_HANDSHAKING] during TLS handshake -asyncChannelWrapperSecure.readOverflow=Buffer overflow. [{0}] bytes to write into a [{1}] byte buffer that already contained [{2}] bytes. asyncChannelWrapperSecure.statusUnwrap=Unexpected Status of SSLEngineResult after an unwrap() operation asyncChannelWrapperSecure.statusWrap=Unexpected Status of SSLEngineResult after a wrap() operation asyncChannelWrapperSecure.tooBig=The result [{0}] is too big to be expressed as an Integer @@ -38,6 +37,7 @@ futureToSendHandler.timeout=Operation timed out after waiting [{0}] [{1}] to com perMessageDeflate.deflateFailed=Failed to decompress a compressed WebSocket frame perMessageDeflate.duplicateParameter=Duplicate definition of the [{0}] extension parameter +perMessageDeflate.invalidState=Invalid state perMessageDeflate.invalidWindowSize=An invalid windows of [{1}] size was specified for [{0}]. Valid values are whole numbers from 8 to 15 inclusive. perMessageDeflate.unknownParameter=An unknown extension parameter [{0}] was defined @@ -86,7 +86,6 @@ wsRemoteEndpoint.closed=Message will not be sent because the WebSocket session h wsRemoteEndpoint.closedDuringMessage=The remainder of the message will not be sent because the WebSocket session has been closed wsRemoteEndpoint.closedOutputStream=This method may not be called as the OutputStream has been closed wsRemoteEndpoint.closedWriter=This method may not be called as the Writer has been closed -wsRemoteEndpoint.concurrentMessageSend=Messages may not be sent concurrently even when using the asynchronous send messages. The client must wait for the previous message to complete before sending the next. wsRemoteEndpoint.flushOnCloseFailed=Batched messages still enabled after session has been closed. Unable to flush remaining batched message. wsRemoteEndpoint.invalidEncoder=The specified encoder of type [{0}] could not be instantiated wsRemoteEndpoint.noEncoder=No encoder specified for object of class [{0}] @@ -94,6 +93,7 @@ wsRemoteEndpoint.nullData=Invalid null data argument wsRemoteEndpoint.nullHandler=Invalid null handler argument wsRemoteEndpoint.sendInterrupt=The current thread was interrupted while waiting for a blocking send to complete wsRemoteEndpoint.tooMuchData=Ping or pong may not send more than 125 bytes +wsRemoteEndpoint.writeTimeout=Blocking write timeout wsRemoteEndpoint.wrongState=The remote endpoint was in state [{0}] which is an invalid state for called method # Note the following message is used as a close reason in a WebSocket control diff --git a/java/org/apache/tomcat/websocket/PerMessageDeflate.java b/java/org/apache/tomcat/websocket/PerMessageDeflate.java index 339c6b3..90931c5 100644 --- a/java/org/apache/tomcat/websocket/PerMessageDeflate.java +++ b/java/org/apache/tomcat/websocket/PerMessageDeflate.java @@ -421,7 +421,7 @@ public class PerMessageDeflate implements Transformation { blockingWriteTimeoutExpiry); } } else { - throw new IllegalStateException("Should never happen"); + throw new IllegalStateException(sm.getString("perMessageDeflate.invalidState")); } // Add the newly created compressed part to the set of parts diff --git a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java index 2a16dc5..de6bf72 100644 --- a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java +++ b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java @@ -50,7 +50,7 @@ import org.apache.tomcat.util.res.StringManager; public abstract class WsRemoteEndpointImplBase implements RemoteEndpoint { - private static final StringManager sm = + protected static final StringManager sm = StringManager.getManager(WsRemoteEndpointImplBase.class); protected static final SendResult SENDRESULT_OK = new SendResult(); diff --git a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java index 160b77d..473fda2 100644 --- a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java +++ b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java @@ -53,7 +53,7 @@ public class WsRemoteEndpointImplClient extends WsRemoteEndpointImplBase { } else { timeout = blockingWriteTimeoutExpiry - System.currentTimeMillis(); if (timeout < 0) { - SendResult sr = new SendResult(new IOException("Blocking write timeout")); + SendResult sr = new SendResult(new IOException(sm.getString("wsRemoteEndpoint.writeTimeout"))); handler.onResult(sr); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org