This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new 5a8c6a1 Fix timeout logic for async IO non blocking writes
5a8c6a1 is described below
commit 5a8c6a1d084881dcbd6c44e692baded9b7b6ba42
Author: remm <[email protected]>
AuthorDate: Fri May 17 20:29:09 2019 +0200
Fix timeout logic for async IO non blocking writes
Identified by Coverity Scan.
---
.../tomcat/websocket/server/WsRemoteEndpointImplServer.java | 3 +--
webapps/docs/changelog.xml | 8 ++++++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git
a/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
b/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
index cdf0e82..c552d10 100644
--- a/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
+++ b/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
@@ -80,13 +80,12 @@ public class WsRemoteEndpointImplServer extends
WsRemoteEndpointImplBase {
}
} else {
this.handler = handler;
+ timeout = getSendTimeout();
if (timeout > 0) {
- // TODO This block in unreachable
// Register with timeout thread
timeoutExpiry = timeout + System.currentTimeMillis();
wsWriteTimeout.register(this);
}
- timeout = getSendTimeout();
}
socketWrapper.write(block ? BlockingMode.BLOCK :
BlockingMode.SEMI_BLOCK, timeout,
TimeUnit.MILLISECONDS, null,
SocketWrapperBase.COMPLETE_WRITE_WITH_COMPLETION,
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 24cc2b0..055239f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -173,6 +173,14 @@
</fix>
</changelog>
</subsection>
+ <subsection name="WebSocket">
+ <changelog>
+ <fix>
+ Fix timeout logic for async non blocking writes. Identified by
+ Coverity Scan. (remm)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Other">
<changelog>
<update>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]