diff options
author | Ashwini Munigala <AshwiniM@codeaurora.org> | 2013-08-06 20:34:00 +0530 |
---|---|---|
committer | Ashwini Munigala <AshwiniM@codeaurora.org> | 2013-08-06 20:34:00 +0530 |
commit | effae0424c7af8caeea1e10a469a03ea3b2918f9 (patch) | |
tree | 1659f732b1e5fdb49130e5e451c8ddbd42a082bf /src/org/codeaurora/bluetooth/ftp | |
parent | a54b2bd1312c135e728283b76dac485fe98bddff (diff) | |
download | android_packages_apps_BluetoothExt-effae0424c7af8caeea1e10a469a03ea3b2918f9.tar.gz android_packages_apps_BluetoothExt-effae0424c7af8caeea1e10a469a03ea3b2918f9.tar.bz2 android_packages_apps_BluetoothExt-effae0424c7af8caeea1e10a469a03ea3b2918f9.zip |
FTP: Handle Abort exception in onPut Request.
Perform both close file stream and delete current file
on Abort Exception for onPut FTP Request.
Change-Id: Ie0b1eb80b9706a79285b6021cf5c304ce29b7399
CRs-fixed: 523330
Diffstat (limited to 'src/org/codeaurora/bluetooth/ftp')
-rw-r--r-- | src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java index f4e561b..b8f273c 100644 --- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java +++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java @@ -441,12 +441,7 @@ public class BluetoothFtpObexServer extends ServerRequestHandler { Log.e(TAG, "onPut File receive"+ e1.toString()); if (D) Log.d(TAG, "Error when receiving file"); ((ServerOperation)op).isAborted = true; - /* If the transfer completed due to a - * abort from Ftp client, clean up the - * file in the Server - */ - fileinfo.delete(); - return ResponseCodes.OBEX_HTTP_BAD_REQUEST; + sIsAborted = true; } long finishtimestamp = System.currentTimeMillis(); @@ -462,6 +457,16 @@ public class BluetoothFtpObexServer extends ServerRequestHandler { } } if(D) Log.d(TAG,"close Stream >"); + if(sIsAborted == true){ + sIsAborted = false; + /* If the transfer completed due to a + * abort from Ftp client, clean up the + * file in the Server + */ + fileinfo.delete(); + Log.e(TAG, " SET isAborted on excepton"); + return ResponseCodes.OBEX_HTTP_BAD_REQUEST; + } if (!closeStream(in_stream, op)) { if (D) Log.d(TAG,"Failed to close Input stream"); return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR; |