Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:garloff:OTC
libs3
libs3-progress.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libs3-progress.diff of Package libs3
Index: libs3/src/s3.c =================================================================== --- libs3.orig/src/s3.c +++ libs3/src/s3.c @@ -2028,6 +2028,7 @@ static int putObjectDataCallback(int buf (put_object_callback_data *) callbackData; int ret = 0; + static int compl = -1; if (data->contentLength) { int toRead = ((data->contentLength > (unsigned) bufferSize) ? @@ -2044,15 +2045,20 @@ static int putObjectDataCallback(int buf data->totalContentLength -= ret; if (data->contentLength && !data->noStatus) { - // Avoid a weird bug in MingW, which won't print the second integer - // value properly when it's in the same call, so print separately - printf("%llu bytes remaining ", - (unsigned long long) data->totalContentLength); - printf("(%d%% complete) ...\n", - (int) (((data->totalOriginalContentLength - - data->totalContentLength) * 100) / - data->totalOriginalContentLength)); + int prcnt = ((data->originalContentLength - data->contentLength) * 200) + / data->originalContentLength; + if (prcnt != compl) { + // Avoid a weird bug in MingW, which won't print the second integer + // value properly when it's in the same call, so print separately + printf("%llu bytes remaining ", + (unsigned long long) data->contentLength); + printf("(%d%% complete) ... \r", prcnt/2); + fflush(stdout); + compl = prcnt; + } } + if (!data->contentLength) + printf("\n"); return ret; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor