application/download.c

changeset 91
7ee944cf53de
parent 87
5360027fb282
child 95
e92c72705da4
equal deleted inserted replaced
90:f501f0efc9a8 91:7ee944cf53de
78 ui_set(download->label_top_left, label1.ptr); 78 ui_set(download->label_top_left, label1.ptr);
79 79
80 free(sz_total); 80 free(sz_total);
81 free(label1.ptr); 81 free(label1.ptr);
82 82
83 time_t start = download->progress.speedtest_start;
84 time_t t = time(NULL);
85 if(t >= download->progress.speedtest_start + 4) {
86 uint64_t bytesPerSeconds = dav_transfer_speed(&download->progress, t);
87 if(start > 0) {
88 char *szps = util_size_str(FALSE, bytesPerSeconds);
89 cxmutstr label3 = cx_asprintf("%s/s", szps);
90 free(szps);
91 ui_set(download->label_bottom_left, label3.ptr);
92 free(label3.ptr);
93 }
94 }
83 95
84 return 1; 96 return 1;
85 } 97 }
86 98
87 static size_t ddfile_write(const void *buf, size_t size, size_t count, void *stream) { 99 static size_t ddfile_write(const void *buf, size_t size, size_t count, void *stream) {

mercurial