From b5d86aa9defd685d97459dfc6224d820be4ceb7a Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Tue, 1 Oct 2013 12:56:20 +0200 Subject: [PATCH] Granted creation of a new client object (with a new socket) when the network connection is lost --- src/com/owncloud/android/files/services/FileUploader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/owncloud/android/files/services/FileUploader.java b/src/com/owncloud/android/files/services/FileUploader.java index 0f1e9cdb..06d834fd 100644 --- a/src/com/owncloud/android/files/services/FileUploader.java +++ b/src/com/owncloud/android/files/services/FileUploader.java @@ -78,7 +78,6 @@ import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.ui.activity.InstantUploadActivity; import com.owncloud.android.ui.preview.PreviewImageActivity; import com.owncloud.android.ui.preview.PreviewImageFragment; -import com.owncloud.android.utils.FileStorageUtils; import eu.alefzero.webdav.WebdavClient; @@ -529,6 +528,11 @@ public class FileUploader extends Service implements OnDatatransferProgressListe mPendingUploads.remove(uploadKey); Log_OC.i(TAG, "Remove CurrentUploadItem from pending upload Item Map."); } + if (uploadResult.isException()) { + // enforce the creation of a new client object for next uploads; this grant that a new socket will + // be created in the future if the current exception is due to an abrupt lose of network connection + mUploadClient = null; + } } /// notify result -- 2.11.0