You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/03/30 03:55:45 UTC

[james-project] 06/06: JAMES-1862 ExternalSession should write full line at once

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit d7a2d237c16143d755fdb312b133c1be38b27707
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Mar 23 17:51:51 2022 +0700

    JAMES-1862 ExternalSession should write full line at once
---
 .../main/java/org/apache/james/mpt/session/ExternalSession.java  | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java b/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java
index 38c83d5..0997d51 100644
--- a/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java
+++ b/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java
@@ -160,14 +160,7 @@ public final class ExternalSession implements Session {
     public void writeLine(String line) throws Exception {
         monitor.note("-> " + line);
         monitor.debug("[Writing line]");
-        ByteBuffer writeBuffer = US_ASCII.encode(line);
-        while (writeBuffer.hasRemaining()) {
-            socket.write(writeBuffer);
-        }
-        lineEndBuffer.rewind();
-        while (lineEndBuffer.hasRemaining()) {
-            socket.write(lineEndBuffer);
-        }
+        socket.write(ByteBuffer.wrap((line + "\r\n").getBytes(US_ASCII)));
         monitor.debug("[Done]");
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org