summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostyantyn Ovechko <fastinetserver@gmail.com>2010-08-03 02:26:47 +0300
committerKostyantyn Ovechko <fastinetserver@gmail.com>2010-08-03 02:26:47 +0300
commita6e670966225d22234a0700e8d49773b30e5dc2e (patch)
treecfedf01667a97089d64a3b5c365e61b78a9960cf /segget/distfile.cpp
parentAdd [scripting_and_scheduling] section to segget.conf file. (diff)
downloadidfetch-a6e670966225d22234a0700e8d49773b30e5dc2e.tar.gz
idfetch-a6e670966225d22234a0700e8d49773b30e5dc2e.tar.bz2
idfetch-a6e670966225d22234a0700e8d49773b30e5dc2e.zip
Add distfiles window to tuiclient.
Distfiles window shows progress on distfile downloads.
Diffstat (limited to 'segget/distfile.cpp')
-rw-r--r--segget/distfile.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/segget/distfile.cpp b/segget/distfile.cpp
index 4f56bbe..d8f8eda 100644
--- a/segget/distfile.cpp
+++ b/segget/distfile.cpp
@@ -209,6 +209,7 @@ bool Tdistfile::check_if_dld(){
bool Tdistfile::load_distfile_from_json(json_object* json_obj_distfile){
try{
+ debug("Entered distfile.cpp: load_distfile_from_json()");
json_object* json_obj_buffer;
json_obj_buffer=json_object_object_get(json_obj_distfile,"name");
if (json_obj_buffer){
@@ -664,8 +665,11 @@ int Tdistfile::provide_segment(CURLM* cm, uint connection_num, uint seg_num){
void Tdistfile::inc_dld_segments_count(Tsegment* current_segment){
try{
stats.inc_dld_size(current_segment->segment_size);
- if (++dld_segments_count==segments_count)
+ dld_bytes+=current_segment->segment_size;
+ ui_server.send_distfile_progress_msg_to_all_clients(name+" "+toString(dld_segments_count)+" "+toString(segments_count)+" "+toString(dld_bytes)+" "+toString(size));
+ if (++dld_segments_count==segments_count){
combine_segments();
+ }
stats.dld_segments_count++;
}catch(...){
error_log("Error: distfile.cpp: inc_dld_segments_count()");