CURLINFO_SPEED_UPLOAD.3 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .\" generated by cd2nroff 0.1 from CURLINFO_SPEED_UPLOAD.md
  2. .TH CURLINFO_SPEED_UPLOAD 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLINFO_SPEED_UPLOAD \- get upload speed
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD, double *speed);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a pointer to a double to receive the average upload speed that curl
  12. measured for the complete upload. Measured in bytes/second.
  13. \fICURLINFO_SPEED_UPLOAD_T(3)\fP is a newer replacement that returns a more
  14. sensible variable type.
  15. .SH PROTOCOLS
  16. This functionality affects all supported protocols
  17. .SH EXAMPLE
  18. .nf
  19. int main(void)
  20. {
  21. CURL *curl = curl_easy_init();
  22. if(curl) {
  23. CURLcode res;
  24. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  25. /* Perform the request */
  26. res = curl_easy_perform(curl);
  27. if(!res) {
  28. double speed;
  29. res = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed);
  30. if(!res) {
  31. printf("Upload speed %.0f bytes/sec\\n", speed);
  32. }
  33. }
  34. }
  35. }
  36. .fi
  37. .SH DEPRECATED
  38. Deprecated since 7.55.0.
  39. .SH AVAILABILITY
  40. Added in curl 7.4.1
  41. .SH RETURN VALUE
  42. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  43. .SH SEE ALSO
  44. .BR CURLINFO_SPEED_DOWNLOAD_T (3),
  45. .BR curl_easy_getinfo (3),
  46. .BR curl_easy_setopt (3)