chibenwa commented on pull request #886:
URL: https://github.com/apache/james-project/pull/886#issuecomment-1050602912


   @ff-wl I found something... In `ChannelImapResponseWriter` resorting to push 
a byte array makes the test turn :green_apple: 
   
   CF:
   
   ```
       @Override
       public void write(Literal literal) throws IOException {
           if (channel.isActive()) {
               InputStream in = literal.getInputStream();
               if (in instanceof FileInputStream) {
                   FileChannel fc = ((FileInputStream) in).getChannel();
                   // Zero-copy is only possible if no SSL/TLS  and no COMPRESS 
is in place
                   //
                   // See JAMES-1305 and JAMES-1306
                   ChannelPipeline cp = channel.pipeline();
                   if (zeroCopy && cp.get(SslHandler.class) == null && 
cp.get(ZlibEncoder.class) == null) {
                       channel.writeAndFlush(new DefaultFileRegion(fc, 
fc.position(), literal.size()));
                   } else {
                       channel.writeAndFlush(new ChunkedNioFile(fc, 8192));
                   }
               } else {
                   
channel.writeAndFlush((Unpooled.wrappedBuffer(IOUtils.toByteArray(literal.getInputStream()))));
               }
           }
       }
   ```
   
   Thus I'd be looking in details how `LimitingInputStream` behaves when being 
chuncked...


-- 
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