summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgalsalomon66 <gal.salomon@gmail.com>2021-12-02 12:11:00 +0100
committergalsalomon66 <gal.salomon@gmail.com>2021-12-18 12:51:55 +0100
commitfe0c94477702f2ada782a8fb0ddca7e1abaf95e2 (patch)
tree5ec2a3dbd5ba4bbffd897a9b821af03a306c6171 /src
parentfix comments; enum-class; typo; documentation (diff)
downloadceph-fe0c94477702f2ada782a8fb0ddca7e1abaf95e2.tar.xz
ceph-fe0c94477702f2ada782a8fb0ddca7e1abaf95e2.zip
using fmt for message formatting
Signed-off-by: galsalomon66 <gal.salomon@gmail.com>
Diffstat (limited to '')
-rw-r--r--src/rgw/rgw_rest_s3.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc
index 4a37b2074f2..1f043f19a43 100644
--- a/src/rgw/rgw_rest_s3.cc
+++ b/src/rgw/rgw_rest_s3.cc
@@ -6377,9 +6377,8 @@ void aws_response_handler::send_error_response(const char *error_code,
void aws_response_handler::send_progress_response()
{
- std::string progress_payload="<?xml version=\"1.0\" encoding=\"UTF-8\"?><Progress><BytesScanned>" + to_string(get_processed_size()) +
- "</BytesScanned><BytesProcessed>" + to_string(get_processed_size()) + "</BytesProcessed>" +
- "<BytesReturned>" + to_string(get_total_bytes_returned()) + "</BytesReturned></Progress>";
+ std::string progress_payload = fmt::format("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Progress><BytesScanned>{}</BytesScanned><BytesProcessed>{}</BytesProcessed><BytesReturned>{}</BytesReturned></Progress>"
+ ,get_processed_size(),get_processed_size(),get_total_bytes_returned());
sql_result.append(progress_payload);
int buff_len = create_message(header_size);
@@ -6389,10 +6388,9 @@ void aws_response_handler::send_progress_response()
void aws_response_handler::send_stats_response()
{
- std::string stats_payload="<?xml version=\"1.0\" encoding=\"UTF-8\"?><Stats><BytesScanned>" + to_string(get_processed_size()) +
- "</BytesScanned><BytesProcessed>" + to_string(get_processed_size()) + "</BytesProcessed>" +
- "<BytesReturned>" + to_string(get_total_bytes_returned()) + "</BytesReturned></Stats>";
-
+ std::string stats_payload = fmt::format("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Stats><BytesScanned>{}</BytesScanned><BytesProcessed>{}</BytesProcessed><BytesReturned>{}</BytesReturned></Stats>"
+ ,get_processed_size(),get_processed_size(),get_total_bytes_returned());
+
sql_result.append(stats_payload);
int buff_len = create_message(header_size);
s->formatter->write_bin_data(sql_result.data(), buff_len);