src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java
branchJDK-8145252-TLS13-branch
changeset 56712 bad9f4c7eeec
parent 56694 aa54a1f8e426
child 56717 e4fe7c97b1de
equal deleted inserted replaced
56711:ad4c1c488574 56712:bad9f4c7eeec
    60         super(handshakeHash, SSLReadCipher.nullTlsReadCipher());
    60         super(handshakeHash, SSLReadCipher.nullTlsReadCipher());
    61     }
    61     }
    62 
    62 
    63     @Override
    63     @Override
    64     int bytesInCompletePacket() throws IOException {
    64     int bytesInCompletePacket() throws IOException {
    65 
       
    66         if (!hasHeader) {
    65         if (!hasHeader) {
    67             // read exactly one record
    66             // read exactly one record
    68             int really = read(is, temporary, 0, headerSize);
    67             try {
    69             if (really < 0) {
    68                 int really = read(is, temporary, 0, headerSize);
    70                 // EOF: peer shut down incorrectly
    69                 if (really < 0) {
       
    70                     // EOF: peer shut down incorrectly
       
    71                     return -1;
       
    72                 }
       
    73             } catch (EOFException eofe) {
       
    74                 // The caller will handle EOF.
    71                 return -1;
    75                 return -1;
    72             }
    76             }
    73             hasHeader = true;
    77             hasHeader = true;
    74         }
    78         }
    75 
    79