-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getinfo: return sizes as curl_off_t #1511
Conversation
@bagder, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jay, @captain-caveman2k and @philipc to be potential reviewers. |
This isn't a firm objection but I think that might be confusing to the user. Though I understand the func func2 pattern I don't think it would be thought of with macros like this, for example CURLINFO_SIZE_DOWNLOAD2 apply to a second download or what. It requires more cognitive processing. CURLINFO_SIZE_DOWNLOAD_AS_CURL_OFF_T |
I agree completely on the names. I really don't like adding "2" to the names but I failed to come up with a nice naming scheme that doesn't also make the names extremely long... Would appending just
There isn't any major disadvantage, no, unless you use extremely large files. For me this is more about correctness, for a less surprising choice and for users not having to typecast the value to get it to a sensible type. These values are kept in |
_OFF_T could imply
Yeah but just how big would those files have to be, unless you're transferring >8 petabytes (I'm basing this on 2^53 as max integer value once it's cast to double). |
This change introduces new alternatives for the existing six curl_easy_getinfo() options that return sizes or speeds as doubles. The new versions are named like the old ones but with an appended '_T': CURLINFO_CONTENT_LENGTH_DOWNLOAD_T CURLINFO_CONTENT_LENGTH_UPLOAD_T CURLINFO_SIZE_DOWNLOAD_T CURLINFO_SIZE_UPLOAD_T CURLINFO_SPEED_DOWNLOAD_T CURLINFO_SPEED_UPLOAD_T
1d6b68e
to
a2565d0
Compare
New version that uses |
Intent announced to the list on June 16. |
This change introduces new alternatives for the existing six
curl_easy_getinfo() options that return sizes or speeds as doubles. The
new versions are named like the old ones but with an appended '2':
CURLINFO_CONTENT_LENGTH_DOWNLOAD2
CURLINFO_CONTENT_LENGTH_UPLOAD2
CURLINFO_SIZE_DOWNLOAD2
CURLINFO_SIZE_UPLOAD2
CURLINFO_SPEED_DOWNLOAD2
CURLINFO_SPEED_UPLOAD2