canceldormant.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. diff --git a/universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java b/universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java
  2. index 5f5adac..da6747f 100644
  3. --- a/universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java
  4. +++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java
  5. @@ -187,4 +187,9 @@ public class DefaultSettings implements TorSettings {
  6. public boolean useSocks5() {
  7. return false;
  8. }
  9. +
  10. + @Override
  11. + public boolean hasDormantCanceledByStartup() {
  12. + return false;
  13. + }
  14. }
  15. diff --git a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
  16. index e324d9f..99e5693 100644
  17. --- a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
  18. +++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
  19. @@ -503,6 +503,16 @@ public final class TorConfigBuilder {
  20. return virtualAddressNetwork(settings.getVirtualAddressNetwork());
  21. }
  22. + public TorConfigBuilder dormantCanceledByStartup() {
  23. + buffer.append("DormantCanceledByStartup 1").append('\n');
  24. + return this;
  25. + }
  26. +
  27. + @SettingsConfig
  28. + public TorConfigBuilder domantCanceledByStartupFromSettings() {
  29. + return settings.hasDormantCanceledByStartup() ? dormantCanceledByStartup() : this;
  30. + }
  31. +
  32. /**
  33. * Adds bridges from a resource stream. This relies on the TorInstaller to know how to obtain this stream.
  34. * These entries may be type-specified like:
  35. diff --git a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorSettings.java b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorSettings.java
  36. index 2d515d1..43f01ef 100644
  37. --- a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorSettings.java
  38. +++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorSettings.java
  39. @@ -77,4 +77,6 @@ public interface TorSettings {
  40. String transPort();
  41. boolean useSocks5();
  42. +
  43. + boolean hasDormantCanceledByStartup();
  44. }