GNURLINFO_...D_UPLOAD_T(3)
π NAME π
CURLINFO_SPEED_UPLOAD_T β bestie, this one gets you the upload speed π
okay so real talk: this is a curl_easy_getinfo option, and the manual page lives in the gnurl neck of the woods (iykyk) β¨
πΈ SYNOPSIS πΈ
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD_T,
curl_off_t *speed);
π¦ DESCRIPTION π¦
So the way this works: you pass a pointer to a curl_off_t, and curl fills it in with the average upload speed it measured for the complete upload π
Units? bytes/second. That's it, that's the whole vibe. Measured in bytes/second, periodt π
π PROTOCOLS π
ngl this section is literally empty on the page β no protocols listed here π so we're not gonna sit here and make any up, that's not the move π
β¨ EXAMPLE β¨
okay here's the whole thing, copy it exactly, no cap:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* Perform the request */
res = curl_easy_perform(curl);
if(!res) {
curl_off_t speed;
res = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD_T, &speed);
if(!res) {
printf("Upload speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\n", speed);
}
}
}
the way that printf eats with CURL_FORMAT_CURL_OFF_T β iconic formatting behaviour, we love a portable format macro π«Ά
β AVAILABILITY β
Added in 7.55.0 π (so if you're on something ancient, that's your sign to update, bestie)
π RETURN VALUE π
CURLE_OKβ slay, the option is supported πCURLE_UNKNOWN_OPTIONβ not supported, and it will absolutely tell you π
π₯ SEE ALSO π₯
(and yes, the trailing comma is literally in the original, we keep it exactly, that's the rule π)
and that's the whole page, bestie π§ source is libcurl 7.55.0, dated 25 May 2017 β the manual page header is GNURLINFO_...D_UPLOAD_T(3), section 3, curl_easy_getinfo options π bye ily, go measure some uploads π
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms