diff --git a/pom.xml b/pom.xml index 577dc5329..be613ea4b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.tonikelope MegaBasterd - 7.89 + 7.90 jar diff --git a/src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java b/src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java index d8a7df4b9..075d2cd13 100644 --- a/src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java +++ b/src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java @@ -152,8 +152,6 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable { String worker_url = null; - long pause_init_time, paused = 0L; - byte[] buffer = new byte[DEFAULT_BYTE_BUFFER_SIZE]; SmartMegaProxyManager proxy_manager = MainPanel.getProxy_manager(); @@ -164,12 +162,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable { _download.pause_worker(); - pause_init_time = System.currentTimeMillis(); - secureWait(); - - paused += System.currentTimeMillis() - pause_init_time; - } if (http_error == 509 && _509_timestamp == -1) { @@ -197,7 +190,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable { MainPanel.LAST_EXTERNAL_COMMAND_TIMESTAMP = -1; } - if (MainPanel.isUse_smart_proxy() && ((proxy_manager != null && proxy_manager.isForce_smart_proxy()) || _current_smart_proxy != null || http_error == 509 || (_509_timestamp != -1 && _509_timestamp + SMART_PROXY_RECHECK_509_TIME * 1000 < System.currentTimeMillis())) && !MainPanel.isUse_proxy()) { + if (MainPanel.isUse_smart_proxy() && ((proxy_manager != null && proxy_manager.isForce_smart_proxy()) || _current_smart_proxy != null || http_error == 509 || (_509_timestamp != -1 && _509_timestamp + SMART_PROXY_RECHECK_509_TIME * 1000 > System.currentTimeMillis())) && !MainPanel.isUse_proxy()) { if (_current_smart_proxy != null && chunk_error) { @@ -309,8 +302,6 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable { try (OutputStream tmp_chunk_file_os = new BufferedOutputStream(new FileOutputStream(tmp_chunk_file))) { - paused = 0L; - int reads = 0; if (!_exit && !_download.isStopped() && !_download.getChunkmanager().isExit()) { @@ -328,12 +319,8 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable { _download.pause_worker(); - pause_init_time = System.currentTimeMillis(); - secureWait(); - paused += System.currentTimeMillis() - pause_init_time; - } } @@ -374,7 +361,12 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable { http_error = 0; if (_current_smart_proxy != null && _509_timestamp != -1) { + _509_timestamp = -1; + + if (_download.isTurbo()) { + _download.disableTurboMode(); + } } _excluded_proxy_list.clear(); diff --git a/src/main/java/com/tonikelope/megabasterd/Download.java b/src/main/java/com/tonikelope/megabasterd/Download.java index 41a0d5e34..02848808a 100644 --- a/src/main/java/com/tonikelope/megabasterd/Download.java +++ b/src/main/java/com/tonikelope/megabasterd/Download.java @@ -250,6 +250,19 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif } } + public void disableTurboMode() { + synchronized (_turbo_proxy_lock) { + if (_turbo) { + _turbo = false; + MiscTools.GUIRun(() -> { + + getView().getSpeed_label().setForeground(Color.BLACK); + + }); + } + } + } + public void enableTurboMode() { synchronized (_turbo_proxy_lock) { diff --git a/src/main/java/com/tonikelope/megabasterd/MainPanel.java b/src/main/java/com/tonikelope/megabasterd/MainPanel.java index 9bb9ad2ad..0890ed14b 100644 --- a/src/main/java/com/tonikelope/megabasterd/MainPanel.java +++ b/src/main/java/com/tonikelope/megabasterd/MainPanel.java @@ -69,7 +69,7 @@ import javax.swing.UIManager; */ public final class MainPanel { - public static final String VERSION = "7.89"; + public static final String VERSION = "7.90"; public static final boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY public static final int THROTTLE_SLICE_SIZE = 16 * 1024; public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;