mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-24 05:27:56 +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:
parent
9d598f1398
commit
0e85f25129
1 changed files with 14 additions and 8 deletions
|
@ -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) {
|
||||
try {
|
||||
inputStream.close();
|
||||
}
|
||||
catch(Throwable io) {
|
||||
/* Ignore */
|
||||
}
|
||||
}
|
||||
if (outputStream != null) {
|
||||
try {
|
||||
outputStream.close();
|
||||
}
|
||||
catch (Throwable io) {
|
||||
/* Ignore */
|
||||
}
|
||||
catch (IOException e) {
|
||||
/** We need to do something here **/
|
||||
}
|
||||
}
|
||||
}, "File Transfer " + streamID);
|
||||
|
|
Loading…
Reference in a new issue