X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fcurl%2Fcurl.c;h=ec65986cb08addb9e3e20801e92b2dce84fc2878;hb=99ba49914858c3af26e8fb6cd765af607ea178d9;hp=07f31970a97ce1dd5a2d0a20e5c57f93f1b5572f;hpb=17796b61c71778f5faf14038671b2ba7d1aff758;p=oweals%2Fgnunet.git diff --git a/src/curl/curl.c b/src/curl/curl.c index 07f31970a..ec65986cb 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c @@ -505,15 +505,18 @@ GNUNET_CURL_perform (struct GNUNET_CURL_Context *ctx) #if ENABLE_BENCHMARK { char *url = NULL; - double total = 0; + double total_as_double = 0; + struct GNUNET_TIME_Relative total; struct UrlRequestData *urd; CURLcode res; - res = curl_easy_getinfo (cmsg->easy_handle, CURLINFO_TOTAL_TIME, &total); + res = curl_easy_getinfo (cmsg->easy_handle, CURLINFO_TOTAL_TIME, &total_as_double); GNUNET_break (CURLE_OK == res); curl_easy_getinfo (cmsg->easy_handle, CURLINFO_EFFECTIVE_URL, &url); + total.rel_value_us = total_as_double * 1000 * 1000; urd = get_url_benchmark_data (url, (unsigned int) response_code); urd->count++; - urd->time.rel_value_us += total * 1000 * 1000; + urd->time = GNUNET_TIME_relative_add (urd->time, total); + urd->time_max = GNUNET_TIME_relative_max (total, urd->time_max); } #endif job->jcc (job->jcc_cls,