You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/05/30 09:31:10 UTC

[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1030: [PERF] Improve SMTP performance

quantranhong1999 commented on code in PR #1030:
URL: https://github.com/apache/james-project/pull/1030#discussion_r884622154


##########
protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java:
##########
@@ -58,16 +57,15 @@ public class DataLineMessageHookHandler implements DataLineFilter, ExtensibleHan
     private List<?> rHooks;
 
     @Override
-    public Response onLine(SMTPSession session, ByteBuffer line, LineHandler<SMTPSession> next) {
+    public Response onLine(SMTPSession session, byte[] line, LineHandler<SMTPSession> next) {
         MailEnvelope env = session.getAttachment(DataCmdHandler.MAILENV, ProtocolSession.State.Transaction)
             .orElseThrow(() -> new RuntimeException("'" + DataCmdHandler.MAILENV.asString() + "' has not been filled."));
 
         OutputStream out = getMessageOutputStream(env);
         try {
             // 46 is "."
-            // Stream terminated            
-            int c = line.get();
-            if (line.remaining() == 2 && c == 46) {
+            // Stream terminated
+            if (line.length == 3 && line[0] == 46) {

Review Comment:
   ```suggestion
               if (line.length == 2 && line[0] == 46) {
   ```



-- 
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: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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