chibenwa commented on code in PR #3130:
URL: https://github.com/apache/james-project/pull/3130#discussion_r3959445482


##########
server/testing/src/main/java/org/apache/james/utils/TestIMAPClient.java:
##########
@@ -50,38 +50,76 @@ public class TestIMAPClient extends ExternalResource 
implements Closeable, After
     private static final int MESSAGE_NUMBER_MATCHING_GROUP = 1;
     public static final String INBOX = "INBOX";
 
-    public static class Utf8IMAPSClient extends AuthenticatingIMAPClient {
+    /**
+     * commons-net announces and consumes IMAP literals in octets, but 
subtracts the
+     * {@link String#length()} of the lines it has decoded to know when a 
literal is over. Its
+     * streams therefore have to stay octet transparent - one char per octet, 
which is what its
+     * own ISO-8859-1 default gives. Decoding the socket as UTF-8 makes every 
multi-byte
+     * character count for one octet less than the server announced, so the 
client keeps reading
+     * past the literal, swallows the tagged reply as if it were message 
content and then blocks
+     * forever waiting for a completion line that has already gone by.
+     *
+     * UTF-8 is handled at {@link TestIMAPClient}'s own boundary instead: see
+     * {@link TestIMAPClient#asOctets(String)} and {@link 
TestIMAPClient#asText(String)}.
+     */

Review Comment:
   Well, working around our own test dependencies o_o



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to