Repository: qpid-proton-j
Updated Branches:
  refs/heads/master e7aae9469 -> ca492f66a


PROTON-1767 Allow for the sasl buffer to use a duplicate

Adds support in the SaslImpl for also exposing a duplicate buffer
instead of a read-only variant.

Project: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/commit/ca492f66
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/tree/ca492f66
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/diff/ca492f66

Branch: refs/heads/master
Commit: ca492f66ab9653afcdd1d0904b359e27a362859d
Parents: e7aae94
Author: Timothy Bish <tabish...@gmail.com>
Authored: Thu Feb 22 11:57:10 2018 -0500
Committer: Timothy Bish <tabish...@gmail.com>
Committed: Thu Feb 22 11:57:10 2018 -0500

----------------------------------------------------------------------
 .../java/org/apache/qpid/proton/engine/impl/SaslImpl.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/ca492f66/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java
----------------------------------------------------------------------
diff --git 
a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java 
b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java
index acbf5ea..9125625 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java
@@ -551,7 +551,13 @@ public class SaslImpl implements Sasl, 
SaslFrameBody.SaslFrameBodyHandler<Void>,
         {
             _underlyingInput = input;
             _underlyingOutput = output;
-            _head = _outputBuffer.asReadOnlyBuffer();
+
+            if (_transport.isUseReadOnlyOutputBuffer()) {
+                _head = _outputBuffer.asReadOnlyBuffer();
+            } else {
+                _head = _outputBuffer.duplicate();
+            }
+
             _head.limit(0);
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to