improved LinkTable_fill() status message

This commit is contained in:
Fufu Fang 2019-09-03 15:12:38 +01:00
parent 656edbf578
commit cf49bf86b8
No known key found for this signature in database
GPG Key ID: 0F6BB5EF6F8BB729
1 changed files with 7 additions and 9 deletions

View File

@ -223,28 +223,26 @@ static void LinkTable_fill(LinkTable *linktbl)
Link_get_stat(this_link);
}
/* Block until the LinkTable is filled up */
fprintf(stderr, "LinkTable_fill(): ");
fprintf(stderr, "LinkTable_fill(): ... ");
int n = curl_multi_perform_once();
int i = 0;
int j = 0;
char s[STATUS_LEN];
while ( (i = curl_multi_perform_once()) ) {
if (1) {
if (j) {
for (size_t k = 0; k < strnlen(s, STATUS_LEN); k++) {
fprintf(stderr, "\b");
}
if (j) {
for (size_t k = 0; k < strnlen(s, STATUS_LEN); k++) {
fprintf(stderr, "\b");
}
snprintf(s, STATUS_LEN, "... %d / %d", i, n);
fprintf(stderr, "%s", s);
}
snprintf(s, STATUS_LEN, "%d / %d", i, n);
fprintf(stderr, "%s", s);
j++;
}
for (size_t k = 0; k < strnlen(s, MAX_FILENAME_LEN); k++) {
fprintf(stderr, "\b");
}
fprintf(stderr, "... Done!\n");
fprintf(stderr, "Done!\n");
}
/**