wrap closing of compressed streams in try-catch

pull/53/head
Zlatin Balevsky 2020-10-21 14:10:59 +01:00
parent cafe8858b9
commit 688beae1d6
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 12 additions and 4 deletions

View File

@ -399,7 +399,9 @@ class ConnectionAcceptor {
dos.write(json.getBytes(StandardCharsets.US_ASCII))
}
dos.flush()
try {
dos.close()
} catch (Exception ignored) {}
} finally {
e.close()
}
@ -522,7 +524,9 @@ class ConnectionAcceptor {
dos.writeShort(payload.length)
dos.write(payload)
}
try {
dos.close()
} catch (Exception ignored) {}
} finally {
e.close()
}
@ -584,7 +588,9 @@ class ConnectionAcceptor {
dos.write(json.getBytes(StandardCharsets.US_ASCII))
}
dos.flush()
try {
dos.close()
} catch(Exception ignore) {}
} finally {
e.close()
}

View File

@ -150,7 +150,9 @@ class ResultsSender {
dos.writeShort((short)json.length())
dos.write(json.getBytes(StandardCharsets.US_ASCII))
}
try {
dos.close()
} catch (Exception ignore) {}
} finally {
endpoint?.close()
}