You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:07:58 UTC

[GitHub] [geode] agingade commented on a change in pull request #6156: GEODE-6150_2: SSL selector impacts

agingade commented on a change in pull request #6156:
URL: https://github.com/apache/geode/pull/6156#discussion_r649618160



##########
File path: geode-core/src/main/java/org/apache/geode/internal/HeapDataOutputStream.java
##########
@@ -159,32 +161,32 @@ public int sendTo(SocketChannel chan) throws IOException {
     return result;
   }
 
-  public void sendTo(SocketChannel chan, ByteBuffer out) throws IOException {
+  public void sendTo(SocketChannel chan, ByteBuffer out, NioFilter ioFilter)
+      throws IOException {
     finishWriting();
     if (size() == 0) {
       return;
     }
     out.clear();
     if (this.chunks != null) {
       for (ByteBuffer bb : this.chunks) {
-        sendChunkTo(bb, chan, out);
+        sendChunkTo(bb, chan, out, ioFilter);
       }
     }
-    sendChunkTo(this.buffer, chan, out);
-    flushBuffer(chan, out);
+    sendChunkTo(this.buffer, chan, out, ioFilter);
+    flushBuffer(chan, out, ioFilter);
   }
 
   /**
    * sends the data from "in" by writing it to "sc" through "out" (out is used to chunk to data and
    * is probably a direct memory buffer).
    */
-  private void sendChunkTo(ByteBuffer in, SocketChannel sc, ByteBuffer out) throws IOException {
+  private void sendChunkTo(ByteBuffer in, SocketChannel sc, ByteBuffer out, NioFilter ioFilter)
+      throws IOException {
     int bytesSent = in.remaining();
     if (in.isDirect()) {
-      flushBuffer(sc, out);
-      while (in.remaining() > 0) {
-        sc.write(in);
-      }
+      flushBuffer(sc, out, ioFilter);
+      writeToSC(sc, in, ioFilter);

Review comment:
       I am not expert in this area. But from the code changes it looks like we are calling writeToSC twice now (in flushBuffer)...Is this expected?




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

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