X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/48f13c8adc5c4b9bc4ca96bf13939a7d7cfae562..bf3cf8cdffa1f9debaaaef1da13c9b8c4b9c1bb0:/src/com/owncloud/android/authenticator/ConnectionCheckOperation.java diff --git a/src/com/owncloud/android/authenticator/ConnectionCheckOperation.java b/src/com/owncloud/android/authenticator/ConnectionCheckOperation.java index de110516..61492367 100644 --- a/src/com/owncloud/android/authenticator/ConnectionCheckOperation.java +++ b/src/com/owncloud/android/authenticator/ConnectionCheckOperation.java @@ -24,7 +24,6 @@ import org.json.JSONException; import org.json.JSONObject; import com.owncloud.android.AccountUtils; -import com.owncloud.android.network.SslAnalyzer; import com.owncloud.android.operations.RemoteOperation; import com.owncloud.android.operations.RemoteOperationResult; import com.owncloud.android.utils.OwnCloudVersion; @@ -40,7 +39,7 @@ public class ConnectionCheckOperation extends RemoteOperation { /** Maximum time to wait for a response from the server when the connection is being tested, in MILLISECONDs. */ public static final int TRY_CONNECTION_TIMEOUT = 5000; - private static final String TAG = ConnectionCheckerRunnable.class.getCanonicalName(); + private static final String TAG = ConnectionCheckOperation.class.getCanonicalName(); private String mUrl; private RemoteOperationResult mLatestResult; @@ -84,16 +83,24 @@ public class ConnectionCheckOperation extends RemoteOperation { } catch (JSONException e) { mLatestResult = new RemoteOperationResult(RemoteOperationResult.ResultCode.INSTANCE_NOT_CONFIGURED); - //Log.e(TAG, "JSON exception while trying connection (instance not configured) ", e); } catch (Exception e) { mLatestResult = new RemoteOperationResult(e); - //Log.e(TAG, "Unexpected exception while trying connection", e); } finally { if (get != null) get.releaseConnection(); } + + if (mLatestResult.isSuccess()) { + Log.i(TAG, "Connection check at " + urlSt + ": " + mLatestResult.getLogMessage()); + + } else if (mLatestResult.getException() != null) { + Log.e(TAG, "Connection check at " + urlSt + ": " + mLatestResult.getLogMessage(), mLatestResult.getException()); + + } else { + Log.e(TAG, "Connection check at " + urlSt + ": " + mLatestResult.getLogMessage()); + } return retval; } @@ -122,7 +129,7 @@ public class ConnectionCheckOperation extends RemoteOperation { if (tryConnection(client, "https://" + mUrl + AccountUtils.STATUS_PATH)) { return new RemoteOperationResult(RemoteOperationResult.ResultCode.OK_SSL); - } else if (!SslAnalyzer.isRecoverable(mLatestResult)) { + } else if (!mLatestResult.isSslRecoverableException()) { Log.d(TAG, "establishing secure connection failed, trying non secure connection"); client.setBaseUri(Uri.parse("http://" + mUrl + AccountUtils.STATUS_PATH)); @@ -133,5 +140,5 @@ public class ConnectionCheckOperation extends RemoteOperation { return mLatestResult; } } - + }