diff options
Diffstat (limited to 'src/core/ext/filters/http')
4 files changed, 32 insertions, 32 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 590bd22b1e..a625369b02 100644 --- a/src/core/ext/filters/http/client/http_client_filter.cc +++ b/src/core/ext/filters/http/client/http_client_filter.cc @@ -71,7 +71,7 @@ typedef struct channel_data { static grpc_error* client_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, grpc_metadata_batch* b) { - if (b->idx.named.status != NULL) { + if (b->idx.named.status != nullptr) { if (grpc_mdelem_eq(b->idx.named.status->md, GRPC_MDELEM_STATUS_200)) { grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.status); } else { @@ -93,7 +93,7 @@ static grpc_error* client_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, } } - if (b->idx.named.grpc_message != NULL) { + if (b->idx.named.grpc_message != nullptr) { grpc_slice pct_decoded_msg = grpc_permissive_percent_decode_slice( GRPC_MDVALUE(b->idx.named.grpc_message->md)); if (grpc_slice_is_equivalent(pct_decoded_msg, @@ -105,7 +105,7 @@ static grpc_error* client_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, } } - if (b->idx.named.content_type != NULL) { + if (b->idx.named.content_type != nullptr) { if (!grpc_mdelem_eq(b->idx.named.content_type->md, GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC)) { if (grpc_slice_buf_start_eq(GRPC_MDVALUE(b->idx.named.content_type->md), @@ -292,7 +292,7 @@ static grpc_error* update_path_for_get(grpc_exec_ctx* exec_ctx, static void remove_if_present(grpc_exec_ctx* exec_ctx, grpc_metadata_batch* batch, grpc_metadata_batch_callouts_index idx) { - if (batch->idx.array[idx] != NULL) { + if (batch->idx.array[idx] != nullptr) { grpc_metadata_batch_remove(exec_ctx, batch, batch->idx.array[idx]); } } @@ -450,7 +450,7 @@ static grpc_mdelem scheme_from_args(const grpc_channel_args* args) { size_t j; grpc_mdelem valid_schemes[] = {GRPC_MDELEM_SCHEME_HTTP, GRPC_MDELEM_SCHEME_HTTPS}; - if (args != NULL) { + if (args != nullptr) { for (i = 0; i < args->num_args; ++i) { if (args->args[i].type == GRPC_ARG_STRING && strcmp(args->args[i].key, GRPC_ARG_HTTP2_SCHEME) == 0) { @@ -467,7 +467,7 @@ static grpc_mdelem scheme_from_args(const grpc_channel_args* args) { } static size_t max_payload_size_from_args(const grpc_channel_args* args) { - if (args != NULL) { + if (args != nullptr) { for (size_t i = 0; i < args->num_args; ++i) { if (0 == strcmp(args->args[i].key, GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET)) { if (args->args[i].type != GRPC_ARG_INTEGER) { @@ -524,7 +524,7 @@ static grpc_slice user_agent_from_args(const grpc_channel_args* args, } } - tmp = gpr_strvec_flatten(&v, NULL); + tmp = gpr_strvec_flatten(&v, nullptr); gpr_strvec_destroy(&v); result = grpc_slice_intern(grpc_slice_from_static_string(tmp)); gpr_free(tmp); @@ -538,7 +538,7 @@ static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, grpc_channel_element_args* args) { channel_data* chand = (channel_data*)elem->channel_data; GPR_ASSERT(!args->is_last); - GPR_ASSERT(args->optional_transport != NULL); + GPR_ASSERT(args->optional_transport != nullptr); chand->static_scheme = scheme_from_args(args->channel_args); chand->max_payload_size_for_get = max_payload_size_from_args(args->channel_args); diff --git a/src/core/ext/filters/http/http_filters_plugin.cc b/src/core/ext/filters/http/http_filters_plugin.cc index 064e66e323..69dbde409c 100644 --- a/src/core/ext/filters/http/http_filters_plugin.cc +++ b/src/core/ext/filters/http/http_filters_plugin.cc @@ -37,7 +37,7 @@ static optional_filter compress_filter = { static bool is_building_http_like_transport( grpc_channel_stack_builder* builder) { grpc_transport* t = grpc_channel_stack_builder_get_transport(builder); - return t != NULL && strstr(t->vtable->name, "http"); + return t != nullptr && strstr(t->vtable->name, "http"); } static bool maybe_add_optional_filter(grpc_exec_ctx* exec_ctx, @@ -51,7 +51,7 @@ static bool maybe_add_optional_filter(grpc_exec_ctx* exec_ctx, grpc_channel_args_find(channel_args, filtarg->control_channel_arg), !grpc_channel_args_want_minimal_stack(channel_args)); return enable ? grpc_channel_stack_builder_prepend_filter( - builder, filtarg->filter, NULL, NULL) + builder, filtarg->filter, nullptr, nullptr) : true; } @@ -60,7 +60,7 @@ static bool maybe_add_required_filter(grpc_exec_ctx* exec_ctx, void* arg) { return is_building_http_like_transport(builder) ? grpc_channel_stack_builder_prepend_filter( - builder, (const grpc_channel_filter*)arg, NULL, NULL) + builder, (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 949ff917d6..8d95133d8f 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 @@ -112,7 +112,7 @@ static grpc_error* process_send_initial_metadata( grpc_stream_compression_algorithm stream_compression_algorithm = GRPC_STREAM_COMPRESS_NONE; if (initial_metadata->idx.named.grpc_internal_stream_encoding_request != - NULL) { + nullptr) { grpc_mdelem md = initial_metadata->idx.named.grpc_internal_stream_encoding_request->md; if (!grpc_stream_compression_algorithm_parse( @@ -141,13 +141,13 @@ static grpc_error* process_send_initial_metadata( initial_metadata->idx.named.grpc_internal_stream_encoding_request); /* Disable message-wise compression */ calld->compression_algorithm = GRPC_COMPRESS_NONE; - if (initial_metadata->idx.named.grpc_internal_encoding_request != NULL) { + if (initial_metadata->idx.named.grpc_internal_encoding_request != nullptr) { grpc_metadata_batch_remove( exec_ctx, initial_metadata, initial_metadata->idx.named.grpc_internal_encoding_request); } } else if (initial_metadata->idx.named.grpc_internal_encoding_request != - NULL) { + nullptr) { grpc_mdelem md = initial_metadata->idx.named.grpc_internal_encoding_request->md; if (!grpc_compression_algorithm_parse(GRPC_MDVALUE(md), @@ -228,7 +228,7 @@ static void send_message_batch_continue(grpc_exec_ctx* exec_ctx, // before we do that. grpc_transport_stream_op_batch* send_message_batch = calld->send_message_batch; - calld->send_message_batch = NULL; + calld->send_message_batch = nullptr; grpc_call_next_op(exec_ctx, elem, send_message_batch); } @@ -287,11 +287,11 @@ static void fail_send_message_batch_in_call_combiner(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { call_data* calld = (call_data*)arg; - if (calld->send_message_batch != NULL) { + if (calld->send_message_batch != nullptr) { grpc_transport_stream_op_batch_finish_with_failure( exec_ctx, calld->send_message_batch, GRPC_ERROR_REF(error), calld->call_combiner); - calld->send_message_batch = NULL; + calld->send_message_batch = nullptr; } } @@ -382,7 +382,7 @@ static void compress_start_transport_stream_op_batch( GRPC_ERROR_UNREF(calld->cancel_error); calld->cancel_error = GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error); - if (calld->send_message_batch != NULL) { + if (calld->send_message_batch != nullptr) { if (calld->send_initial_metadata_state == INITIAL_METADATA_UNSEEN) { GRPC_CALL_COMBINER_START( exec_ctx, calld->call_combiner, @@ -423,7 +423,7 @@ static void compress_start_transport_stream_op_batch( // for this, since we can't send two batches down while holding the // call combiner, since the connected_channel filter (at the bottom of // the call stack) will release the call combiner for each batch it sees. - if (calld->send_message_batch != NULL) { + if (calld->send_message_batch != nullptr) { GRPC_CALL_COMBINER_START( exec_ctx, calld->call_combiner, &calld->start_send_message_batch_in_call_combiner, GRPC_ERROR_NONE, @@ -432,7 +432,7 @@ static void compress_start_transport_stream_op_batch( } // Handle send_message. if (batch->send_message) { - GPR_ASSERT(calld->send_message_batch == NULL); + GPR_ASSERT(calld->send_message_batch == nullptr); calld->send_message_batch = batch; // If we have not yet seen send_initial_metadata, then we have to // wait. We save the batch in calld and then drop the call 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 5cfe5acced..4f3897915c 100644 --- a/src/core/ext/filters/http/server/http_server_filter.cc +++ b/src/core/ext/filters/http/server/http_server_filter.cc @@ -69,7 +69,7 @@ typedef struct channel_data { static grpc_error* server_filter_outgoing_metadata(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, grpc_metadata_batch* b) { - if (b->idx.named.grpc_message != NULL) { + if (b->idx.named.grpc_message != nullptr) { grpc_slice pct_encoded_msg = grpc_percent_encode_slice( GRPC_MDVALUE(b->idx.named.grpc_message->md), grpc_compatible_percent_encoding_unreserved_bytes); @@ -100,7 +100,7 @@ static grpc_error* server_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, grpc_error* error = GRPC_ERROR_NONE; static const char* error_name = "Failed processing incoming headers"; - if (b->idx.named.method != NULL) { + if (b->idx.named.method != nullptr) { if (grpc_mdelem_eq(b->idx.named.method->md, GRPC_MDELEM_METHOD_POST)) { *calld->recv_initial_metadata_flags &= ~(GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | @@ -132,7 +132,7 @@ static grpc_error* server_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":method"))); } - if (b->idx.named.te != NULL) { + if (b->idx.named.te != nullptr) { if (!grpc_mdelem_eq(b->idx.named.te->md, GRPC_MDELEM_TE_TRAILERS)) { add_error(error_name, &error, grpc_attach_md_to_error( @@ -147,7 +147,7 @@ static grpc_error* server_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, GRPC_ERROR_STR_KEY, grpc_slice_from_static_string("te"))); } - if (b->idx.named.scheme != NULL) { + if (b->idx.named.scheme != nullptr) { if (!grpc_mdelem_eq(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTP) && !grpc_mdelem_eq(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTPS) && !grpc_mdelem_eq(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_GRPC)) { @@ -165,7 +165,7 @@ static grpc_error* server_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":scheme"))); } - if (b->idx.named.content_type != NULL) { + if (b->idx.named.content_type != nullptr) { if (!grpc_mdelem_eq(b->idx.named.content_type->md, GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC)) { if (grpc_slice_buf_start_eq(GRPC_MDVALUE(b->idx.named.content_type->md), @@ -194,7 +194,7 @@ static grpc_error* server_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.content_type); } - if (b->idx.named.path == NULL) { + if (b->idx.named.path == nullptr) { add_error(error_name, &error, grpc_error_set_str( GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"), @@ -239,7 +239,7 @@ static grpc_error* server_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, } } - if (b->idx.named.host != NULL && b->idx.named.authority == NULL) { + if (b->idx.named.host != nullptr && b->idx.named.authority == nullptr) { grpc_linked_mdelem* el = b->idx.named.host; grpc_mdelem md = GRPC_MDELEM_REF(el->md); grpc_metadata_batch_remove(exec_ctx, b, el); @@ -252,7 +252,7 @@ static grpc_error* server_filter_incoming_metadata(grpc_exec_ctx* exec_ctx, GRPC_MDELEM_UNREF(exec_ctx, md); } - if (b->idx.named.authority == NULL) { + if (b->idx.named.authority == nullptr) { add_error( error_name, &error, grpc_error_set_str( @@ -281,16 +281,16 @@ static void hs_on_complete(grpc_exec_ctx* exec_ctx, void* user_data, grpc_call_element* elem = (grpc_call_element*)user_data; call_data* calld = (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 != NULL) { + if (calld->seen_path_with_query && calld->recv_message_ready != nullptr) { *calld->pp_recv_message = calld->payload_bin_delivered - ? NULL + ? nullptr : (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(exec_ctx, calld->call_combiner, calld->recv_message_ready, GRPC_ERROR_REF(err), "resuming recv_message_ready from on_complete"); - calld->recv_message_ready = NULL; + calld->recv_message_ready = nullptr; calld->payload_bin_delivered = true; } GRPC_CLOSURE_RUN(exec_ctx, calld->on_complete, GRPC_ERROR_REF(err)); @@ -341,7 +341,7 @@ static grpc_error* hs_mutate_op(grpc_exec_ctx* exec_ctx, if (op->recv_initial_metadata) { /* substitute our callback for the higher callback */ - GPR_ASSERT(op->payload->recv_initial_metadata.recv_flags != NULL); + GPR_ASSERT(op->payload->recv_initial_metadata.recv_flags != nullptr); calld->recv_initial_metadata = op->payload->recv_initial_metadata.recv_initial_metadata; calld->recv_initial_metadata_flags = |