[tbb-commits] [tor-browser-build/master] Bug 30380 - Add patch for canceling Dormant by startup
gk at torproject.org
gk at torproject.org
Thu Sep 26 16:24:34 UTC 2019
commit e30f06ac6c40a32354fe01a2613fb3c2a63e630c
Author: Matthew Finkel <sysrqb at torproject.org>
Date: Thu Sep 26 00:52:18 2019 +0000
Bug 30380 - Add patch for canceling Dormant by startup
---
projects/tor-onion-proxy-library/build | 1 +
.../tor-onion-proxy-library/canceldormant.patch | 46 ++++++++++++++++++++++
projects/tor-onion-proxy-library/config | 1 +
3 files changed, 48 insertions(+)
diff --git a/projects/tor-onion-proxy-library/build b/projects/tor-onion-proxy-library/build
index 605f017..41cc815 100644
--- a/projects/tor-onion-proxy-library/build
+++ b/projects/tor-onion-proxy-library/build
@@ -18,6 +18,7 @@ tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
# Patch projects
cd /var/tmp/build/[% project %]-[% c('version') %]
patch -p1 < $rootdir/gradle.patch
+patch -p1 < $rootdir/canceldormant.patch
# Build Android Libraries and Apps
$GRADLE_HOME/gradle-4.10.2/bin/gradle --offline --no-daemon -P androidplugin=3.1.0 -Dmaven.repo.local=$gradle_repo assembleRelease -x lint
diff --git a/projects/tor-onion-proxy-library/canceldormant.patch b/projects/tor-onion-proxy-library/canceldormant.patch
new file mode 100644
index 0000000..8d48af1
--- /dev/null
+++ b/projects/tor-onion-proxy-library/canceldormant.patch
@@ -0,0 +1,46 @@
+diff --git a/universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java b/universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java
+index 5f5adac..da6747f 100644
+--- a/universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java
++++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java
+@@ -187,4 +187,9 @@ public class DefaultSettings implements TorSettings {
+ public boolean useSocks5() {
+ return false;
+ }
++
++ @Override
++ public boolean hasDormantCanceledByStartup() {
++ return false;
++ }
+ }
+diff --git a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
+index e324d9f..99e5693 100644
+--- a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
++++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
+@@ -503,6 +503,16 @@ public final class TorConfigBuilder {
+ return virtualAddressNetwork(settings.getVirtualAddressNetwork());
+ }
+
++ public TorConfigBuilder dormantCanceledByStartup() {
++ buffer.append("DormantCanceledByStartup 1").append('\n');
++ return this;
++ }
++
++ @SettingsConfig
++ public TorConfigBuilder domantCanceledByStartupFromSettings() {
++ return settings.hasDormantCanceledByStartup() ? dormantCanceledByStartup() : this;
++ }
++
+ /**
+ * Adds bridges from a resource stream. This relies on the TorInstaller to know how to obtain this stream.
+ * These entries may be type-specified like:
+diff --git a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorSettings.java b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorSettings.java
+index 2d515d1..43f01ef 100644
+--- a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorSettings.java
++++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorSettings.java
+@@ -77,4 +77,6 @@ public interface TorSettings {
+ String transPort();
+
+ boolean useSocks5();
++
++ boolean hasDormantCanceledByStartup();
+ }
diff --git a/projects/tor-onion-proxy-library/config b/projects/tor-onion-proxy-library/config
index 02b69ac..c2bd1a4 100644
--- a/projects/tor-onion-proxy-library/config
+++ b/projects/tor-onion-proxy-library/config
@@ -29,3 +29,4 @@ input_files:
name: gradle-dependencies
exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
- filename: gradle.patch
+ - filename: canceldormant.patch
More information about the tbb-commits
mailing list