1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 21:17:58 +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>
*
* @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
* either null, or cannot be written to.
*/
@ -144,18 +144,24 @@ public class IncomingFileTransfer extends FileTransfer {
setException(e);
}
if (getStatus().equals(Status.in_progress))
if (getStatus().equals(Status.in_progress)) {
setStatus(Status.complete);
try {
if (inputStream != null) {
}
if (inputStream != null) {
try {
inputStream.close();
}
if (outputStream != null) {
outputStream.close();
catch(Throwable io) {
/* Ignore */
}
}
catch (IOException e) {
/** We need to do something here **/
if (outputStream != null) {
try {
outputStream.close();
}
catch (Throwable io) {
/* Ignore */
}
}
}
}, "File Transfer " + streamID);