2015-08-31 21:27:58 +08:00
|
|
|
.\" **************************************************************************
|
|
|
|
.\" * _ _ ____ _
|
|
|
|
.\" * Project ___| | | | _ \| |
|
|
|
|
.\" * / __| | | | |_) | |
|
|
|
|
.\" * | (__| |_| | _ <| |___
|
|
|
|
.\" * \___|\___/|_| \_\_____|
|
|
|
|
.\" *
|
2023-01-02 20:51:48 +08:00
|
|
|
.\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2015-08-31 21:27:58 +08:00
|
|
|
.\" *
|
|
|
|
.\" * This software is licensed as described in the file COPYING, which
|
|
|
|
.\" * you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
.\" * are also available at https://curl.se/docs/copyright.html.
|
2015-08-31 21:27:58 +08:00
|
|
|
.\" *
|
|
|
|
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
.\" * copies of the Software, and permit persons to whom the Software is
|
|
|
|
.\" * furnished to do so, under the terms of the COPYING file.
|
|
|
|
.\" *
|
|
|
|
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
.\" * KIND, either express or implied.
|
|
|
|
.\" *
|
|
|
|
.\" * SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
.\" *
|
2015-08-31 21:27:58 +08:00
|
|
|
.\" **************************************************************************
|
|
|
|
.\"
|
2023-04-26 14:58:35 +08:00
|
|
|
.TH CURLINFO_SPEED_UPLOAD 3 "28 Aug 2015" libcurl libcurl
|
2015-08-31 21:27:58 +08:00
|
|
|
.SH NAME
|
|
|
|
CURLINFO_SPEED_UPLOAD \- get upload speed
|
|
|
|
.SH SYNOPSIS
|
2021-11-26 21:20:18 +08:00
|
|
|
.nf
|
2015-08-31 21:27:58 +08:00
|
|
|
#include <curl/curl.h>
|
|
|
|
|
2015-09-09 09:17:50 +08:00
|
|
|
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD, double *speed);
|
2021-11-26 21:20:18 +08:00
|
|
|
.fi
|
2015-08-31 21:27:58 +08:00
|
|
|
.SH DESCRIPTION
|
|
|
|
Pass a pointer to a double to receive the average upload speed that curl
|
|
|
|
measured for the complete upload. Measured in bytes/second.
|
2017-06-15 21:26:00 +08:00
|
|
|
|
|
|
|
\fICURLINFO_SPEED_UPLOAD_T(3)\fP is a newer replacement that returns a more
|
|
|
|
sensible variable type.
|
2015-08-31 21:27:58 +08:00
|
|
|
.SH PROTOCOLS
|
|
|
|
.SH EXAMPLE
|
2017-05-05 22:30:23 +08:00
|
|
|
.nf
|
|
|
|
CURL *curl = curl_easy_init();
|
|
|
|
if(curl) {
|
2020-09-17 05:04:07 +08:00
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
2017-05-05 22:30:23 +08:00
|
|
|
|
|
|
|
/* Perform the request */
|
|
|
|
res = curl_easy_perform(curl);
|
|
|
|
|
|
|
|
if(!res) {
|
|
|
|
double speed;
|
|
|
|
res = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed);
|
|
|
|
if(!res) {
|
2022-08-02 22:15:55 +08:00
|
|
|
printf("Upload speed %.0f bytes/sec\\n", speed);
|
2017-05-05 22:30:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.fi
|
2015-08-31 21:27:58 +08:00
|
|
|
.SH AVAILABILITY
|
2022-10-12 22:43:31 +08:00
|
|
|
Added in 7.4.1. Deprecated since 7.55.0.
|
2015-08-31 21:27:58 +08:00
|
|
|
.SH RETURN VALUE
|
|
|
|
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR curl_easy_getinfo "(3), " curl_easy_setopt "(3), "
|
|
|
|
.BR CURLINFO_SPEED_DOWNLOAD "(3), "
|