From afe1bb7673a350d86228e2d916e346e27e4fe7a6 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 3 May 2019 01:01:39 +0200 Subject: benchmark: fix request size collection and add invariant check --- src/curl/curl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/curl/curl.c b/src/curl/curl.c index 4bd2a55d0..1c352f195 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c @@ -526,11 +526,20 @@ GNUNET_CURL_perform2 (struct GNUNET_CURL_Context *ctx, &size_long)); bytes_sent += size_long; + /* We obtain this value to check an invariant, but never use it otherwise. */ GNUNET_break (CURLE_OK == curl_easy_getinfo (cmsg->easy_handle, CURLINFO_SIZE_UPLOAD_T, &size_curl)); - bytes_sent += size_curl; + + /* CURLINFO_SIZE_UPLOAD_T <= CURLINFO_REQUEST_SIZE should + be an invariant. + As verified with + curl -w "foo%{size_request} -XPOST --data "ABC" $URL + the CURLINFO_REQUEST_SIZE should be the whole size of the request + including headers and body. + */ + GNUNET_break (size_curl <= size_long); urd = get_url_benchmark_data (url, (unsigned int) response_code); urd->count++; -- cgit v1.2.3