From: galsalomon66 Date: Thu, 2 Dec 2021 11:11:00 +0000 (+0200) Subject: using fmt for message formatting X-Git-Tag: v17.1.0~207^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fe0c94477702f2ada782a8fb0ddca7e1abaf95e2;p=ceph.git using fmt for message formatting Signed-off-by: galsalomon66 --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 4a37b2074f29a..1f043f19a431f 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="" + to_string(get_processed_size()) + - "" + to_string(get_processed_size()) + "" + - "" + to_string(get_total_bytes_returned()) + ""; + std::string progress_payload = fmt::format("{}{}{}" + ,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="" + to_string(get_processed_size()) + - "" + to_string(get_processed_size()) + "" + - "" + to_string(get_total_bytes_returned()) + ""; - + std::string stats_payload = fmt::format("{}{}{}" + ,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);