1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-24 13:27:59 +01:00

Outputstream may not have been properly closed in case of error. SMACK-198

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7144 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Alex Wenckus 2007-02-15 17:33:44 +00:00 committed by alex
parent 9d598f1398
commit 0e85f25129

View file

@ -94,7 +94,7 @@ public class IncomingFileTransfer extends FileTransfer {
* </UL> * </UL>
* *
* @param file The location to save the file. * @param file The location to save the file.
* @throws XMPPException * @throws XMPPException when the file transfer fails
* @throws IllegalArgumentException This exception is thrown when the the provided file is * @throws IllegalArgumentException This exception is thrown when the the provided file is
* either null, or cannot be written to. * either null, or cannot be written to.
*/ */
@ -144,18 +144,24 @@ public class IncomingFileTransfer extends FileTransfer {
setException(e); setException(e);
} }
if (getStatus().equals(Status.in_progress)) if (getStatus().equals(Status.in_progress)) {
setStatus(Status.complete); setStatus(Status.complete);
try { }
if (inputStream != null) { if (inputStream != null) {
try {
inputStream.close(); inputStream.close();
} }
if (outputStream != null) { catch(Throwable io) {
outputStream.close(); /* Ignore */
} }
} }
catch (IOException e) { if (outputStream != null) {
/** We need to do something here **/ try {
outputStream.close();
}
catch (Throwable io) {
/* Ignore */
}
} }
} }
}, "File Transfer " + streamID); }, "File Transfer " + streamID);