You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by jo...@apache.org on 2020/05/08 18:31:15 UTC
[mina] branch 2.1.X updated (48cd514 -> eb00f70)
This is an automated email from the ASF dual-hosted git repository.
johnnyv pushed a change to branch 2.1.X
in repository https://gitbox.apache.org/repos/asf/mina.git.
omit 48cd514 Fix DIRMINA-1125
omit 6988ff0 Merge branch 'DIRMINA-1123' into 2.1.X
omit f789661 Configures the SND/RCV socket buffer before bind()
omit 55f4b4d Fix DIRMINA-996 adds "break" to prevent message sent loop
new 896b170 Fix DIRMINA-996
new d66c3dd Merge bugfix/DIRMINA-1123
new 6810baf Fix DIRMINA-1125
new eb00f70 Merge bugfix/DIRMINA-1126
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (48cd514)
\
N -- N -- N refs/heads/2.1.X (eb00f70)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/mina/core/write/DefaultWriteRequest.java | 2 +-
.../apache/mina/filter/codec/ProtocolCodecFilter.java | 19 ++++++++++++-------
.../mina/transport/socket/nio/NioSocketAcceptor.java | 6 ++----
3 files changed, 15 insertions(+), 12 deletions(-)
[mina] 01/04: Fix DIRMINA-996
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
johnnyv pushed a commit to branch 2.1.X
in repository https://gitbox.apache.org/repos/asf/mina.git
commit 896b170d8d7c0769bca171f0fbe7de9b13a65968
Author: johnnyv <jo...@apache.org>
AuthorDate: Wed Apr 15 11:41:23 2020 -0400
Fix DIRMINA-996
Adds "break" to prevent message sent loop
---
.../org/apache/mina/transport/socket/nio/NioDatagramAcceptor.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mina-core/src/main/java/org/apache/mina/transport/socket/nio/NioDatagramAcceptor.java b/mina-core/src/main/java/org/apache/mina/transport/socket/nio/NioDatagramAcceptor.java
index a2f7420..42b74ce 100644
--- a/mina-core/src/main/java/org/apache/mina/transport/socket/nio/NioDatagramAcceptor.java
+++ b/mina-core/src/main/java/org/apache/mina/transport/socket/nio/NioDatagramAcceptor.java
@@ -896,8 +896,10 @@ public final class NioDatagramAcceptor extends AbstractIoAcceptor implements Dat
// Kernel buffer is full or wrote too much
setInterestedInWrite(session, true);
- session.getWriteRequestQueue().offer(session, writeRequest);
+ writeRequestQueue.offer(session, writeRequest);
scheduleFlush(session);
+
+ break;
} else {
setInterestedInWrite(session, false);
[mina] 03/04: Fix DIRMINA-1125
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
johnnyv pushed a commit to branch 2.1.X
in repository https://gitbox.apache.org/repos/asf/mina.git
commit 6810bafb481df18022388f69bfaef367b6db8fb8
Author: johnnyv <jo...@apache.org>
AuthorDate: Wed Apr 29 22:41:39 2020 -0400
Fix DIRMINA-1125
Contextually replaces TLS with TLSv1.2
---
.../src/main/java/org/apache/mina/filter/ssl/SslContextFactory.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslContextFactory.java b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslContextFactory.java
index 04e3d4c..e05d3d6 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslContextFactory.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslContextFactory.java
@@ -36,7 +36,7 @@ import javax.net.ssl.TrustManagerFactory;
* If no properties are set the returned {@link SSLContext} will
* be equivalent to what the following creates:
* <pre>
- * SSLContext c = SSLContext.getInstance( "TLS" );
+ * SSLContext c = SSLContext.getInstance( "TLSv1.2" );
* c.init(null, null, null);
* </pre>
* <p>
@@ -52,7 +52,7 @@ public class SslContextFactory {
private String provider = null;
- private String protocol = "TLS";
+ private String protocol = "TLSv1.2";
private SecureRandom secureRandom = null;
[mina] 02/04: Merge bugfix/DIRMINA-1123
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
johnnyv pushed a commit to branch 2.1.X
in repository https://gitbox.apache.org/repos/asf/mina.git
commit d66c3dda78a37fcc81fdb7615e368b4f67c171f1
Author: johnnyv <jo...@apache.org>
AuthorDate: Wed Apr 15 17:55:57 2020 -0400
Merge bugfix/DIRMINA-1123
Configures the SND/RCV socket buffer before bind()
---
.../mina/transport/socket/nio/NioSocketAcceptor.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
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 f011ca1..5090d78 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
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.SocketAddress;
+import java.net.StandardSocketOptions;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
@@ -40,6 +41,7 @@ import org.apache.mina.core.service.SimpleIoProcessorPool;
import org.apache.mina.core.service.TransportMetadata;
import org.apache.mina.transport.socket.DefaultSocketSessionConfig;
import org.apache.mina.transport.socket.SocketAcceptor;
+import org.apache.mina.transport.socket.SocketSessionConfig;
/**
* {@link IoAcceptor} for socket transport (TCP/IP). This class
@@ -226,6 +228,8 @@ implements SocketAcceptor {
protected ServerSocketChannel open(SocketAddress localAddress) throws Exception {
// Creates the listening ServerSocket
+ SocketSessionConfig config = this.getSessionConfig();
+
ServerSocketChannel channel = null;
if (selectorProvider != null) {
@@ -245,6 +249,16 @@ implements SocketAcceptor {
// Set the reuseAddress flag accordingly with the setting
socket.setReuseAddress(isReuseAddress());
+
+ // Set the SND BUFF
+ if (config.getSendBufferSize() != -1) {
+ channel.setOption(StandardSocketOptions.SO_SNDBUF, config.getSendBufferSize());
+ }
+
+ // Set the RCV BUFF
+ if (config.getReceiveBufferSize() != -1) {
+ channel.setOption(StandardSocketOptions.SO_RCVBUF, config.getReceiveBufferSize());
+ }
// and bind.
try {
[mina] 04/04: Merge bugfix/DIRMINA-1126
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
johnnyv pushed a commit to branch 2.1.X
in repository https://gitbox.apache.org/repos/asf/mina.git
commit eb00f70780bcc2b7438c077396d09cafb8b78c3e
Author: johnnyv <jo...@apache.org>
AuthorDate: Fri May 8 14:22:33 2020 -0400
Merge bugfix/DIRMINA-1126
---
.../apache/mina/core/write/DefaultWriteRequest.java | 2 +-
.../apache/mina/filter/codec/ProtocolCodecFilter.java | 19 ++++++++++++-------
.../mina/transport/socket/nio/NioSocketAcceptor.java | 6 ++----
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java b/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java
index 8324c6a..49fe961 100644
--- a/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java
+++ b/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java
@@ -221,7 +221,7 @@ public class DefaultWriteRequest implements WriteRequest {
}
this.message = message;
- originalMessage = message;
+ this.originalMessage = message;
if (message instanceof IoBuffer) {
// duplicate it, so that any modification made on it
diff --git a/mina-core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java b/mina-core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
index 628e4f2..a460b3d 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
@@ -333,13 +333,18 @@ public class ProtocolCodecFilter extends IoFilterAdapter {
break;
}
- // Flush only when the buffer has remaining.
- if (!(encodedMessage instanceof IoBuffer) || ((IoBuffer) encodedMessage).hasRemaining()) {
- writeRequest.setMessage(encodedMessage);
-
- nextFilter.filterWrite(session, writeRequest);
- }
- }
+ // Flush only when the buffer has remaining.
+ if (!(encodedMessage instanceof IoBuffer) || ((IoBuffer) encodedMessage).hasRemaining()) {
+ if (bufferQueue.isEmpty()) {
+ writeRequest.setMessage(encodedMessage);
+ nextFilter.filterWrite(session, writeRequest);
+ } else {
+ SocketAddress destination = writeRequest.getDestination();
+ WriteRequest encodedWriteRequest = new EncodedWriteRequest(encodedMessage, null, destination);
+ nextFilter.filterWrite(session, encodedWriteRequest);
+ }
+ }
+ }
} catch (Exception e) {
ProtocolEncoderException pee;
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 5090d78..dc9e302 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
@@ -266,10 +266,8 @@ implements SocketAcceptor {
} catch (IOException ioe) {
// Add some info regarding the address we try to bind to the
// message
- String newMessage = "Error while binding on " + localAddress + "\n" + "original message : "
- + ioe.getMessage();
- Exception e = new IOException(newMessage);
- e.initCause(ioe.getCause());
+ String newMessage = "Error while binding on " + localAddress;
+ Exception e = new IOException(newMessage, ioe);
// And close the channel
channel.close();