Merge pull request #12115 from jiangtaoli2016/next_bytes_to_send

Make bytes_to_send in tsi_handshaker_next const
reviewable/pr12024/r4^2
Jiangtao Li 7 years ago committed by GitHub
commit 56bb36615a
  1. 2
      src/core/lib/security/transport/security_handshaker.c
  2. 2
      src/core/tsi/fake_transport_security.c
  3. 2
      src/core/tsi/transport_security.c
  4. 3
      src/core/tsi/transport_security.h
  5. 2
      src/core/tsi/transport_security_adapter.c
  6. 2
      src/core/tsi/transport_security_interface.h

@ -261,7 +261,7 @@ static grpc_error *do_handshaker_next_locked(
grpc_exec_ctx *exec_ctx, security_handshaker *h, grpc_exec_ctx *exec_ctx, security_handshaker *h,
const unsigned char *bytes_received, size_t bytes_received_size) { const unsigned char *bytes_received, size_t bytes_received_size) {
// Invoke TSI handshaker. // Invoke TSI handshaker.
unsigned char *bytes_to_send = NULL; const unsigned char *bytes_to_send = NULL;
size_t bytes_to_send_size = 0; size_t bytes_to_send_size = 0;
tsi_handshaker_result *handshaker_result = NULL; tsi_handshaker_result *handshaker_result = NULL;
tsi_result result = tsi_handshaker_next( tsi_result result = tsi_handshaker_next(

@ -530,7 +530,7 @@ static void fake_handshaker_destroy(tsi_handshaker *self) {
static tsi_result fake_handshaker_next( static tsi_result fake_handshaker_next(
tsi_handshaker *self, const unsigned char *received_bytes, tsi_handshaker *self, const unsigned char *received_bytes,
size_t received_bytes_size, unsigned char **bytes_to_send, size_t received_bytes_size, const unsigned char **bytes_to_send,
size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result, size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result,
tsi_handshaker_on_next_done_cb cb, void *user_data) { tsi_handshaker_on_next_done_cb cb, void *user_data) {
/* Sanity check the arguments. */ /* Sanity check the arguments. */

@ -198,7 +198,7 @@ tsi_result tsi_handshaker_create_frame_protector(
tsi_result tsi_handshaker_next( tsi_result tsi_handshaker_next(
tsi_handshaker *self, const unsigned char *received_bytes, tsi_handshaker *self, const unsigned char *received_bytes,
size_t received_bytes_size, unsigned char **bytes_to_send, size_t received_bytes_size, const unsigned char **bytes_to_send,
size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result, size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result,
tsi_handshaker_on_next_done_cb cb, void *user_data) { tsi_handshaker_on_next_done_cb cb, void *user_data) {
if (self == NULL) return TSI_INVALID_ARGUMENT; if (self == NULL) return TSI_INVALID_ARGUMENT;

@ -70,7 +70,8 @@ typedef struct {
tsi_frame_protector **protector); tsi_frame_protector **protector);
void (*destroy)(tsi_handshaker *self); void (*destroy)(tsi_handshaker *self);
tsi_result (*next)(tsi_handshaker *self, const unsigned char *received_bytes, tsi_result (*next)(tsi_handshaker *self, const unsigned char *received_bytes,
size_t received_bytes_size, unsigned char **bytes_to_send, size_t received_bytes_size,
const unsigned char **bytes_to_send,
size_t *bytes_to_send_size, size_t *bytes_to_send_size,
tsi_handshaker_result **handshaker_result, tsi_handshaker_result **handshaker_result,
tsi_handshaker_on_next_done_cb cb, void *user_data); tsi_handshaker_on_next_done_cb cb, void *user_data);

@ -140,7 +140,7 @@ static void adapter_destroy(tsi_handshaker *self) {
static tsi_result adapter_next( static tsi_result adapter_next(
tsi_handshaker *self, const unsigned char *received_bytes, tsi_handshaker *self, const unsigned char *received_bytes,
size_t received_bytes_size, unsigned char **bytes_to_send, size_t received_bytes_size, const unsigned char **bytes_to_send,
size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result, size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result,
tsi_handshaker_on_next_done_cb cb, void *user_data) { tsi_handshaker_on_next_done_cb cb, void *user_data) {
/* Input sanity check. */ /* Input sanity check. */

@ -429,7 +429,7 @@ typedef void (*tsi_handshaker_on_next_done_cb)(
tsi_handshaker object. */ tsi_handshaker object. */
tsi_result tsi_handshaker_next( tsi_result tsi_handshaker_next(
tsi_handshaker *self, const unsigned char *received_bytes, tsi_handshaker *self, const unsigned char *received_bytes,
size_t received_bytes_size, unsigned char **bytes_to_send, size_t received_bytes_size, const unsigned char **bytes_to_send,
size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result, size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result,
tsi_handshaker_on_next_done_cb cb, void *user_data); tsi_handshaker_on_next_done_cb cb, void *user_data);

Loading…
Cancel
Save