This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 579e38f 63568: Avoid error when trying to set tcpNoDelay
579e38f is described below
commit 579e38fc3e96de6f3389087cf7457fdf7676d490
Author: remm <[email protected]>
AuthorDate: Fri Jul 19 10:31:05 2019 +0200
63568: Avoid error when trying to set tcpNoDelay
This can occur on socket types that do not support it, for example when
using the NIO inherited channel capability.
Submitted by František Kučera.
Attempt 2 ...
---
java/org/apache/tomcat/util/net/SocketProperties.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/tomcat/util/net/SocketProperties.java
b/java/org/apache/tomcat/util/net/SocketProperties.java
index a5573b0..706cc5e 100644
--- a/java/org/apache/tomcat/util/net/SocketProperties.java
+++ b/java/org/apache/tomcat/util/net/SocketProperties.java
@@ -200,8 +200,13 @@ public class SocketProperties {
soLingerTime.intValue());
if (soTimeout != null && soTimeout.intValue() >= 0)
socket.setSoTimeout(soTimeout.intValue());
- if (tcpNoDelay != null)
- socket.setTcpNoDelay(tcpNoDelay.booleanValue());
+ if (tcpNoDelay != null) {
+ try {
+ socket.setTcpNoDelay(tcpNoDelay.booleanValue());
+ } catch (SocketException e) {
+ // Some socket types may not support this option which is set
by default
+ }
+ }
}
public void setProperties(ServerSocket socket) throws SocketException{
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]