From 8a8ac85a691471449031b64c6aeab08e26bebb32 Mon Sep 17 00:00:00 2001 From: Aleksandar Jelenak Date: Thu, 22 Aug 2024 12:18:54 -0400 Subject: [PATCH] Return basic HTTP range GET logging to ROS3 (#4738) * Add minimal amount of S3 request logging to ROS3 * Fix ROS3 logging ifdef conditions --- src/H5FDs3comms.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index 1d5ee2608e1..0d1cd0f868a 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -50,7 +50,7 @@ /* manipulate verbosity of CURL output * * 0 -> no explicit curl output - * 1 -> on error, print failure info to stderr + * 1 -> print: (1) failure info to stderr on error, (2) basic HTTP range GET info * 2 -> in addition to above, print information for all performs; sets all * curl handles with CURLOPT_VERBOSE */ @@ -810,6 +810,11 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) handle->filesize = (size_t)content_length; +#if S3COMMS_CURL_VERBOSITY > 0 + fprintf(stdout, " -- size: %ju\n", content_length); + fflush(stdout); +#endif + /********************** * UNDO HEAD SETTINGS * **********************/ @@ -1119,6 +1124,12 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value"); } +#if S3COMMS_CURL_VERBOSITY > 0 + fprintf(stdout, "%s: Bytes %" PRIuHADDR " - %" PRIuHADDR ", Request Size: %zu\n", handle->httpverb, + offset, offset + len - 1, len); + fflush(stdout); +#endif + /******************* * COMPILE REQUEST * *******************/