diff options
author | jiangtaoli2016 <jiangtao@google.com> | 2017-05-05 09:50:52 -0700 |
---|---|---|
committer | jiangtaoli2016 <jiangtao@google.com> | 2017-05-05 11:18:39 -0700 |
commit | 30f2a40f1012a8c7b5311e914b915b947b9f8f9b (patch) | |
tree | 4fd748fea91be7c9d17077c630e7f05b2a9f1b38 /src/core | |
parent | 18836bec50138fcd9d3b462fc5fc929241d02bfe (diff) |
Address Julien's comment and clang format
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/security/transport/security_connector.c | 20 | ||||
-rw-r--r-- | src/core/lib/security/transport/security_handshaker.c | 5 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/core/lib/security/transport/security_connector.c b/src/core/lib/security/transport/security_connector.c index 7dbed1c1e8..416a3bdb35 100644 --- a/src/core/lib/security/transport/security_connector.c +++ b/src/core/lib/security/transport/security_connector.c @@ -389,22 +389,22 @@ static void fake_channel_add_handshakers( grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc, grpc_handshake_manager *handshake_mgr) { grpc_handshake_manager_add( - handshake_mgr, grpc_security_handshaker_create( - exec_ctx, - tsi_create_adapter_handshaker( - tsi_create_fake_handshaker(true /* is_client */)), - &sc->base)); + handshake_mgr, + grpc_security_handshaker_create( + exec_ctx, tsi_create_adapter_handshaker( + tsi_create_fake_handshaker(true /* is_client */)), + &sc->base)); } static void fake_server_add_handshakers(grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc, grpc_handshake_manager *handshake_mgr) { grpc_handshake_manager_add( - handshake_mgr, grpc_security_handshaker_create( - exec_ctx, - tsi_create_adapter_handshaker( - tsi_create_fake_handshaker(false /* is_client */)), - &sc->base)); + handshake_mgr, + grpc_security_handshaker_create( + exec_ctx, tsi_create_adapter_handshaker( + tsi_create_fake_handshaker(false /* is_client */)), + &sc->base)); } static grpc_security_connector_vtable fake_channel_vtable = { diff --git a/src/core/lib/security/transport/security_handshaker.c b/src/core/lib/security/transport/security_handshaker.c index ea1fb30497..7a4dc6475e 100644 --- a/src/core/lib/security/transport/security_handshaker.c +++ b/src/core/lib/security/transport/security_handshaker.c @@ -233,13 +233,14 @@ static grpc_error *on_handshake_next_done_locked( // Send data to peer. grpc_slice to_send = grpc_slice_from_copied_buffer( (const char *)bytes_to_send, bytes_to_send_size); - grpc_slice_buffer_reset_and_unref(&h->outgoing); + grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &h->outgoing); grpc_slice_buffer_add(&h->outgoing, to_send); grpc_endpoint_write(exec_ctx, h->args->endpoint, &h->outgoing, &h->on_handshake_data_sent_to_peer); // If handshake has completed, check peer and so on. if (handshaker_result != NULL) { + GPR_ASSERT(h->handshaker_result == NULL); h->handshaker_result = handshaker_result; error = check_peer_locked(exec_ctx, h); } @@ -301,7 +302,7 @@ static void on_handshake_data_received_from_peer(grpc_exec_ctx *exec_ctx, security_handshaker_unref(exec_ctx, h); return; } - // Copy all slides received. + // Copy all slices received. size_t i; size_t bytes_received_size = 0; for (i = 0; i < h->args->read_buffer->count; i++) { |