summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt9
2 files changed, 10 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c40acf6f..8a0466b7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
- Icons in Autofill suggestions are no longer black on almost black in dark mode.
- Decrypt screen would stay in memory infinitely, allowing passwords to be seen without re-auth
- Git commits in the store would wrongly use the 'default' committer as opposed to the user's configured one
+- Connection attempts now use a reasonable 10 second timeout as opposed to the default of 30 seconds
## [1.13.1] - 2020-10-23
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt b/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt
index 491feaf0..5649e8de 100644
--- a/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt
@@ -108,6 +108,7 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) {
(transport as? SshTransport)?.sshSessionFactory = sshSessionFactory
credentialsProvider?.let { transport.credentialsProvider = it }
}
+ command.setTimeout(CONNECT_TIMEOUT)
}
}
@@ -204,4 +205,12 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) {
sshSessionFactory?.close()
}
}
+
+ companion object {
+
+ /**
+ * Timeout in seconds before [TransportCommand] will abort a stalled IO operation.
+ */
+ private const val CONNECT_TIMEOUT = 10
+ }
}