You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2022/02/08 01:55:57 UTC

[mina] branch 2.0.X updated: Applied patch from DIRMINA-1130

This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch 2.0.X
in repository https://gitbox.apache.org/repos/asf/mina.git


The following commit(s) were added to refs/heads/2.0.X by this push:
     new 9a8d1da  Applied patch from DIRMINA-1130
9a8d1da is described below

commit 9a8d1da279dfbd4302678bfb0495bb3277a4b2ad
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Tue Feb 8 02:55:46 2022 +0100

    Applied patch from DIRMINA-1130
---
 .../java/org/apache/mina/transport/socket/nio/NioSocketAcceptor.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mina-core/src/main/java/org/apache/mina/transport/socket/nio/NioSocketAcceptor.java b/mina-core/src/main/java/org/apache/mina/transport/socket/nio/NioSocketAcceptor.java
index 3b470ca..b0bebaf 100644
--- a/mina-core/src/main/java/org/apache/mina/transport/socket/nio/NioSocketAcceptor.java
+++ b/mina-core/src/main/java/org/apache/mina/transport/socket/nio/NioSocketAcceptor.java
@@ -251,12 +251,12 @@ public  class NioSocketAcceptor extends AbstractPollingIoAcceptor<NioSession, Se
             socket.setReuseAddress(isReuseAddress());
 
             // Set the SND BUFF
-            if (config.getSendBufferSize() != -1) {
+            if (config.getSendBufferSize() != -1 && channel.supportedOptions().contains(StandardSocketOptions.SO_SNDBUF)) {
                 channel.setOption(StandardSocketOptions.SO_SNDBUF, config.getSendBufferSize());
             }
 
             // Set the RCV BUFF
-            if (config.getReceiveBufferSize() != -1) {
+            if (config.getReceiveBufferSize() != -1 && channel.supportedOptions().contains(StandardSocketOptions.SO_RCVBUF)) {
                 channel.setOption(StandardSocketOptions.SO_RCVBUF, config.getReceiveBufferSize());
             }