<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>option to discard slow proxies</title>
        <description> First of all I want to thank you – FreeRapid is truly a great project! :-)

I often have trouble with slow proxies screwing up downloads (I have to re-get 3-4 files manually while the rest all finished hours ago).
How about an option like this:

X discard proxies if slower than ___5 kb/s after ___60 seconds, ___3 times
(one checkbox, three int-spinners)

When checked, this would remove a proxy if it was slower than 5 kb/s (on average!) after a minute for three times.
In other words: it would restart the download with a different proxy if after a minute the average transfer rate would be below 5 kb/s. If this happened three times the proxy would be deleted and never used again.

I wanted to implement this myself, but when I looked into the code I got lost, honestly.

I hope you find something like this to be a useful idea.
Keep up the good work!
                                                       LC</description>
        <link>https://wordrider.net/forum/11/9544/9544/_subject_#msg-9544</link>
        <lastBuildDate>Tue, 07 Apr 2026 16:18:49 +0000</lastBuildDate>
        <generator>Phorum 5.2.10</generator>
        <item>
            <guid>https://wordrider.net/forum/11/9544/11011/_subject_#msg-11011</guid>
            <title>Re: option to discard slow proxies</title>
            <link>https://wordrider.net/forum/11/9544/11011/_subject_#msg-11011</link>
            <description><![CDATA[ How do I implement this patch?]]></description>
            <dc:creator>torinohito</dc:creator>
            <category>FreeRapid Downloader - Features</category>
            <pubDate>Wed, 31 Oct 2012 18:02:05 +0000</pubDate>
        </item>
        <item>
            <guid>https://wordrider.net/forum/11/9544/9595/_subject_#msg-9595</guid>
            <title>Implemented as a dirty hack - works great (tu)</title>
            <link>https://wordrider.net/forum/11/9544/9595/_subject_#msg-9595</link>
            <description><![CDATA[ <b><span style="font-size:medium">I've implemented it as a quick and dirty hack. Works like a miracle!</span></b><br />
<br />
<br />
patch:<br />
<br />
<br />
<br />
<pre class="bbcode">
Index: src/cz/vity/freerapid/core/tasks/SpeedRegulator.java
===================================================================
--- src/cz/vity/freerapid/core/tasks/SpeedRegulator.java	(revision 3534)
+++ src/cz/vity/freerapid/core/tasks/SpeedRegulator.java	(working copy)
@@ -2,10 +2,12 @@
 
 import cz.vity.freerapid.core.AppPrefs;
 import cz.vity.freerapid.core.UserProp;
+import cz.vity.freerapid.gui.managers.ManagerDirector;
 import cz.vity.freerapid.model.DownloadFile;
 import cz.vity.freerapid.plugins.webclient.DownloadState;
 
 import javax.swing.event.SwingPropertyChangeSupport;
+import java.awt.datatransfer.StringSelection;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.*;
@@ -17,6 +19,9 @@
  * @author Vity
  */
 public final class SpeedRegulator implements PropertyChangeListener {
+// My modifications:
+    private ManagerDirector manager_director;
+
     private final static Logger logger = Logger.getLogger(SpeedRegulator.class.getName());
 
     private Map<DownloadFile, DownloadFileInfo> downloading = new Hashtable<DownloadFile, DownloadFileInfo>(10);
@@ -29,8 +34,10 @@
     private volatile long speed;
     private volatile float averageSpeed;
 
+// My modifications:
+    public SpeedRegulator( ManagerDirector d ) {
+        this.manager_director = d;
 
-    public SpeedRegulator() {
         timer = null;
         speed = 0;
         averageSpeed = 0;
@@ -180,7 +187,9 @@
             file.setTokensLimit(Integer.MAX_VALUE);
             file.setSpeed(0);
             file.setAverageSpeed(0);
-            downloading.put(file, new DownloadFileInfo(task));
+// My modifications:
+            downloading.put(file, new DownloadFileInfo( task, manager_director ));
+
             if (timer == null) {
                 timer = new Timer("SpeedRegulatorTimer");
                 timer.schedule(new TimerTask() {
@@ -226,6 +235,10 @@
     }
 
     private static class DownloadFileInfo {
+// My modifications:
+DownloadFile debug_exception;
+        private ManagerDirector manager_director;
+
         private volatile long counter = 0;
         private long lastSize = 0;
         private int noDataTimeOut = 0; //XXX seconds to timeout
@@ -243,7 +256,10 @@
         private float averageSpeed;
         private long downloadedStart;
 
-        DownloadFileInfo(DownloadTask task) {
+// My modifications:
+        DownloadFileInfo( DownloadTask task, ManagerDirector director ) {
+            this.manager_director = director;
+
             this.task = task;
             this.file = task.getDownloadFile();
             downloadedStart = this.file.getDownloaded();
@@ -275,8 +291,43 @@
 
             // task.setSpeed(speed);
             file.setSpeed(speed);
-            if (speed == 0) {
-                if (++noDataTimeOut &gt;= NO_DATA_TIMEOUT_LIMIT) { //X seconds with no data
+// My modifications:
+            final long Default_Min_Seconds_Before_Proxy_Avg_Chk = 20 * 1000;         // * 1000 = seconds
+            final float Default_Proxy_Min_Avg_Speed_Before_50_Percent = 15 * 1024.0F;   // * 1024 = kb/s
+            final float Default_Proxy_Min_Avg_Speed_Before_80_Percent = 10 * 1024.0F;
+            final float Default_Proxy_Min_Avg_Speed_Before_90_Percent = 5 * 1024.0F;
+            final float Default_Proxy_Min_Avg_Speed_After_90_Percent = 1 * 1024.0F;
+            long current_time = System.currentTimeMillis();
+            String proxy_url = file.getConnectionSettings().getProxyURL();
+            boolean proxy_is_too_slow = false;
+            double percent_complete = ( 100.0 / file.getFileSize() ) * lastSize;
+            if( ( ( current_time - startTime ) &gt; Default_Min_Seconds_Before_Proxy_Avg_Chk ) ) {
+                if( ( percent_complete &lt; 50.0 ) &&
+                    ( file.getAverageSpeed() &lt; Default_Proxy_Min_Avg_Speed_Before_50_Percent ) ) {
+//String s = debug_exception.getFileName();
+                    proxy_is_too_slow = true;
+                } else if( ( percent_complete &lt; 80.0 ) &&
+                           ( file.getAverageSpeed() &lt; Default_Proxy_Min_Avg_Speed_Before_80_Percent ) ) {
+//String s = debug_exception.getFileName();
+                    proxy_is_too_slow = true;
+                } else if( ( percent_complete &lt; 90.0 ) &&
+                           ( file.getAverageSpeed() &lt; Default_Proxy_Min_Avg_Speed_Before_90_Percent ) ) {
+//String s = debug_exception.getFileName();
+                    proxy_is_too_slow = true;
+                } else if( file.getAverageSpeed() &lt; Default_Proxy_Min_Avg_Speed_After_90_Percent ) {
+//String s = debug_exception.getFileName();
+                    proxy_is_too_slow = true;
+                }
+                if( proxy_is_too_slow ) {
+//String s = debug_exception.getFileName();
+                    manager_director.getClientManager().setConnectionEnabled( file.getConnectionSettings(), false );
+                    manager_director.getClientManager().updateProxyConnectionList();
+                }
+            }
+            if( speed == 0 || proxy_is_too_slow ) {
+                if( proxy_is_too_slow || ( ++noDataTimeOut &gt;= NO_DATA_TIMEOUT_LIMIT ) ) { //X seconds with no data
+                    if( proxy_is_too_slow )
+                        noDataTimeOut = 0;
                     logger.info("Cancelling download - no downloaded data during " + NO_DATA_TIMEOUT_LIMIT + " seconds");
                     averageSpeed = 0;
                     task.setConnectionTimeOut(true);
Index: src/cz/vity/freerapid/gui/managers/ClientManager.java
===================================================================
--- src/cz/vity/freerapid/gui/managers/ClientManager.java	(revision 3534)
+++ src/cz/vity/freerapid/gui/managers/ClientManager.java	(working copy)
@@ -35,7 +35,8 @@
     private final List<ConnectionSettings> availableConnections = new ArrayList<ConnectionSettings>(2);
     private Stack<HttpDownloadClient> workingClientsPool = new Stack<HttpDownloadClient>();
     private static final String PROXY_LIST_DEFAULT_PATH = new File(Utils.getAppPath(), "proxy.list").getAbsolutePath();
-    public static final int MAX_DOWNLOADING = 10;
+// My modifications:
+    public static final int MAX_DOWNLOADING = 100000;
 
     private ConnectionSettings defaultConnectionSettings = new ConnectionSettings();
 
Index: src/cz/vity/freerapid/gui/managers/ManagerDirector.java
===================================================================
--- src/cz/vity/freerapid/gui/managers/ManagerDirector.java	(revision 3534)
+++ src/cz/vity/freerapid/gui/managers/ManagerDirector.java	(working copy)
@@ -240,7 +240,8 @@
 
     public SpeedRegulator getSpeedRegulator() {
         if (speedRegulator == null) {
-            speedRegulator = new SpeedRegulator();
+// My modifications:
+            speedRegulator = new SpeedRegulator( this );
         }
         return speedRegulator;
     }
</pre>]]></description>
            <dc:creator>LC</dc:creator>
            <category>FreeRapid Downloader - Features</category>
            <pubDate>Tue, 10 Apr 2012 09:17:39 +0000</pubDate>
        </item>
        <item>
            <guid>https://wordrider.net/forum/11/9544/9544/_subject_#msg-9544</guid>
            <title>option to discard slow proxies</title>
            <link>https://wordrider.net/forum/11/9544/9544/_subject_#msg-9544</link>
            <description><![CDATA[ <b>First of all I want to thank you – FreeRapid is truly a great project! :-)</b><br />
<br />
I often have trouble with slow proxies screwing up downloads (I have to re-get 3-4 files manually while the rest all finished hours ago).<br />
How about an option like this:<br />
<br />
<i>X discard proxies if slower than ___5 kb/s after ___60 seconds, ___3 times</i><br />
(one checkbox, three int-spinners)<br />
<br />
When checked, this would remove a proxy if it was slower than 5 kb/s (on average!) after a minute for three times.<br />
In other words: it would restart the download with a different proxy if after a minute the average transfer rate would be below 5 kb/s. If this happened three times the proxy would be deleted and never used again.<br />
<br />
I wanted to implement this myself, but when I looked into the code I got lost, honestly.<br />
<br />
I hope you find something like this to be a useful idea.<br />
Keep up the good work!<br />
                                                       <center class="bbcode">LC</center>]]></description>
            <dc:creator>LC</dc:creator>
            <category>FreeRapid Downloader - Features</category>
            <pubDate>Wed, 04 Apr 2012 13:17:06 +0000</pubDate>
        </item>
    </channel>
</rss>
