re-order ALTS log messages.

pull/17305/head
Yihua Zhang 6 years ago
parent 6fd003fc24
commit 1b115db5db
  1. 11
      src/core/tsi/alts/handshaker/alts_handshaker_client.cc

@ -116,12 +116,13 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
"cb is nullptr in alts_tsi_handshaker_handle_response()"); "cb is nullptr in alts_tsi_handshaker_handle_response()");
return; return;
} }
if (handshaker == nullptr || recv_buffer == nullptr) { if (handshaker == nullptr) {
gpr_log(GPR_ERROR, gpr_log(GPR_ERROR,
"Invalid arguments to alts_tsi_handshaker_handle_response()"); "handshaker is nullptr in alts_tsi_handshaker_handle_response()");
cb(TSI_INTERNAL_ERROR, user_data, nullptr, 0, nullptr); cb(TSI_INTERNAL_ERROR, user_data, nullptr, 0, nullptr);
return; return;
} }
/* TSI handshake has been shutdown. */
if (alts_tsi_handshaker_has_shutdown(handshaker)) { if (alts_tsi_handshaker_has_shutdown(handshaker)) {
gpr_log(GPR_ERROR, "TSI handshake shutdown"); gpr_log(GPR_ERROR, "TSI handshake shutdown");
cb(TSI_HANDSHAKE_SHUTDOWN, user_data, nullptr, 0, nullptr); cb(TSI_HANDSHAKE_SHUTDOWN, user_data, nullptr, 0, nullptr);
@ -133,6 +134,12 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
cb(TSI_INTERNAL_ERROR, user_data, nullptr, 0, nullptr); cb(TSI_INTERNAL_ERROR, user_data, nullptr, 0, nullptr);
return; return;
} }
if (recv_buffer == nullptr) {
gpr_log(GPR_ERROR,
"recv_buffer is nullptr in alts_tsi_handshaker_handle_response()");
cb(TSI_INTERNAL_ERROR, user_data, nullptr, 0, nullptr);
return;
}
grpc_gcp_handshaker_resp* resp = grpc_gcp_handshaker_resp* resp =
alts_tsi_utils_deserialize_response(recv_buffer); alts_tsi_utils_deserialize_response(recv_buffer);
grpc_byte_buffer_destroy(client->recv_buffer); grpc_byte_buffer_destroy(client->recv_buffer);

Loading…
Cancel
Save