Skip to content

Commit

Permalink
Return basic HTTP range GET logging to ROS3 (HDFGroup#4738)
Browse files Browse the repository at this point in the history
* Add minimal amount of S3 request logging to ROS3

* Fix ROS3 logging ifdef conditions
  • Loading branch information
ajelenak authored Aug 22, 2024
1 parent 7a17a98 commit 8a8ac85
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/H5FDs3comms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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 *
**********************/
Expand Down Expand Up @@ -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 *
*******************/
Expand Down

0 comments on commit 8a8ac85

Please sign in to comment.