Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Set 10 second timeout on JGit transport commands #1230

Merged
merged 2 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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
}
}