Skip to content

Commit

Permalink
Properly close/flush TransportOutputStream.
Browse files Browse the repository at this point in the history
Resolves #1206,#1207.
  • Loading branch information
leaqui authored and gregturn committed Dec 1, 2021
1 parent d2eda53 commit ebd7f4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ private InputStream getInputStream() throws IOException {

@Override
public void close() throws IOException {
getInputStream().close();
if (inputStream != null) {
getInputStream().close();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ private OutputStream getOutputStream() throws IOException {

@Override
public void close() throws IOException {
getOutputStream().close();
if (outputStream != null) {
getOutputStream().close();
}
}

@Override
public void flush() throws IOException {
getOutputStream().flush();
if (outputStream != null) {
getOutputStream().flush();
}
}

@Override
Expand Down

0 comments on commit ebd7f4a

Please sign in to comment.