diff options
author | 2010-06-24 23:53:06 +0300 | |
---|---|---|
committer | 2010-06-24 23:53:06 +0300 | |
commit | 426c9e5356cd9aba2f7d63c04a0fe9e12668256c (patch) | |
tree | da29055c6aa7b02988bc8e7b3d4a4896097216dc | |
parent | Add [logs] section to segget.conf (diff) | |
download | idfetch-426c9e5356cd9aba2f7d63c04a0fe9e12668256c.tar.gz idfetch-426c9e5356cd9aba2f7d63c04a0fe9e12668256c.tar.bz2 idfetch-426c9e5356cd9aba2f7d63c04a0fe9e12668256c.zip |
Change default values for settings.
max_tries=10
ftp_response_timeout=180
timeout=500
max_connections_num_per_mirror=1
proxy_port=3128.
-rw-r--r-- | segget/distfile.cpp | 14 | ||||
-rw-r--r-- | segget/mirror.cpp | 20 | ||||
-rw-r--r-- | segget/segget.conf | 20 | ||||
-rw-r--r-- | segget/settings.h | 10 |
4 files changed, 32 insertions, 32 deletions
diff --git a/segget/distfile.cpp b/segget/distfile.cpp index e4f17f0..14cafcf 100644 --- a/segget/distfile.cpp +++ b/segget/distfile.cpp @@ -157,25 +157,25 @@ void Tdistfile::provide_segment(CURLM* cm, uint connection_num, uint seg_num){ uint best_mirror_num=-1; // Pcurr_mirror=find_mirror(strip_mirror_name(url_list[best_mirror_num])); Pbest_mirror=0; - ulong best_mirror_laziness_criterion=-1; - double curr_mirror_laziness_criterion; + ulong best_mirror_self_rating=-1; + ulong curr_mirror_self_rating; for (url_num=0; url_num<url_count; url_num++){ Pcurr_mirror=find_mirror(strip_mirror_name(url_list[url_num])); if (Pcurr_mirror->get_active_num()<settings.max_connections_num_per_mirror){ - curr_mirror_laziness_criterion=Pcurr_mirror->get_laziness_criterion(); - if (curr_mirror_laziness_criterion<best_mirror_laziness_criterion){ + curr_mirror_self_rating=Pcurr_mirror->mirror_mirror_on_the_wall(); + if (curr_mirror_self_rating<best_mirror_self_rating){ best_mirror_num=url_num; - best_mirror_laziness_criterion=curr_mirror_laziness_criterion; + best_mirror_self_rating=curr_mirror_self_rating; Pbest_mirror=Pcurr_mirror; } - if (best_mirror_laziness_criterion==0) + if (best_mirror_self_rating==0) // 0 can not be improved - it's one of the best break; } } - debug("Downloading from BEST_MIRROR:"+url_list[best_mirror_num]); if (Pbest_mirror){ + debug("Downloading from BEST_MIRROR:"+url_list[best_mirror_num]); Pbest_mirror->start(); dn_segments[seg_num].prepare_for_connection(cm, connection_num, num, url_list[best_mirror_num]); connection_array[connection_num].segment=&dn_segments[seg_num]; diff --git a/segget/mirror.cpp b/segget/mirror.cpp index 631ef92..cb391ff 100644 --- a/segget/mirror.cpp +++ b/segget/mirror.cpp @@ -15,34 +15,34 @@ class Tmirror{ public: ulong dld_time; ulong dld_size; - double multiplier; + double honesty; Tmirror(): active_num(0), dld_time(0), dld_size(1), - multiplier(1){}; + honesty(1){}; void start(); void stop(ulong time, uint size); - double get_laziness_criterion(); + double mirror_mirror_on_the_wall(); uint get_active_num(){return active_num;}; }; -double Tmirror::get_laziness_criterion(){ - double criterion=multiplier*1000000000*dld_time/dld_size; - multiplier=multiplier*100/(100+settings.benchmark_oblivion); +double Tmirror::mirror_mirror_on_the_wall(){ + double criterion=honesty*1000000000*dld_time/dld_size; + honesty=honesty*100/(100+settings.benchmark_oblivion); return criterion; } void Tmirror::start(){ if (!dld_time) dld_time=1; active_num++; - multiplier=1; + honesty=1; } void Tmirror::stop(ulong time, uint size){ dld_time+=time; dld_size+=size; - multiplier=1; + honesty=1; debug(toString(time)+"---"+toString(size)); active_num--; } @@ -62,8 +62,8 @@ Tmirror* find_mirror(string mirror_url){ debug("==================>>"); debug(" time:"+toString(mirror_iterator->second->dld_time)); debug(" size:"+toString(mirror_iterator->second->dld_size)); - debug(" multiplier:"+toString(mirror_iterator->second->multiplier)); - debug(" criterion:"+toString(mirror_iterator->second->get_laziness_criterion())); + debug(" honesty:"+toString(mirror_iterator->second->honesty)); + debug(" criterion:"+toString(mirror_iterator->second->mirror_mirror_on_the_wall())); return mirror_iterator->second; } } diff --git a/segget/segget.conf b/segget/segget.conf index d9b3a42..a7c0619 100644 --- a/segget/segget.conf +++ b/segget/segget.conf @@ -46,8 +46,8 @@ resume_on=1 # If segment download was unsuccessful, new attempts are made. When attempts # number reaches max_tries, segment gets FAILED status and error logged to error_log # Default: -# max_tries=30 -max_tries=30 +# max_tries=10 +max_tries=10 [connections] # MAX_CONNECTIONS @@ -72,8 +72,8 @@ connection_timeout=15 # TIMEOUT. It is recommended that if used in conjunction with TIMEOUT, you set # FTP_RESPONSE_TIMEOUT to a value smaller than TIMEOUT. # Default: -# ftp_response_timeout=5000 -ftp_response_timeout=5000 +# ftp_response_timeout=180 +ftp_response_timeout=180 # TIMEOUT # maximum amount of time to download segment in seconds @@ -83,8 +83,8 @@ ftp_response_timeout=5000 # time and limiting operations to less than a few minutes risk aborting perfectly # normal operations. # Default: -# timeout=6000 -timeout=6000 +# timeout=500 +timeout=500 # LOW_CONNECTION_SPEED_LIMIT # Define the low speed limit for connection. Pass a long as parameter. It @@ -139,8 +139,8 @@ bind_interface=none # have. While choosing a mirror segget will skip mirrors with # max_connections_num_per_mirror active downloads. # Default: -# max_connections_num_per_mirror=2 -max_connections_num_per_mirror=2 +# max_connections_num_per_mirror=1 +max_connections_num_per_mirror=1 # SYNOPSIS: collect_benchmark_stats_on=0 | 1 # - If set to 1, stats on mirrors performance will be collected. @@ -211,8 +211,8 @@ proxy_ip_or_name=none # PROXY_PORT # Set the proxy port to connect to unless it is specified in the PROXY option. # Default: -# proxy_port=1080 -proxy_port=1080 +# proxy_port=3128 +proxy_port=3128 # PROXY_USER # Set user name to use for the transfer while connecting to Proxy. diff --git a/segget/settings.h b/segget/settings.h index 5a32bb2..aac711c 100644 --- a/segget/settings.h +++ b/segget/settings.h @@ -54,24 +54,24 @@ class Tsettings{ //segments max_segment_size(500000), resume_on(1), - max_tries(30), + max_tries(10), //connections max_connections(6), connection_timeout(15), - ftp_response_timeout(5000), - time_out(6000), + ftp_response_timeout(180), + time_out(500), low_connection_speed_limit(1000), low_connection_speed_time(10), max_connection_speed(0), bind_interface("none"), //mirrors - max_connections_num_per_mirror(2), + max_connections_num_per_mirror(1), benchmark_oblivion(5), //user-data user_agent("segget"), //proxy proxy_ip_or_name("none"), - proxy_port(0), + proxy_port(3128), proxy_off(1), proxy_user("none"), proxy_password("none"), |