TLS: Fail connection on InterruptedIOException for blocking writes
@@ -420,7 +420,16 @@ void writeRecord(short type, byte[] plaintext, int plaintextOffset, int plaintex
TlsUtils.writeVersion(writeVersion, record, RecordFormat.VERSION_OFFSET);
TlsUtils.writeUint16(ciphertext.length, record, RecordFormat.LENGTH_OFFSET);
System.arraycopy(ciphertext, 0, record, RecordFormat.FRAGMENT_OFFSET, ciphertext.length);
+
+ try
+ {
output.write(record);
+ }
+ catch (InterruptedIOException e)
+ {
+ throw new TlsFatalAlert(AlertDescription.internal_error, e);
+ }
+
output.flush();
}
