zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivmaykov <...@git.apache.org>
Subject [GitHub] zookeeper pull request #679: ZOOKEEPER-3172: Quorum TLS - fix port unificati...
Date Wed, 14 Nov 2018 23:29:55 GMT
Github user ivmaykov commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/679#discussion_r233661570
  
    --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/PrependableSocket.java
---
    @@ -18,32 +18,47 @@
     
     package org.apache.zookeeper.server.quorum;
     
    -import java.io.ByteArrayInputStream;
     import java.io.IOException;
     import java.io.InputStream;
    -import java.io.SequenceInputStream;
    +import java.io.PushbackInputStream;
     import java.net.Socket;
     import java.net.SocketImpl;
     
     public class PrependableSocket extends Socket {
     
    -  private SequenceInputStream sequenceInputStream;
    +  private PushbackInputStream pushbackInputStream;
    --- End diff --
    
    Yes, SequenceInputStream likely still works in practice, but exposes the discontinuity
between the underlying streams to the caller. Using PushbackInputStream hides it and I think
is preferable.


---

Mime
View raw message