mirror of git://git.qorg11.net/lainsafe.git
Added a more user friendly progress bar (in bytes so kinda to do) but
it shows the % at least.
This commit is contained in:
parent
6608a22922
commit
3c03246af4
|
@ -124,10 +124,12 @@ main(int argc, char **argv)
|
|||
*/
|
||||
|
||||
curl_easy_setopt(easy_handle,CURLOPT_NOPROGRESS,silent_flag);
|
||||
curl_easy_setopt(easy_handle,CURLOPT_PROGRESSFUNCTION,progress);
|
||||
|
||||
curl_easy_setopt(easy_handle,CURLOPT_HTTPPOST,post);
|
||||
|
||||
curl_easy_perform(easy_handle);
|
||||
|
||||
if(!silent_flag) puts("");
|
||||
puts(buffer);
|
||||
|
||||
curl_formfree(post);
|
||||
|
@ -179,3 +181,17 @@ print_help()
|
|||
"--help: print this message\n");
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
progress(void *clientp,
|
||||
double dltotal,
|
||||
double dlnow,
|
||||
double ultotal,
|
||||
double ulnow)
|
||||
{
|
||||
printf("\r%0.f uploaded of %0.f (%0.f%%)",ulnow,ultotal,
|
||||
ulnow*100/ultotal);
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -12,3 +12,11 @@ store_link(const char *path, const char *buf);
|
|||
|
||||
void
|
||||
print_help();
|
||||
|
||||
void
|
||||
progress(void *clientp,
|
||||
double dltotal,
|
||||
double dlnow,
|
||||
double ultotal,
|
||||
double ulnow);
|
||||
|
||||
|
|
Loading…
Reference in New Issue