diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-06 23:18:34 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-06 23:18:34 +0100 |
commit | fa483f6cbce4873defe81234f44808bb8042fa68 (patch) | |
tree | 678a8e9005520a4644526d30d4ad5132374d52f0 /src/curl/curl.c | |
parent | 4d7f5eb19e168f9c383e7cbd19377100111a5f4f (diff) | |
download | gnunet-fa483f6cbce4873defe81234f44808bb8042fa68.tar.gz gnunet-fa483f6cbce4873defe81234f44808bb8042fa68.zip |
-fix FTBFS
Diffstat (limited to 'src/curl/curl.c')
-rw-r--r-- | src/curl/curl.c | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/curl/curl.c b/src/curl/curl.c index 30c2f8c01..684610101 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c | |||
@@ -858,85 +858,6 @@ GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx, | |||
858 | } | 858 | } |
859 | 859 | ||
860 | 860 | ||
861 | #if ENABLE_BENCHMARK | ||
862 | static void | ||
863 | do_benchmark (CURLMsg *cmsg) | ||
864 | { | ||
865 | char *url = NULL; | ||
866 | double total_as_double = 0; | ||
867 | struct GNUNET_TIME_Relative total; | ||
868 | struct UrlRequestData *urd; | ||
869 | /* Some care required, as curl is using data types (long vs curl_off_t vs | ||
870 | * double) inconsistently to store byte count. */ | ||
871 | curl_off_t size_curl = 0; | ||
872 | long size_long = 0; | ||
873 | uint64_t bytes_sent = 0; | ||
874 | uint64_t bytes_received = 0; | ||
875 | |||
876 | GNUNET_break (CURLE_OK == | ||
877 | curl_easy_getinfo (cmsg->easy_handle, | ||
878 | CURLINFO_TOTAL_TIME, | ||
879 | &total_as_double)); | ||
880 | total.rel_value_us = total_as_double * 1000 * 1000; | ||
881 | |||
882 | GNUNET_break (CURLE_OK == | ||
883 | curl_easy_getinfo (cmsg->easy_handle, | ||
884 | CURLINFO_EFFECTIVE_URL, | ||
885 | &url)); | ||
886 | |||
887 | /* HEADER_SIZE + SIZE_DOWNLOAD_T is hopefully the total | ||
888 | number of bytes received, not clear from curl docs. */ | ||
889 | |||
890 | GNUNET_break (CURLE_OK == | ||
891 | curl_easy_getinfo (cmsg->easy_handle, | ||
892 | CURLINFO_HEADER_SIZE, | ||
893 | &size_long)); | ||
894 | bytes_received += size_long; | ||
895 | |||
896 | GNUNET_break (CURLE_OK == | ||
897 | curl_easy_getinfo (cmsg->easy_handle, | ||
898 | CURLINFO_SIZE_DOWNLOAD_T, | ||
899 | &size_curl)); | ||
900 | bytes_received += size_curl; | ||
901 | |||
902 | /* REQUEST_SIZE + SIZE_UPLOAD_T is hopefully the total number of bytes | ||
903 | sent, again docs are not completely clear. */ | ||
904 | |||
905 | GNUNET_break (CURLE_OK == | ||
906 | curl_easy_getinfo (cmsg->easy_handle, | ||
907 | CURLINFO_REQUEST_SIZE, | ||
908 | &size_long)); | ||
909 | bytes_sent += size_long; | ||
910 | |||
911 | /* We obtain this value to check an invariant, but never use it otherwise. */ | ||
912 | GNUNET_break (CURLE_OK == | ||
913 | curl_easy_getinfo (cmsg->easy_handle, | ||
914 | CURLINFO_SIZE_UPLOAD_T, | ||
915 | &size_curl)); | ||
916 | |||
917 | /* CURLINFO_SIZE_UPLOAD_T <= CURLINFO_REQUEST_SIZE should | ||
918 | be an invariant. | ||
919 | As verified with | ||
920 | curl -w "foo%{size_request} -XPOST --data "ABC" $URL | ||
921 | the CURLINFO_REQUEST_SIZE should be the whole size of the request | ||
922 | including headers and body. | ||
923 | */ | ||
924 | GNUNET_break (size_curl <= size_long); | ||
925 | |||
926 | urd = get_url_benchmark_data (url, (unsigned int) response_code); | ||
927 | urd->count++; | ||
928 | urd->time = GNUNET_TIME_relative_add (urd->time, | ||
929 | total); | ||
930 | urd->time_max = GNUNET_TIME_relative_max (total, | ||
931 | urd->time_max); | ||
932 | urd->bytes_sent += bytes_sent; | ||
933 | urd->bytes_received += bytes_received; | ||
934 | } | ||
935 | |||
936 | |||
937 | #endif | ||
938 | |||
939 | |||
940 | /** | 861 | /** |
941 | * Run the main event loop for the HTTP interaction. | 862 | * Run the main event loop for the HTTP interaction. |
942 | * | 863 | * |
@@ -994,9 +915,6 @@ GNUNET_CURL_perform2 (struct GNUNET_CURL_Context *ctx, | |||
994 | response); | 915 | response); |
995 | rc (response); | 916 | rc (response); |
996 | } | 917 | } |
997 | #if ENABLE_BENCHMARK | ||
998 | do_benchmark (cmsg); | ||
999 | #endif | ||
1000 | GNUNET_CURL_job_cancel (job); | 918 | GNUNET_CURL_job_cancel (job); |
1001 | } | 919 | } |
1002 | } | 920 | } |