Address Julien's comment and clang format

pull/10925/head
jiangtaoli2016 8 years ago
parent 18836bec50
commit 30f2a40f10
  1. 12
      src/core/lib/security/transport/security_connector.c
  2. 5
      src/core/lib/security/transport/security_handshaker.c

@ -389,9 +389,9 @@ 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(
handshake_mgr,
grpc_security_handshaker_create(
exec_ctx, tsi_create_adapter_handshaker(
tsi_create_fake_handshaker(true /* is_client */)),
&sc->base));
}
@ -400,9 +400,9 @@ 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(
handshake_mgr,
grpc_security_handshaker_create(
exec_ctx, tsi_create_adapter_handshaker(
tsi_create_fake_handshaker(false /* is_client */)),
&sc->base));
}

@ -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++) {

Loading…
Cancel
Save