diff options
author | 2018-02-09 09:34:04 -0800 | |
---|---|---|
committer | 2018-02-09 09:34:04 -0800 | |
commit | 4d20a666850b732cf1562487fb5f46ab9654105f (patch) | |
tree | 9059162d0f125e02780f506c2476d5d9bbc0eb7d /src/core/ext/filters/http | |
parent | cddf6f838aa48c8d5c9f75cee5a8ed8abdcb25b9 (diff) |
Run clang fmt
Diffstat (limited to 'src/core/ext/filters/http')
4 files changed, 24 insertions, 16 deletions
diff --git a/src/core/ext/filters/http/client/http_client_filter.cc b/src/core/ext/filters/http/client/http_client_filter.cc index aabc405bec..80643f8584 100644 --- a/src/core/ext/filters/http/client/http_client_filter.cc +++ b/src/core/ext/filters/http/client/http_client_filter.cc @@ -189,7 +189,8 @@ static grpc_error* pull_slice_from_send_message(call_data* calld) { // and on_send_message_next_done() will be invoked when it is complete. static grpc_error* read_all_available_send_message_data(call_data* calld) { while (grpc_byte_stream_next(&calld->send_message_caching_stream.base, - ~static_cast<size_t>(0), &calld->on_send_message_next_done)) { + ~static_cast<size_t>(0), + &calld->on_send_message_next_done)) { grpc_error* error = pull_slice_from_send_message(calld); if (error != GRPC_ERROR_NONE) return error; if (calld->send_message_bytes_read == @@ -224,7 +225,8 @@ static void on_send_message_next_done(void* arg, grpc_error* error) { } static char* slice_buffer_to_string(grpc_slice_buffer* slice_buffer) { - char* payload_bytes = static_cast<char*>(gpr_malloc(slice_buffer->length + 1)); + char* payload_bytes = + static_cast<char*>(gpr_malloc(slice_buffer->length + 1)); size_t offset = 0; for (size_t i = 0; i < slice_buffer->count; ++i) { memcpy(payload_bytes + offset, @@ -253,8 +255,10 @@ static grpc_error* update_path_for_get(grpc_call_element* elem, false /* multi_line */); grpc_slice path_with_query_slice = GRPC_SLICE_MALLOC(estimated_len); /* memcopy individual pieces into this slice */ - char* write_ptr = reinterpret_cast<char*>GRPC_SLICE_START_PTR(path_with_query_slice); - char* original_path = reinterpret_cast<char*>GRPC_SLICE_START_PTR(path_slice); + char* write_ptr = + reinterpret_cast<char*> GRPC_SLICE_START_PTR(path_with_query_slice); + char* original_path = + reinterpret_cast<char*> GRPC_SLICE_START_PTR(path_slice); memcpy(write_ptr, original_path, GRPC_SLICE_LENGTH(path_slice)); write_ptr += GRPC_SLICE_LENGTH(path_slice); *write_ptr++ = '?'; @@ -265,7 +269,7 @@ static grpc_error* update_path_for_get(grpc_call_element* elem, true /* url_safe */, false /* multi_line */); gpr_free(payload_bytes); /* remove trailing unused memory and add trailing 0 to terminate string */ - char* t = reinterpret_cast<char*>GRPC_SLICE_START_PTR(path_with_query_slice); + char* t = reinterpret_cast<char*> GRPC_SLICE_START_PTR(path_with_query_slice); /* safe to use strlen since base64_encode will always add '\0' */ path_with_query_slice = grpc_slice_sub_no_ref(path_with_query_slice, 0, strlen(t)); diff --git a/src/core/ext/filters/http/http_filters_plugin.cc b/src/core/ext/filters/http/http_filters_plugin.cc index b89cb028ea..56fe1e5c24 100644 --- a/src/core/ext/filters/http/http_filters_plugin.cc +++ b/src/core/ext/filters/http/http_filters_plugin.cc @@ -58,7 +58,8 @@ static bool maybe_add_required_filter(grpc_channel_stack_builder* builder, void* arg) { return is_building_http_like_transport(builder) ? grpc_channel_stack_builder_prepend_filter( - builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr) + builder, static_cast<const grpc_channel_filter*>(arg), + nullptr, nullptr) : true; } diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.cc b/src/core/ext/filters/http/message_compress/message_compress_filter.cc index 223548d3bf..73220a0ea1 100644 --- a/src/core/ext/filters/http/message_compress/message_compress_filter.cc +++ b/src/core/ext/filters/http/message_compress/message_compress_filter.cc @@ -226,7 +226,8 @@ static void finish_send_message(grpc_call_element* elem) { const char* algo_name; const size_t before_size = calld->slices.length; const size_t after_size = tmp.length; - const float savings_ratio = 1.0f - static_cast<float>(after_size) / static_cast<float>(before_size); + const float savings_ratio = 1.0f - static_cast<float>(after_size) / + static_cast<float>(before_size); GPR_ASSERT(grpc_message_compression_algorithm_name( calld->message_compression_algorithm, &algo_name)); gpr_log(GPR_DEBUG, @@ -291,8 +292,8 @@ static grpc_error* pull_slice_from_send_message(call_data* calld) { static void continue_reading_send_message(grpc_call_element* elem) { call_data* calld = static_cast<call_data*>(elem->call_data); while (grpc_byte_stream_next( - calld->send_message_batch->payload->send_message.send_message, ~static_cast<size_t>(0), - &calld->on_send_message_next_done)) { + calld->send_message_batch->payload->send_message.send_message, + ~static_cast<size_t>(0), &calld->on_send_message_next_done)) { grpc_error* error = pull_slice_from_send_message(calld); if (error != GRPC_ERROR_NONE) { // Closure callback; does not take ownership of error. diff --git a/src/core/ext/filters/http/server/http_server_filter.cc b/src/core/ext/filters/http/server/http_server_filter.cc index 560b5795e3..63bc2bd59f 100644 --- a/src/core/ext/filters/http/server/http_server_filter.cc +++ b/src/core/ext/filters/http/server/http_server_filter.cc @@ -224,10 +224,11 @@ static grpc_error* server_filter_incoming_metadata(grpc_call_element* elem, /* decode payload from query and add to the slice buffer to be returned */ const int k_url_safe = 1; - grpc_slice_buffer_add(&calld->read_slice_buffer, - grpc_base64_decode_with_len( - reinterpret_cast<const char*>GRPC_SLICE_START_PTR(query_slice), - GRPC_SLICE_LENGTH(query_slice), k_url_safe)); + grpc_slice_buffer_add( + &calld->read_slice_buffer, + grpc_base64_decode_with_len( + reinterpret_cast<const char*> GRPC_SLICE_START_PTR(query_slice), + GRPC_SLICE_LENGTH(query_slice), k_url_safe)); grpc_slice_buffer_stream_init(&calld->read_stream, &calld->read_slice_buffer, 0); calld->seen_path_with_query = true; @@ -277,9 +278,10 @@ static void hs_on_complete(void* user_data, grpc_error* err) { call_data* calld = static_cast<call_data*>(elem->call_data); /* Call recv_message_ready if we got the payload via the path field */ if (calld->seen_path_with_query && calld->recv_message_ready != nullptr) { - *calld->pp_recv_message = calld->payload_bin_delivered - ? nullptr - : reinterpret_cast<grpc_byte_stream*>(&calld->read_stream); + *calld->pp_recv_message = + calld->payload_bin_delivered + ? nullptr + : reinterpret_cast<grpc_byte_stream*>(&calld->read_stream); // Re-enter call combiner for recv_message_ready, since the surface // code will release the call combiner for each callback it receives. GRPC_CALL_COMBINER_START(calld->call_combiner, calld->recv_message_ready, |